diff --git a/README.md b/README.md new file mode 100644 index 0000000..120c5fa --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +Self-Driving Race Car Simulation +======================================== + +This is an attempt to model a self-driving race car on a track. + + +### Dependencies + +* Java (tested with version 1.7) +* [Processing 3](https://processing.org/download/) + +## How to run code + +Download/clone the project. You can download a zip if that's easier. Otherwise, you can clone it like so: + +```bash +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](simulation_example.png) + + +## 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 diff --git a/simulation_example.png b/simulation_example.png new file mode 100644 index 0000000..f039933 Binary files /dev/null and b/simulation_example.png differ