The goals / steps of this project are the following:
- Complete the Extended Kalman Filter algorithm in C++.
- Ensure that your project compiles.
- Test your Kalman Filter against the sample data. Ensure that the px, py, vx, and vy RMSE are below the values specified in the rubric.
Rubric Points
Here I will consider the rubric points individually and describe how I addressed each point in my implementation.
The code compiles without errors with cmake-3.7.2 and make-3.81 on macOS-10.12.4.
1. The px, py, vx, vy output coordinates have an RMSE <= [0.08, 0.08, 0.60, 0.60] when using the file: "sample-laser-radar-measurement-data-1.txt".
The computationally stable RMSE on sample-laser-radar-measurement-data-1.txt
is [0.0651653, 0.0605378, 0.543192, 0.544191]
.
2. The px, py, vx, vy output coordinates have an RMSE <= [0.20, 0.20, .50, .85] when using the file: "sample-laser-radar-measurement-data-2.txt".
The computationally stable RMSE on sample-laser-radar-measurement-data-2.txt
is [0.185497, 0.190302, 0.476754, 0.804467]
.
1. Your Sensor Fusion algorithm follows the general processing flow as taught in the preceding lessons.
The implemented solution follows the Sensor Fusion method, including the Extended Kalman Filter, which is described in the lesson.
The first measurement is handled by EkfTracker::operator()
defined in ekf_tracker.cpp
.
The method EkfTracker::Predict
is called before EkfTracker::LidarUpdate
or EkfTracker::RadarUpdate
in EkfTracker::operator()
.
Method EkfTracker::LidarUpdate
uses the constant measurement matrix kH
, which is used along with the constant measurement covariance matrix kRlidar
for estimating new state x_
and state covariance matrix P_
.
Method EkfTracker::RadarUpdate
uses the function ConvertCartesianToPolar
to compute h(x')
and CalculateJacobian
to compute the Jacobian matrix Hj
, which are used along with the constant measurement covariance matrix kRradar
for estimating new state x_
and state covariance matrix P_
.
Most duplicating expensive computations (like floating point multiplications and divisions) are done only once and then reused, see functions CalculateJacobian
, ConvertCartesianToPolar
, EkfTracker::Predict
, EkfTracker::LidarUpdate
, EkfTracker::RadarUpdate
in ekf_tracker.cpp
. All constant matrices are moved to a nameless namespace of ekf_tracker.cpp
.
- The code is complying with the Google C++ Style Guide.
- The main Sensor Fusion class EkfTracker is made a functor, which is easy to plug into an algorithm generating estimations out from measurements, see the use of
std::transform
in functionmain
ofmain.cpp
- The C++11 automatic type deduction is used wherever appropriate.
- All function/method comments are made Doxygen-friendly