Main Content

residual

Residuals and residual covariances from direct state measurements for insfilterAsync

Since R2020a

Description

example

[res, resCov]= residual(FUSE,idx,measurement,measurementCovariance) computes the residual, res, and the residual covariance, resCov, based on the direct state measurement and measurement covariance. The measurement maps directly to the states specified by indices, idx.

Examples

collapse all

Create an insfilterAsync object and display its state.

filter = insfilterAsync;
disp(filter.State')
    1.0000         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0   27.5550   -2.4169  -16.0849         0         0         0

Specify a measurement of altitude and vertical velocity.

idx = [8 9 10];
measure = [10 20 30];
measureCov = 1e-2*diag([5 5 5]);

Obtain the residual for the measurement.

[res,rescov] = residual(filter,idx,measure,measureCov)
res = 1×3

    10    20    30

rescov = 3×3

    0.0510         0         0
         0    0.0510         0
         0         0    0.0510

Input Arguments

collapse all

insfilterAsync, specified as an object.

State vector index of measurement to correct, specified as an N-element vector of increasing integers in the range [1, 28].

The state values represent:

StateUnitsIndex
Orientation (quaternion parts)N/A1:4
Angular Velocity (XYZ)rad/s5:7
Position (NED)m8:10
Velocity (NED)m/s11:13
Acceleration (NED)m/s214:16
Accelerometer Bias (XYZ)m/s217:19
Gyroscope Bias (XYZ)rad/s20:22
Geomagnetic Field Vector (NED)μT23:25
Magnetometer Bias (XYZ)μT26:28

Data Types: single | double

Direct measurement of state, specified as a N-element vector. N is the number of elements of the index argument, idx.

Covariance of measurement, specified as an N-by-N matrix. N is the number of elements of the index argument, idx.

Output Arguments

collapse all

Measurement residual, returned as a 1-by-N vector of real values.

Residual covariance, returned as a N-by-N matrix of real values.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2020a