fusemag
Correct states using magnetometer data for
insfilterMARG
Description
[
fuses magnetometer data to correct the state estimate.res
,resCov
] = fusemag(FUSE
,magReadings
,magReadingsCovariance
)
Examples
Fuse Magnetometer Data from 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
Define a magnetometer reading and its covariance. Fuse the reading.
magReading = [132.7000 91.1000 60.5000]; magCovariance = eye(3); [res,resCovariance] = fusemag(filter,magReading,magCovariance)
res = 1×3
105.1450 93.5169 76.5849
resCovariance = 3×3
1.0041 0.0000 -0.0000
-0.0000 1.0041 0.0000
0.0000 -0.0000 1.0041
Display the filter state.
disp(filter.State')
1.0000 -0.0026 0.0076 -0.0056 0 0 0 0 0 0 0 0 0 0 0 0 27.5551 -2.4168 -16.0848 0.0001 0.0001 0.0001
Input Arguments
FUSE
— insfilterMARG
object
object
insfilterMARG
, specified as an object.
magReadings
— Magnetometer readings (µT)
3-element row vector
Magnetometer readings in µT, specified as a 3-element row vector of finite real numbers.
Data Types: single
| double
magReadingsCovariance
— Magnetometer readings error covariance (µT2)
scalar | 3-element row vector | 3-by-3 matrix
Magnetometer readings error covariance in µT2, specified as a scalar, 3-element row vector, or 3-by-3 matrix.
Data Types: single
| double
Output Arguments
res
— Residual
1-by-3 vector of real values
Residual, returned a 1-by-3 vector of real values in µT.
Data Types: single
| double
resCov
— Residual covariance
3-by-3 matrix of real values
Residual covariance, returned a 3-by-3 matrix of real values in (µT)2.
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)