Main Content

residualgps

Residuals and residual covariance from GPS measurements for insfilterNonholonomic

Since R2020a

Description

[res,resCov] = residualgps(FUSE,position,positionCovariance) computes the residual, res, and the residual covariance, resCov, based on the GPS position measurement and covariance.

example

[res,resCov] = residualgps(FUSE,position,positionCovariance,velocity,velocityCovariance) computes the residual, res, and the residual covariance, resCov, based on the GPS position measurement and covariance.

Examples

collapse all

Create an insfilterNonholonomic object and display its state.

filter = insfilterNonholonomic;
disp(filter.State')
     1     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0

Define GPS data with a position reading and a covariance.

position = [5 3 2] % in deg deg meters
position = 1×3

     5     3     2

positionCovariance = diag([1 1 1]);

Obtain the residual of the data.

[res,resCovariance] = residualgps(filter,position,position)
res = 1×3
105 ×

    5.5218    3.3254    0.3282

resCovariance = 3×3

     6     0     0
     0     4     0
     0     0     3

Input Arguments

collapse all

insfilterNonholonomic, specified as an object.

Position of GPS receiver in geodetic latitude, longitude, and altitude (LLA) specified as a real finite 3-element row vector. Latitude and longitude are in degrees with north and east being positive. Altitude is in meters.

Data Types: single | double

Position measurement covariance of GPS receiver in m2, specified as a 3-by-3 matrix.

Data Types: single | double

Velocity of the GPS receiver in the local NED coordinate system in m/s, specified as a 3-element row vector.

Data Types: single | double

Velocity measurement covariance of the GPS receiver in the local NED coordinate system in m2/s2, specified as a 3-by-3 matrix.

Data Types: single | double

Output Arguments

collapse all

Position and course residual, returned as a 1-by-3 vector of real values the inputs only contain position information, and returned as a 1-by-4 vector of real values if the inputs also contain velocity information.

Residual covariance, returned as a 3-by-3 matrix of real values if the inputs only contain position information, and a 4-by-4 vector of real values if the inputs also contain velocity information.

Extended Capabilities

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

Version History

Introduced in R2020a