Basic vehicle path following simulator with steering and acceleration control. The goal of this project is to control the steering of a simple vehicle to follow a given path. Another goal of the project is to control the vehicle's speed, accelerating or braking based on the radius of curvature of the given path.
The file systems.py contains the simulator's system objects.
Single-track kinematic vehicle body model (or bicycle model) object. Stores the vehicle's states (x,y and yaw positions) and inputs (steering angle and acceleration).
The simulator system object is responsible for solving the vehicle model's equations for a small timestep. Therefore, simulating the vehicle's state consists of iterating trough the simulator's simulation step function. Also keeps track of timestamps and total runtime.
The file controllers.py contains the simulator's controller functions. These controllers were designed by our team with the help of professor José C. Geromel. Both controllers receive the current vehicle state and also the position and speed targets and output the controlled variable (steering angle and acceleration).
The file runTrack.py simulates the steering and acceleration control of the vehicle through a complete, randomly generated, race track. The first goal of this script is to control the vehicle's steering angle, so that it passes near every middle point of the race track. The second goal is to maximize the vehicle's speed based on the radius of the track. At every track point, the radius of curvature is calculated using this formula:
Then, we use the centripetal acceleration formula and the calculated radius to calculate the speed that reaches a predefined maximum lateral acceleration. Therefore, the speed of the vehicle will be increased or decreased based on the radius of the path.
Generates a random race track defined by yellow and blue cones, just like in the FSAE DV Trackdrive event!
Contains the simulator's plotting functions
Contains the simulator's constant parameter values