Self-Driving Car Engineer Nanodegree Program
A PID controller is implemented. A message-driven twiddle procedure for PID parameters is implemented. I also did a prototype of message-driven twiddle process in Python first for proof of concept. It may serve as a reference for implementation in C++.
The PID controller with manually selected parameters such as {0.2, 3.0, 0.004} for P, D, I respectively with constant throttle 0.4 can achieve stable driving the full track with top speed of 45 mph.
With adaptive throttle rule of
Painstaking effort were made to search for parameters for safer driving. But I was only able to minimize the number of incidents of traffic violations.
In the future, I might try to use another PID to control the throttle.
I did attempted on the effort, so far with my current
found formula for ideal speed:
Here is a capture of the running at high speed after twiddle process:
The following shows the typical twiddle process.
The follow shows only P component in the controller:
It will only work when there is not much change in the speed of cte change.
The follow shows only the D component in the controller:
It performs even worse, as it does not account for the presence of cte directly, only will account of the change of cte.
This shows only the I component in the controller:
It performs the worst, as it only response to the accumulation of cte.
- 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 == 0.13, but the master branch will probably work just fine
- Follow the instructions in the uWebSockets README to get setup for your platform. You can download the zip of the appropriate version from the releases page. Here's a link to the v0.13 zip.
- If you run OSX and have homebrew installed you can just run the ./install-mac.sh script to install this
- Simulator. You can download these from the project intro page in the classroom.
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./pid
.