- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1
- gcc/g++ >= 5.4
- Run either
- If you install from source, checkout to commit
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
Basic Build Instructions
- Clone this repo.
- Make a build directory:
mkdir build && cd build
cmake .. && make
- Run it:
We've purposefully kept editor configuration files out of this repo in order to keep it as simple and environment agnostic as possible. However, we recommend using the following settings:
- indent using spaces
- set tab width to 2 spaces (keeps the matrices in source code aligned)
Please (do your best to) stick to Google's C++ style guide.
The values double Kp, double Ki, double Kd that are initialized in the PID classes Init() method are defined as follows; proportional coefficient, integral coefficient, differential coefficient.
Kp is the proportional coefficient which is calculated from the cross track error to get steering angles. This is only the P in the PID formula though and if used alone will make the object overshoot the intended trajectory. A lower value here moves the object in less drastic movements, but also means the object moves off the track. A higher value here keeps the object on the track, but also makes for much more drastic steering angles, but of course used alone without the differential or integral the object moved off the track.
Ki is the integral coefficient is used to help with steady state error. It is the sum of the cross track errors over time.
Kd is the differential coefficient is used in conjunction with the cross track error to help avoid overshooting.
The formula used : -Kp * p_error - Kd * d_error - Ki * i_error;
Picking the parameters to successfully make laps around the track was trial and error. I tried high and low values around the same value used in the lessons to start. I watched the car make laps and adjusted to get the best fit visually. The car still jerks side to side and isn't as smooth as a human driver. The PID formula is simple and concise. If I had more time I would of liked to make the turning movements smoother so if a human was actually in the car they wouldn't get sick.
Default starting parameters were : P = 0.9, I = 0.004, D = 3.0
Final starting parameters were : P = 0.15, I = 0.004, D = 5.23
If given more time I would like to plot the correct trajectory and then the one taken then compare the two to figure out if I could improve them further with just the PID equation. One limiting factor is speed. Since I don't take into account the capabilities of the car on the track it is hard to keep the car on the track at speeds over 30. To make movements smoother I think speed would also need to be controlled.