fuse
Description
[
fuses the measurement from a sensor, based on the measurement noise, for state estimation. state
,stateCovariance
] = fuse(filter
,sensor
,measurement
,measurementNoise
)
Examples
Fuse Gyroscope Data Using insEKF
Create an insAccelerometer
sensor object and insGyroscope
sensor object.
acc = insAccelerometer; gyro = insGyroscope;
Construct an insEKF
object using the two sensor objects.
filter = insEKF(acc,gyro);
Fuse a gyroscope measurement of [0.1 0.2 –0.04]
with a measurement noise covariance of diag([0.2 0.2 0.2])
.
[state,stateCov] = fuse(filter,gyro,[0.1 0.2 -0.04],diag([0.2 0.2 0.2]));
Show the fused state.
state
state = 13×1
1.0000
0
0
0
0.0455
0.0909
-0.0182
0
0
0
⋮
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
state
— State vector after measurement fusion
N-element real-valued vector
State vector after measurement fusion, returned as an N-element real-valued vector, where N is the dimension of the filter state.
Data Types: single
| double
stateCovariance
— State estimate error covariance after measurement fusion
N-by-N real-valued positive definite
matrix
State estimate error covariance after measurement fusion, returned as an N-by-N real-valued positive definite matrix, where N is the dimension of the state.
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
| residual
| correct
| stateparts
| statecovparts
| stateinfo
| estimateStates
| tune
| createTunerCostTemplate
| tunerCostFcnParam
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)