Main Content

correct

Correct states using direct state measurements for insfilterMARG

Description

example

correct(FUSE,idx,measurement,measurementCovariance) corrects the state and state estimation error covariance based on the measurement and measurement covariance. The measurement maps directly to the state specified by the indices idx.

Examples

collapse all

Create an insfilterMARG object and display its state.

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

Fuse a position measurement with its corresponding covariance.

idx = [5 6 7];
measure = [10 10 0];
measureCov = 1e-4*diag([5 5 5]);
correct(filter,idx,measure,measureCov)

Display the state after the fusing.

disp(filter.State')
    1.0000         0         0         0    0.0200    0.0200         0         0         0         0         0         0         0         0         0         0   27.5550   -2.4169  -16.0849         0         0         0

Input Arguments

collapse all

insfilterMARG, specified as an object.

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

The state values represent:

StateUnitsIndex
Orientation (quaternion parts) 1:4
Position (NED)m5:7
Velocity (NED)m/s8:10
Delta Angle Bias (XYZ)rad11:13
Delta Velocity Bias (XYZ)m/s14:16
Geomagnetic Field Vector (NED)µT17:19
Magnetometer Bias (XYZ)µT20:22

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.

Data Types: single | double

Covariance of measurement, specified as a scalar, N-element vector, or N-by-N matrix. N is the number of elements of the index argument, idx.

Data Types: single | double

Extended Capabilities

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

Version History

Introduced in R2018b