主要内容

correct

Correct state and state estimation error covariance using tracking filter

描述

example

[xcorr,PCORR] = correct(筛选,Zmeas)returns the corrected state,xcorr,以及校正的状态估计误差协方差,PCORR,对于基于当前测量的输入跟踪过滤器的下一个时间步骤,Zmeas. The corrected values overwrite the internal state and state estimation error covariance of筛选.

[xcorr,PCORR] = correct(筛选,Zmeas,测量值)specifies additional parameters used by the measurement function that is defined in theMeasurementFcnproperty of筛选. You can return any of the outputs from preceding syntaxes.

如果筛选is aTrackingkf或者TrackingAbf对象,那么您不能使用此语法。

[xcorr,PCORR] = correct(筛选,Zmeas,zcov)specifies additional measurement covariance,zcov,在suberementNoiseproperty of筛选.

您只能在筛选is aTrackingkf目的。

[xcorr,PCORR,Zcorr] = correct(筛选,Zmeas)还返回测量的校正,Zcorr.

您只能在筛选is aTrackingAbf目的。

[xcorr,PCORR,Zcorr] = correct(筛选,Zmeas,zcov)returns the correction of measurements,Zcorr, and also specifies additional measurement covariance,zcov,在suberementNoiseproperty of筛选.

您只能在筛选is aTrackingAbf目的。

correct(筛选,___)updates筛选with the corrected state and state estimation error covariance without returning the corrected values. Specify the tracking filter and any of the input argument combinations from preceding syntaxes.

xcorr=正确(筛选,___)updates筛选with the corrected state and state estimation error covariance but returns only the corrected state,xcorr.

例子

collapse all

创建二维Trackingekfobject and use name-value pairs to define theStateTransitionJacobianFcn测量jacobianfcn特性。使用预定义的恒定速度运动和测量模型及其雅各布人。

ekf = trackingekf(@constvel,@cvmeas,[0; 0; 0; 0; 0],,...'StateTransitionJacobianFcn',@constveljac,...'MeasurementJacobianFcn',@cvmeasjac);

运行过滤器。使用预测correctfunctions to propagate the state. You may call预测correctin any order and as many times you want. Specify the measurement in Cartesian coordinates.

measurement = [1;1;0]; [xpred, Ppred] = predict(EKF); [xcorr, Pcorr] = correct(EKF,measurement); [xpred, Ppred] = predict(EKF); [xpred, Ppred] = predict(EKF)
xpred =4×11.2500 0.2500 1.2500 0.2500
ppred =4×411.7500 4.7500 0 0 4.7500 3.7500 0 0 0 0 11.7500 4.7500 0 0 4.7500 3.7500

Input Arguments

collapse all

Filter for object tracking, specified as one of these objects:

Measurement of the tracked object, specified as a vector or matrix.

Data Types:single|double

Measurement function arguments, specified as a comma-separated list of arguments. These arguments are the same ones that are passed into the measurement function specified by theMeasurementFcnproperty of the tracking filter.如果筛选is aTrackingkf或者TrackingAbfobject, then you cannot specify测量值.

Suppose you setMeasurementFcnto@cameas, and then callcorrect:

[xcorr,Pcorr] = correct(filter,frame,sensorpos,sensorvel)
correct函数在内部调用以下内容:
meas = cameas(state,frame,sensorpos,sensorvel)

测量协方差,指定为M-经过-M矩阵,哪里Mis the dimension of the measurement. The same measurement covariance matrix is assumed for all measurements inZmeas.

Data Types:single|double

Output Arguments

collapse all

Corrected state of the filter, specified as a vector or matrix. TheState输入的属性筛选is overwritten with this value.

过滤器的校正状态协方差,指定为向量或矩阵。这司法协助输入的属性筛选is overwritten with this value.

Corrected measurement of the filter, specified as a vector or matrix. You can returnZcorronly when筛选is aTrackingAbf目的。

Extended Capabilities

C/C++ Code Generation
使用MATLAB®CODER™生成C和C ++代码。

Introduced in R2018b