Self-Driving Car Engineer Nanodegree Program
author : s.aparajith@live.com
date: 27.04.2021
build matrix : arm64 and amd64 on linux 20.04
In this project a kalman filter will be utilized to estimate the state of a moving object of interest with noisy lidar and radar measurements.
This project involves the Term 2 Simulator which can be downloaded here.
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
- ./ExtendedKF
Here is the main protocol that 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
["rmse_x"]
["rmse_y"]
["rmse_vx"]
["rmse_vy"]
- cmake >= 3.5
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 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
- Windows: recommend using MinGW
- Clone this repo.
- Make a build directory:
mkdir build && cd build
- Compile:
cmake .. && make
- On windows, you may need to run:
cmake .. -G "Unix Makefiles" && make
- On windows, you may need to run:
- Run it:
./ExtendedKF
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.
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.
main.h
the main entry point of the application
FusionEKF.h
contains the class FusionEKF
with the following member function
ProcessMeasurement(...)
which runs one step of the EKF fusioning algorithm of predict-update cycle using the fed in measurements.
kalman-filter.h
contains the class KalmanFilter
which contains the algorithm to run a predict and update measurement cycle of an Extended kalman filter.
Predict()
does the predictionUpdate(...)
does the update using the Kalman filter update equationsUpdateEKF(...)
does the update for the Extended Kalman FilterKfCommonUpdates(...)
is a common update function for the equations common to the EKF and KF
tools.h
contains the class Tools
which have methods to compute
CalculateRMSE
computes the root mean squared error using the measurements and the ground-truthCalculateJacobian
computes the jacobian matrix for the EKF.
measurement_package.h
contains the class MeasurementPackage
that help in fetching and handling raw radar and lidar data.
types.h
contain the fundamental datatypes used in this project.
Sensors | dataset 1 | dataset 2 |
---|---|---|
RADAR + LIDAR | ||
RADAR | ||
LIDAR |
From the above table of results:
- it was noted from the RMSE readings the LIDAR seems to fare better than the RADAR measurements
- However, for x component of the velocity seems to fare a bit better in the RADAR case than the LIDAR case
- With the fusioning algorithm, with both the RADAR and LIDAR measurements the RMSE of both positions and velocities were within the [.11, .11, 0.52, 0.52] margin as expected in the rubrik.