Extended Kalman Filter in C++
This Github repository was created for sharing the application implemented for the Fifth project of the Term 1 of Udacity’s Self Driving Car Nanodegree program
The original project repository containing the template code used in this project is CarND-Extended-Kalman-Filter-Project
In this project you will utilize a kalman filter to estimate the state of a moving object of interest with noisy lidar and radar measurements. Passing the project requires obtaining RMSE values that are lower than the tolerance outlined in the project rubric.
This project involves the Term 2 Simulator which can be downloaded from: Term 2 Simulator.
This repository includes two files that can be used to set up and install uWebSocketIO for either Linux or Mac systems. For windows you can use either Docker, VMware, or even Windows 10 Bash on Ubuntu to install uWebSocketIO. Please see the uWebSocketIO Starter Guide page in the classroom within the EKF Project lesson for the required version and installation scripts.
Once the install for uWebSocketIO is complete, the main program can be built and run by doing the following from the project top directory.
mkdir build cd build cmake .. make ./CarND_Extended_Kalman_Filter
Tips for setting up your environment can be found in the classroom lesson for this project.
Note that the programs that need to be written to accomplish the project are source/FusionEKF.cpp, source/FusionEKF.h, source/kalman_filter.cpp, source/kalman_filter.h, source/tools.cpp, and source/tools.h
The program source/main.cpp has already been filled out, but feel free to modify it.
Here is the main protocol that source/main.cpp uses for uWebSocketIO in communicating with the simulator.
INPUT: values provided by the simulator to the c++ program
[“sensor_measurement”] => the measurement that the simulator observed (either lidar or radar)
OUTPUT: values provided by the c++ program to the simulator
[“estimate_x”] <= kalman filter estimated position x
[“estimate_y”] <= kalman filter estimated position y
Other Important Dependencies
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- gcc/g++ >= 5.4
Basic Build Instructions
- Clone this repo.
- Make a build directory:
mkdir build && cd build
cmake .. && make
- On windows, you may need to run:
cmake .. -G "Unix Makefiles" && make
- On windows, you may need to run:
- Run it:
Generating Additional Data
This is optional!
If you’d like to generate your own radar and lidar data, see the utilities repo for Matlab scripts that can generate additional data.
Project Instructions and Rubric
Note: regardless of the changes you make, your project must be buildable using cmake and make!
More information is only accessible by people who are already enrolled in Term 2 (three-term version) or Term 1 (two-term version) of CarND. If you are enrolled, see the Project Resources page in the classroom for instructions and the project rubric.
Hints and Tips!
- You don’t have to follow this directory structure, but if you do, your work will span all of the .cpp files here. Keep an eye out for TODOs.
Students have reported rapid expansion of log files when using the term 2 simulator. This appears to be associated with not being connected to uWebSockets. If this does occur, please make sure you are conneted to uWebSockets. The following workaround may also be effective at preventing large log files.
- create an empty log file
- remove write permissions so that the simulator can’t write to log
- Please note that the
Eigenlibrary does not initialize
MatrixXdobjects with zeros upon creation.