필터 지우기
필터 지우기

Problem with Interactive Multiple Model and Tracking Toolbox

조회 수: 2 (최근 30일)
Andrea Zuccotto
Andrea Zuccotto 2020년 4월 24일
답변: Elad Kivelevitch 2020년 9월 8일
Hi everybody!
I would like to use the "trackingIMM" object for a slightly different application.
Basically instead of tracking a moving object via Kalman Filter I would like to observe a Dynamic System with parameter uncertainties.
The chosen system it's a linear oscillator with linear ordinary differential equations in the form of:
M*diff(x(t), t, 2) + C*diff(x(t), t) + K*x(t) == F(t);
with F(t) being a step input. Now the idea it is to run 2 Kalman filters in parallel, one with say M1, K1, C1 parameters and the other with M2, K2, C2.
K1 = 20; % [N/m] stiffness
K2 = 15; % [N/m] stiffness
M1 = 10; % [Kg] mass
M2 = 14; % [Kg] mass
C1 = 1; % [N*s/m] damping
C2 = 1; % [N*s/m] damping
% x(t+1) = A*x(t) + B*u(t)
% y(t) = C*x(t)
A1 = [0 1; -K1/M1 -C1/M1]; % dynamical matrix
B1 = [0; 1/M1]; % input vector
C = [1 0]; % measurment relation vector - measuring position
With IMM the aim it's to show that if I run a simulation of the real system with M1,K1, C1 the trackingIMM object should give the probability more to the first filter and so obtain an overall better measurment.
I've initialized both the trackingKF and trackingIMM objects:
% filter1
filter1 = trackingKF('MotionModel', 'Custom',...
'State', IC,... % Initial Condition as a parameter
'StateCovariance', StCov,... % Covariance as a parameter
'StateTransitionModel', A1,...
'ControlModel', B1, ...
'MeasurementModel', C,...
'MeasurementNoise', R,...
'ProcessNoise', diag([0 Q]));
initialize(filter1, IC, StCov )
%filter2
filter2 = trackingKF('MotionModel', 'Custom',...
'State', IC,...
'StateCovariance', StCov,...
'StateTransitionModel', A2,...
'ControlModel', B2, ...
'MeasurementModel', C,...
'MeasurementNoise', R,...
'ProcessNoise', diag([0 Q]));
initialize(filter2, IC, StCov )
filters = {filter1; filter2};
modelConv = @switchimm;
transProb = 0.5;
imm = trackingIMM('State', IC,...
'StateCovariance',StCov,...
'TrackingFilters',filters,...
'TransitionProbabilities',transProb,...
'MeasurementNoise', R,...
'ModelConversionFcn',modelConv);
But at this point I get an error with the @switchimm function handle: it tells me the model it's not recognized between constant velocity, constant acceleration, and constant turn. Is there a way to use an own model as the ModelConversionFcn property of the object?
I see that I'm trying to use it not for its proper application, but I was wondering if this is possible or if exist a workaround to solve the issue.
Thank you in advance.
Andrea
  댓글 수: 2
Timothy Engstrom
Timothy Engstrom 2020년 5월 20일
Hi Andrea,
Did you find a solution to your problem? Perhaps you need to make a 'dummy' Model Conversion Function that outputs the same as the input?
Sugar Daddy
Sugar Daddy 2020년 7월 9일
I think this should be answer to every Sensor fusion and tracking toolbox questions

댓글을 달려면 로그인하십시오.

답변 (1개)

Elad Kivelevitch
Elad Kivelevitch 2020년 9월 8일
Andrea,
Apologies for the delay in response. The switchimm function is designed to be used with the models that we shipped in the Sensor Fusion and Tracking Toolbox. In other words, it will support constant velocity, constant acceleration, and constant turn. Since you're using a different model, you have to write your own switching function that can be used with your custom models.
There is a very good reason why that is the case. The switching function needs to convert from model one state space to model two state space. If we don't know what state definition you use in your custom function, we have no way of knowing how to convert it.
Elad

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by