Extended Kalman Filter Project
The goals/steps of this project are the following:
- Utilize a Kalman filter to estimate the state of a moving object of interest
- With noisy RADAR/LIDAR measurements
- Obtaining RMSE values less than/equal to [.11, .11, 0.52, 0.52]
Minimum execution environment is undefined.
Project was developed using the following environment:
Category | Item |
---|---|
OS | Windows 10 |
CPU | Intel i7/6800k |
RAM | 64GB |
GPU | nVidia GTX 1060 |
VRAM | 6GB |
Storage | SATA SSD |
IDE | JetBrains CLion (and) Linux for Windows (Ubuntu) |
This capability includes of the following source code files modified for this project:
- FusionEKF.cpp implements sensor fusion functionality. Kalman filter initialization and prediction workflow code has been added here.
- kamlan_filter.cpp implements the Kalman filter iteself. Update and prediction code has been added here.
- tools.cpp implements support capabilities. RMSE and Jacobian matrix code has been added here.
Almost all additions have been derived from project source material.
This remainder of source code/configuration files were provided with the project template.
A running Term 2 simulator is necessary for evaluation of this capability.
Obtain the Term 2 simulator via its Github repo.
Once target environment perquisites are met, the simulator may be executed as a standalone application within the OS.
Once the simulator is running, select the "Project 1/2: EKF and UKF" scenario to prepare for evaluation.
The capability is built from this project source code as a standalone application named "ExtendedKF".
Obtain this capability via its Github repo.
Build using OS-specific cmake
and make
commands.
Windows build shown (via JetBrains CLion):
/usr/bin/cmake --build /mnt/[...]/CarND-Extended-Kalman-Filter-Project/cmake-build-debug --target ExtendedKF -- -j 6
Scanning dependencies of target ExtendedKF
[ 40%] Building CXX object CMakeFiles/ExtendedKF.dir/src/main.cpp.o
[ 60%] Building CXX object CMakeFiles/ExtendedKF.dir/src/tools.cpp.o
[ 80%] Building CXX object CMakeFiles/ExtendedKF.dir/src/FusionEKF.cpp.o
[ 80%] Building CXX object CMakeFiles/ExtendedKF.dir/src/kalman_filter.cpp.o
[100%] Linking CXX executable ExtendedKF
[100%] Built target ExtendedKF
Once built, execute "ExtendedKF" from the command line.
Windows execution shown (via JetBrains CLion):
/mnt/[...]/CarND-Extended-Kalman-Filter-Project/cmake-build-debug/ExtendedKF
Listening to port 4567
Connected!!!
Once "ExtendedKF" is running and indicating connection, start the simulator run as shown:
Video of the entire build/run cycle may be found here.
Rubric Points are discussed individually with respect to the implementation.
Code must compile without errors with cmake and make. Given that we've made CMakeLists.txt as general as possible, it's recommended that you do not change it unless you can guarantee that your changes will still compile on any platform.
See instructions and video, above.
Your algorithm will be run against Dataset 1 in the simulator which is the same as "data/obj_pose-laser-radar-synthetic-input.txt" in the repository. We'll collect the positions that your algorithm outputs and compare them to ground truth data. Your px, py, vx, and vy RMSE should be less than or equal to the values [.11, .11, 0.52, 0.52].
Net accuracy as demonstrated is approximately [0.09, 0.09, 0.45, 0.44].
While you may be creative with your implementation, there is a well-defined set of steps that must take place in order to successfully build a Kalman Filter. As such, your project should follow the algorithm as described in the preceding lesson.
main.cpp encapsulates the initialize, measure, predict, and repeat process described in preceding lessons as follows:
- Receives simulator data packets
- Demarshals from JSON
- Captures and tailors measurements according to source (RADAR, LIDAR)
- Updates Kalman filter and generates predictions
- Calculates RMSE based on prediction deviation from measurement
Your algorithm should use the first measurements to initialize the state vectors and covariance matrices.
Initialization is performed in the constructor and ProcessMeasurement
methods found in FusionEKF.cpp. The is_initialized_
member variable is used to mediate this initialization.
Upon receiving a measurement after the first, the algorithm should predict object position to the current timestep and then update the prediction using the new measurement.
Updates to the state transition matrix are performed in the ProcessMeasurement
method found in FusionEKF.cpp. Predictions are initiated there and performed in the Predict
method found in kalman_filter.cpp. Updates are subsequently performed in the Update
method also found in kalman_filter.cpp.
Your algorithm sets up the appropriate matrices given the type of measurement and calls the correct measurement function for a given sensor type.
RADAR/LIDAR measurements are first discriminated by type in main.cpp, then in terms of prediction matrix and update preparation in the ProcessMeasurement
method found in FusionEKF.cpp.
This is mostly a "code smell" test. Your algorithm does not need to sacrifice comprehension, stability, robustness or security for speed, however it should maintain good practice with respect to calculations (...).
This is mitigated by this project's constrained scope -- the structure of the codebase is predefined and core algorithm already developed during preceding lessons. That said, both the provided and developed code exclusively reflect the central use case and compiles, runs, and performs adequately in the target environment.