As seen above, the RSU data is not error-free. Also, there are parts of measurements where the RSU cannot see the vehicle and it does not report any data during that time. This can occur due to a shadowing effect or other disturbances.
In order to tackle those problems, a Kalman filter has been introduced for the RSU data. A Kalman filter can produce a statistically optimal path estimate for some given noisy path observations given that the process model, process noise and measurement noise are known or can be estimated [17].
Dynamic model
To describe the vehicle dynamics, we use a constant velocity model (CV) ([18], p. 338), as depicted below:
(1)
where x
k
= [p
k
v
k
]T is the state of the system, u
k
is an optional control input, w
k
is the process noise, z
k
is the measurement, ν
k
is the measurement noise and
(3)
where Δ t is the time between each measurement observation. Moreover, the process noise w
k
and measurement noise ν
k
are assumed to be normally distributed with mean μ = 0 and covariance and [19]. H is the identity matrix since there are measurements for both components of the state (position p
k
and velocity v
k
), and it is assumed that these measurements are independent.
Implementation
The Kalman filter implementation utilizes a recursive algorithm which consists of a time update, where the next state of the system is ‘predicted’, and a measurement update, where the earlier prediction is ‘corrected’.
During the time update, the following operations are performed:
(5)
(6)
Also, when there is a measurement observation at a certain time slot, a measurement update is being performed with the following operations:
(7)
(8)
(9)
If a measurement observation is missing, then the same operations are being performed, but with Kalman gain set to zero,
Here, and are priori (before measurement update) and and P
k
are posteriori (after measurement update) state estimate and error covariance, respectively. K
k
is the Kalman gain. B and H are not seen in the equations above since B = 0 and H = I.
Parameter estimation
The process noise covariance Q, measurement noise covariance R, initial error covariance P0 and initial state vector are Kalman filter parameters that have to be estimated.
The process noise is often unknown and that complicates the estimation of the filter parameters. However, since the GPS data is much more accurate than the RSU data, it is assumed that the GPS data is error-free in order to get an acceptable filter parameter estimation. Also, as Welch and Bishop [19] state, ‘Often times, superior filter performance (statistically speaking) can be obtained by tuning the filter parameters Q and R’.
Q and R
The process noise covariance Q was calculated from the distribution of the GPS data noise and tuned in a way that minimizes the root mean square measurement error (RMSE):
(13)
(14)
The measurement noise covariance R was similarly calculated by looking at the distribution of the error between the GPS and RSU data:
(15)
(16)
Both distributions were assumed to be Gaussian.
Initial error covariance P0
The initial error covariance P0 was set equal to the process noise covariance Q and tuned by a factor that minimizes the root mean square measurement error (RMSE):
(17)
(18)
Initial state vector
The initial state vector contains two components; the initial position and the initial velocity . The initial position was set equal to the first measurement observation and the initial velocity was set equal to the mean velocity for each coordinate; m/s and m/s.
Results
The aim with Kalman filtering was to smoothen and predict the path for gaps in the RSU data. As it can be seen in Figures 11, 12 and 13, the goal has been reached.
The RMS measurement error for the X coordinate has decreased from RMSE
x
= 248 cm to RMSE
x
= 146 cm. The RMS measurement error for the Y coordinate has remained the same at RMSE
y
= 38 cm. However, for most of the measurements, as the one depicted in Figures 11 and 12, the error has decreased. It has increased for a handful of measurements which brings the RMSE up.