Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Generalised Program for Simulating the Operation of Vehicles (70 Marks) In this problem, you are going to write a code that will simulate two

A Generalised Program for Simulating the Operation of Vehicles (70 Marks)

In this problem, you are going to write a code that will simulate two types of vehicles: i) a mobile robot, and ii) an autonomous bicycle. The mobile robot has two DC motors. The bicycle has one DC motor at the back and a stepper motor in the front for steering. The movement of the mobile robot and the bicycle are based on differential drive model and bicycle model, respectively. Figure 1 presents the model and equations for each type of the vehicle. Your solution should have a C++ code and a MATLAB code. Your C++ code should include: 1) A motor class that has public/private data and functions for implementing the motion of DC and stepper motors. You will design the data and functions (including constructor(s) and destructor(s)) of this class and decide whether they should be public or private. (10 Marks) 2) A robot class and a car class that has public/private data and functions for implementing corresponding models using the motor class. They should also inherit certain data and functions from a vehicle class. You will design the data and functions (including constructor(s) and destructor(s)) of each class and decide whether they should be public or private. (15 Marks) 3) An iofile class that can read and write comma separated values (CSV) files. Again, you will design the data and functions (including constructor(s) and destructor(s)) of this class and decide whether they should be public or private. (10 Marks). 4) Asking user to specify the configuration filename that contains the following information (as a CSV file): the type of the vehicle, DC motor rpm, stepper motor step angle (if applicable), wheel radius, trackwidth (if applicable), wheel base (if applicable). You will design the format and order of the information in the file. Your code should read the configuration file using the iofile class you have created. (8 Marks) 5) Using the parameters provided in the configuration file, moving the vehicle from (5, 5) position to (5, 25). All coordinates are in meters. The starting orientation of the vehicle is 0 degrees. The vehicle should first rotate itself towards the target and then move straight towards the target. (10 Marks) 6) Using the iofile class, writing the pose (position and orientation) of the vehicle at each iteration into a CSV file. Each line should contain: position-x, position-y, orientation. (7 Marks)

image text in transcribed

Figure 1: (a) Differential drive model, (b) bicycle model

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions