The goal of this project is to implement a PID controller to help a car drive around a simulated track autonomously. The model receives a Cross Track Error value which is used to calculate the returned steering angle and throttle values.
My current approach is to experiment with possible values for P, I and D gain values manually at first in order to reach an optimal starting point to run Twiddle or SGD or another optimization algorithm. This is done because when the values are too large, the vehicle immediately spins out of control or drives off the road.
The approach is not optimal for real world usage because it does not take into account the physics of movement or the physics of the vehicle. However, it works great as a controller for small vehicles with limited processing power.
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
- Windows: recommend using MinGW
- uWebSockets
- Run either
./install-mac.sh
or./install-ubuntu.sh
. - If you install from source, checkout to commit
e94b6e1
, i.e.Some function signatures have changed in v0.14.x. See this PR for more details.git clone https://github.com/uWebSockets/uWebSockets cd uWebSockets git checkout e94b6e1
- Run either
- Simulator. You can download these from the project intro page in the classroom.
There's an experimental patch for windows in this PR
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./pid
.