Skip to content
Permalink
74a30974ed
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Self-Driving Race Car Simulation

This is an attempt to model a self-driving race car on a track.

Dependencies

How to run code

Download/clone the project. You can download a zip if that's easier. Otherwise, you can clone it like so:

git clone https://github.uconn.edu/CarSimClassProj/RaceCarSim.git

Once you have processing installed, and you have downloaded the project. Open processing, and navigate to the folder containing our project. Open the simulation.pde file (it's the main file of our project).

When the project is open just press run and you should see something like this:

simulation example

What's Happening?

The Track

The track is defined as a series of nodes in a graph. The black line you see defines a path through the track, which the is the middle line of the track. It's a path that avoid collisions, but is not the optimal path through the course.

The Cars

The cars (vehicle.pde) are defined by the bicycle model. We took into consideration forces on the vehicle, and limitations to their capabilities. Such as applying a maxspeed and maxforce to each.

The cars follow a path they're given, and try not to deviate from that path. The cars are controlled by the pure pursuit controller. This algorithm uses a notion of look-ahead points that the car tries to pursue. So a path for each car is defined as a series of look-ahead points.

The setup (i.e. the experiment)

What you currently see on the track is two cars, both assigned the same path, which is the center line through the track. Both are initially placed near the center line, and the only differential factors between them is their maxforce. The maxforce is essentially the acceleration of the vehicle, and this influences the car's steering behavior. Having a higher maxforce will cause the car to respond sooner to turns so it can make the turn. Ideally we would model the full kinematics of the vehicle to account for slipping, but for now, a car with a maxforce can noticeably move faster around the track.

Why does it do something weird during the first lap half way around the track?

We wanted to introduce some noise into the experiment. By that we mean to purposely move the cars off course of their path and see how well they respond to this disturbance. You'll find that the pure pursuit algorithm goes a good job of getting them back on track.

Note: because we're not modeling all the kinematics and dynamics of the car, the car does not oscillate about the set point (i.e. the path). So you can think of it in the most ideal conditions without friction and other complex forces acting on the car