How to define bespoke MeasurementModel with trackingKF
Mostra commenti meno recenti
Hello, I am fusing radar and mono-camera data together in a Kalman Filter as part of a tracking algorithm and I am using the sensor input dataset from the MatLab demo “Forward Collision Warning Using Sensor Fusion” which is in a cartesian coordinate frame.
In an extended KF when I use 'trackingEKF' I can call up a bespoke measurement function which switches depending on whether the sensor ID is radar or camera since the filter options accept function handles (refer below showing the 'trackingEKF' calling the bespoke measurement function 'cvmeas2FFullState'), and it runs fine.
filter = trackingEKF('State', H1 * ste, ...
'StateCovariance', steCov, ...
'MeasurementNoise', detectionClusters.MeasurementNoise(1:4,1:4), ...
'StateTransitionFcn', @constvel2d, ...
'MeasurementFcn', @cvmeas2DFullState, ...
'StateTransitionJacobianFcn', @constvel2djac, ...
'MeasurementJacobianFcn', @cvmeas2DFullStateJac,...
'ProcessNoise', Q);
% Measurement function:
function meas = cvmeas2DFullState(state, sensorID, varargin)
% The measurements depend on the sensor type, which is reported by
% the MeasurementParameters property of the objectDetection. The following
% two sensorID values are used:
% sensorID=1: video objects, the measurement is [x;vx;y] i.e. vy not measured.
% sensorID=2: radar objects, the measurement is [x;vx;y;vy].
% The state depends on the motion model used (in this case constant vel):
% Constant velocity state = [x;vx;y;vy]
switch sensorID
case 1 % vision data where vy=0
H = [1 0 0 0; 0 0 1 0; 0 1 0 0; 0 0 0 0];
meas = H*state(:);
case 2 % radar data
H = [1 0 0 0; 0 0 1 0; 0 1 0 0; 0 0 0 1];
meas = H*state(:);
end
end
However, if I use a linear Kalman Filter 'trackingKF' with the filter option 'MotionModel', 'Custom', then the 'MeasurementModel' doesn't accept function handles and I am not able to call the same bespoke measurement function with the sensor-dependent switching - is there any way I can generate the switching measurement model as in the 'trackingEKF' ?
Also, if I use an extended Kalman Filter (trackerEKF) with linear dynamic model and linear sensor model, both in cartesian coordinate frame (as in MatLab demo “Forward Collision Warning Using Sensor Fusion”), where the raw radar and camera data is provided in cartesian frame, would this be expected to perform as a linear Kalman Filter ?
1 Commento
William Campbell
il 21 Mag 2021
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Tracking and Sensor Fusion in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!