insfilterMARG
Estimate pose from MARG and GPS data
Description
The insfilterMARG
object implements sensor fusion of MARG and GPS
data to estimate pose in the NED (or ENU) reference frame. MARG (magnetic, angular rate,
gravity) data is typically derived from magnetometer, gyroscope, and accelerometer sensors.
The filter uses a 22-element state vector to track the orientation quaternion, velocity,
position, MARG sensor biases, and geomagnetic vector. The insfilterMARG
object
uses an extended Kalman filter to estimate these quantities.
Creation
Syntax
Description
creates an
filter
= insfilterMARGinsfilterMARG
object with default property values.
allows you to specify the reference frame, filter
= insfilterMARG('ReferenceFrame',RF
)RF
, of the
filter
.
sets one or more properties using name-value arguments in addition to any of the previous
input arguments.filter
= insfilterMARG(___,Name=Value
)
Input Arguments
Properties
Object Functions
correct | Correct states using direct state measurements for insfilterMARG
|
residual | Residuals and residual covariances from direct state measurements for
insfilterMARG |
fusegps | Correct states using GPS data for insfilterMARG |
residualgps | Residuals and residual covariance from GPS measurements for
insfilterMARG |
fusemag | Correct states using magnetometer data for
insfilterMARG |
residualmag | Residuals and residual covariance from magnetometer measurements for
insfilterMARG |
pose | Current orientation and position estimate for
insfilterMARG |
predict | Update states using accelerometer and gyroscope data for
insfilterMARG |
reset | Reset internal states for insfilterMARG |
stateinfo | Display state vector information for insfilterMARG |
tune | Tune insfilterMARG parameters to reduce estimation
error |
copy | Create copy of insfitlerMARG |
Examples
Algorithms
Note: The following algorithm only applies to an NED reference frame.
insfilterMARG
uses a 22-axis extended Kalman filter structure to estimate
pose in the NED reference frame. The state is defined as:
where
q0, q1, q2, q3 –– Parts of orientation quaternion. The orientation quaternion represents a frame rotation from the platform's current orientation to the local NED coordinate system.
positionN, positionE, positionD –– Position of the platform in the local NED coordinate system.
νN, νE, νD –– Velocity of the platform in the local NED coordinate system.
ΔθbiasX, ΔθbiasY, ΔθbiasZ –– Bias in the integrated gyroscope reading.
ΔνbiasX, ΔνbiasY, ΔνbiasZ –– Bias in the integrated accelerometer reading.
geomagneticFieldVectorN, geomagneticFieldVectorE, geomagneticFieldVectorD –– Estimate of the geomagnetic field vector at the reference location.
magbiasX, magbiasY, magbiasZ –– Bias in the magnetometer readings.
Given the conventional formation of the predicted state estimate,
uk is controlled by accelerometer and gyroscope data that has been converted to delta velocity and delta angle through trapezoidal integration. The predicted state estimation is:
In the equation, (q0', q1', q2', q3') is the quaternion that accounts for the orientation change from one step to the next step. Assuming the orientation change is small, then the rotation vector can be approximated as (ΔθX − ΔθbiasX, ΔθY − ΔθbiasY, ΔθZ − ΔθbiasZ), where ΔθX, ΔθY, ΔθZ are the integrated gyroscope readings. (q0', q1', q2', q3') is then obtained by converting the approximated rotation vector to a quaternion. In each calculation, the quaternion is normalized such that the length of the quaternion is 1 and its real part q0 is nonnegative.
Additionally,
ΔνX, ΔνY, ΔνZ –– Integrated accelerometer readings.
Δt –– IMU sample time.
gN, gE, gD –– Constant gravity vector in the NED frame.
Extended Capabilities
Version History
Introduced in R2018b