Self-Driving Car Engineer Nanodegree Program
The goal of this project is to utilize a kalman filter to estimate the state of a moving object of interest with noisy lidar and radar measurements.
The project code is broken up into several different classes:
- An abstract
Sensor
class. - A
FusionEKF
class. - A
KalmanFilter
class.
The purpose of the sensor class is to hold data and methods that are unique to the sensor. The data the class holds are
- The measurement noise covariance matrix,
R
. - The type of sensor:
linear
orextended
.
The abstract methods include
meas_state_difference(measure, state)
: compute the difference between the measured state and the predicted measurement based on the state. This function handles angle wrapping for the Radar sensor.state_to_measure(state)
: Convert from state space to measurement space.measure_to_state(meas)
: Convert from measurement space to state space.Jacobian(state)
: Compute the Jacobian of the coordinate conversion from state to measurement space. This is a private method.
Additionally, the Sensor
class has a method H(state)
that returns the H matrix to be used for computing the covariance matrix.
The abstract Sensor
class is used to define two different concrete classes, Radar
and Lidar
. These classes implement the virtual functions listed above.
This class handles fusing data from multiple sensors to track a object. The methods include
ProcessMeasurement(MeasurementPackage)
: primary method that initializes the Kalman filter using the first measurement, and then updates it using subsequent measurements.F(dt)
: This method takes in the time since the last measurement and returns the state transition matrixF
.Q(dt)
: This method takes in the time since the last measurement and returns the process covariance matrixQ
.
This class also contains instances of the KalmanFilter
, Radar
, and Lidar
classes.
This class contains three methods:
Init(x,P,F,Q)
: Initialize the filter using a known statex
, covarianceP
, state transition matrixF
, and process covariance noiseQ
.Predict()
: Propagate the state forward in time.Update(meas, Sensor)
: Take in a new measurement and theSensor
that produced the measurement and update the filter's state and covariance.
I modified the default CMakeLists.txt to include the Sensors.h and Sensors.cpp files.