Self-Driving Car Engineer Nanodegree Program
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1(mac, linux), 3.81(Windows)
- 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
.
Tips for setting up your environment can be found here
- First, I used
PID::Init()
function to initialize the Kp, Ki, Kd coefficients. - Then, I calculated the error by
PID::UpdateError
function for each cte input. - Finally, I calculate the steering_angle by
PID::GetSteerValue
function and return to the simulator.
P: P coefficient controls the vehicle to drive to the road center. For examples, it controls the turning angle of the vehicle while the vehicle is turning. When P coefficient is large, it can be turning quickly in curved road, However, in the straight road, it leads the vehicle oscillates faster. D: In order to reduce the vehicle oscillates, D coefficient is introduced. D coefficient can be effectively reduce the vehicle oscillates. I: Besides, if the vehicle has systemcatic bias, we need use the I coefficient. I coefficient can be used to reduce impact of the vehicle systemcatic bias. But it also should not be too large, it will leads the vehicle oscillates too.
I have chosen the P, I, D coefficients by manual tuning. First, I used the classroom PID project params as beginning: 0.2, 0.004, 3.0. Then, I started the program, but I found the car is oscillates seriously. In the expriments, I find the P coefficients cannot be reduce, it will lead to the car cannot pass the curved road, so I decrease the I coefficient to 0.005. Finally, in order to make the car more stable, I increase the D coefficient to 5.0.