residual
Description
[
computes the residual and the residual covariance based on the measurement from the sensor
and the measurement covariance.residual
,residualCovariance
] = residual(filter
,sensor
,measurement
,measurementNoise
)
Examples
Obtain Gyroscope Measurement Residuals Using insEKF
Create an insAccelerometer
sensor object and insGyroscope
sensor object.
acc = insAccelerometer; gyro = insGyroscope;
Construct an insEKF
object using the two sensor objects. Specify the angular velocity as [0.1 0.1 0.1]
.
filter = insEKF(acc,gyro);
stateparts(filter,"AngularVelocity",[0.1 0.1 0.1]);
Obtain the residuals for a gyroscope measurement of [0.1 0.2 -0.04]
with a measurement noise covariance of diag([0.2 0.2 0.2])
.
[residual,residualCov] = residual(filter,gyro,[0.1 0.2 -0.04],diag([0.2 0.2 0.2]))
residual = 3×1
0
0.1000
-0.1400
residualCov = 3×3
2.2000 0 0
0 2.2000 0
0 0 2.2000
Input Arguments
filter
— INS filter
insEKF
object
INS filter, specified as an insEKF
object.
sensor
— Inertial sensor
insAccelerometer
object | insGyroscope
object | insMagnetometer
object | insGPS
object | object inheriting from positioning.insSensorModel
interface class
Inertial sensor, specified as one of these objects used to construct the insEKF
filter object:
An
insAccelerometer
objectAn
insGyroscope
objectAn
insMagnetometer
objectAn
insGPS
objectAn object inheriting from the
positioning.INSSensorModel
interface class
measurement
— Measurement from sensor
M-element real-valued vector
Measurement from the sensor, specified as an M-element real-valued vector,
where M is the dimension of the measurement from the
sensor
object.
Data Types: single
| double
measurementNoise
— Measurement noise
M-by-M real-valued positive-definite
matrix | M-element vector of positive values | positive scalar
Measurement noise, specified as an M-by-M real-valued
positive-definite matrix, an M-element vector of positive
values, or a positive scalar. M is the dimension of the
measurement from the sensor
object. When specified as a
vector, the vector expands to the diagonal of an
M-by-M diagonal matrix. When
specified as a scalar, the value of the property is the product of the
scalar and an M-by-M identity
matrix.
Data Types: single
| double
Output Arguments
residual
— Measurement residual
M-element real-valued vector
Measurement residual, returned as an M-element real-valued vector, where M is the dimension of the measurement.
Data Types: single
| double
residualCovariance
— Residual covariance
M-by-M real-valued positive definite
matrix
Residual covariance, returned as an M-by-M real-valued positive definite matrix, where M is the dimension of the measurement.
Data Types: single
| double
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2022a
See Also
predict
| fuse
| correct
| stateparts
| statecovparts
| stateinfo
| estimateStates
| tune
| createTunerCostTemplate
| tunerCostFcnParam
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)