fusegps
Correct states using GPS data for insfilterMARG
Syntax
Description
[
fuses GPS position data to correct the state estimate.res
,resCov
] = fusegps(FUSE
,position
,positionCovariance
)
[
fuses GPS position and velocity data to correct the state estimate.res
,resCov
] = fusegps(FUSE
,position
,positionCovariance
,velocity
,velocityCovariance
)
Examples
Fuse GPS Data Using insfilterMARG
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 GPS position measurement with its covariance.
position = [5 3 2] % in deg deg meters;
position = 1×3
5 3 2
positionCovariance = diag([1 1 1]); [res,resCovariance] = fusegps(filter,position,positionCovariance)
res = 1×3
105 ×
5.5218 3.3254 0.3282
resCovariance = 3×3
1.0000 0 0
0 1.0000 0
0 0 1.0000
Display the state after the fusing.
disp(filter.State')
1.0000 0 0 0 0.5522 0.3325 0.0328 0 0 0 0 0 0 0 0 0 27.5550 -2.4169 -16.0849 0 0 0
Input Arguments
FUSE
— insfilterMARG
object
object
insfilterMARG
, specified as an object.
position
— Position of GPS receiver (LLA)
three-element row vector
Position of GPS receiver in geodetic latitude, longitude, and altitude (LLA) specified as a real finite three-element row vector. Latitude and longitude are in degrees with north and east being positive. Altitude is in meters.
Data Types: single
| double
positionCovariance
— Position measurement covariance of GPS receiver (m2)
3-by-3 matrix
Position measurement covariance of GPS receiver in m2, specified as a 3-by-3 matrix.
Data Types: single
| double
velocity
— Velocity of GPS receiver in local NED coordinate system (m/s)
three-element row vector
Velocity of the GPS receiver in the local NED coordinate system in m/s, specified as a three-element row vector.
Data Types: single
| double
velocityCovariance
— Velocity measurement covariance of GPS receiver (m2/s2)
3-by-3 matrix
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
res
— Residuals
three-element row vector of real values | six-element row vector of real values
Residuals, returned as either a three-element or six-element row vector of real
values depending on which syntax you use. If you use the first syntax to specify only
the position
and positionCovariance
arguments,
then res
is a three-element row vector of real values containing
the xyz-position residuals. If you use the second syntax to
additionally specify the velocity
and
velocityCovariance
arguments, then res
is a
six-element row vector of real values containing the xyz-position and
-velocity residuals.
resCov
— Residual covariance
3-by-3 matrix of real values | 6-by-6 matrix of real values
Residual covariance, returned as a 3-by-3 or 6-by-6 matrix of real values depending
on which syntax you use. If you use the first syntax to specify only the
position
and positionCovariance
arguments,
then resCov
is a 3-by-3 matrix of real values containing the
xyz-position residual covariance. If you use the second syntax to
additionally specify the velocity
and
velocityCovariance
arguments, then resCov
is
a 6-by-6 of real values containing the xyz-position and -velocity
residual covariance.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2018b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)