Reference no: EM133310475
Problem 1: A Generalised Program for Simulating the Operation of Vehicles
Figure 1: (a) Differential drive model, (b) bicycle model
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.
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.
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.
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.
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.
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.
Your MATLAB code should include:
7) Reading the pose CSV file and plotting the position (as x-y plot) and orientation (as angle) separately.
Problem 2: A Geometric Transformation Tool for Laser Scanner Distance Sensors
Figure 2: A mobile robot with a distance sensor
Distance sensors provide information about the environment. Laser scanners can sweep the environment and provide a distance measurement at a certain angle value.
Your solution should have a Python code and a MATLAB code. Your Python code should include:
1) A laserscan module (as .py file) that reads and writes laser scan data in polar (distance measurements and measurement angles) or cartesian (x, y) coordinates. It can use csv module to read and write CSV files. It should be able to transform the laser data from polar to cartesian coordinates and vice a versa. In addition, it should also do filtering on laser scan by setting lower/upper limits on measurement angles.
2) Reading "laserscan.csv" file which contains a laser data in cartesian coordinates. In order to remove the unreliable laser data because of the long standoffs (Figure 2), it should filter out the measurements in (-π/2, -π/4) and (π/4, π/2).
Your MATLAB code should include:
1) Reading the filtered laser scan data from the CSV file and plotting the laser scan.