cameasjac
Syntax
Description
returns the measurement Jacobian, for constant-acceleration Kalman filter motion
model in rectangular coordinates. The measurementjac
= cameasjac(state
)state
argument specifies
the current state of the filter.
also specifies the measurement coordinate system, measurementjac
= cameasjac(state
,frame
)frame
.
also specifies the sensor position, measurementjac
= cameasjac(state
,frame
,sensorpos
)sensorpos
.
also
specifies the sensor velocity, measurementjac
= cameasjac(state
,frame
,sensorpos
,sensorvel
)sensorvel
.
specifies the measurement parameters,
measurementjac
= cameasjac(state
,measurementParameters
)measurementParameters
.
Examples
Measurement Jacobian of Accelerating Object in Rectangular Frame
Define the state of an object in 2-D constant-acceleration motion. The state is the position, velocity, and acceleration in both dimensions. Construct the measurement Jacobian in rectangular coordinates.
state = [1,10,3,2,20,5].'; jacobian = cameasjac(state)
jacobian = 3×6
1 0 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 0
Measurement Jacobian of Accelerating Object in Spherical Frame
Define the state of an object in 2-D constant-acceleration motion. The state is the position, velocity, and acceleration in both dimensions. Compute the measurement Jacobian in spherical coordinates.
state = [1;10;3;2;20;5];
measurementjac = cameasjac(state,'spherical')
measurementjac = 4×6
-22.9183 0 0 11.4592 0 0
0 0 0 0 0 0
0.4472 0 0 0.8944 0 0
0.0000 0.4472 0 0.0000 0.8944 0
Measurement Jacobian of Accelerating Object in Translated Spherical Frame
Define the state of an object in 2-D constant-acceleration motion. The state is the position, velocity, and acceleration in both dimensions. Compute the measurement Jacobian in spherical coordinates with respect to an origin at (5;-20;0) meters.
state = [1,10,3,2,20,5].';
sensorpos = [5,-20,0].';
measurementjac = cameasjac(state,'spherical',sensorpos)
measurementjac = 4×6
-2.5210 0 0 -0.4584 0 0
0 0 0 0 0 0
-0.1789 0 0 0.9839 0 0
0.5903 -0.1789 0 0.1073 0.9839 0
Create Measurement Jacobian of Accelerating Object Using Measurement Parameters
Define the state of an object in 2-D constant-acceleration motion. The state is the position, velocity, and acceleration in both dimensions. Compute the measurement Jacobian in spherical coordinates with respect to an origin at (5;-20;0) meters.
state2d = [1,10,3,2,20,5].';
sensorpos = [5,-20,0].';
frame = 'spherical';
sensorvel = [0;8;0];
laxes = eye(3);
measurementjac = cameasjac(state2d,frame,sensorpos,sensorvel,laxes)
measurementjac = 4×6
-2.5210 0 0 -0.4584 0 0
0 0 0 0 0 0
-0.1789 0 0 0.9839 0 0
0.5274 -0.1789 0 0.0959 0.9839 0
Put the measurement parameters in a structure and use the alternative syntax.
measparm = struct('Frame',frame,'OriginPosition',sensorpos,'OriginVelocity',sensorvel, ... 'Orientation',laxes); measurementjac = cameasjac(state2d,measparm)
measurementjac = 4×6
-2.5210 0 0 -0.4584 0 0
0 0 0 0 0 0
-0.1789 0 0 0.9839 0 0
0.5274 -0.1789 0 0.0959 0.9839 0
Input Arguments
state
— Kalman filter state vector
real-valued 3N-element vector
Kalman filter state vector for constant-acceleration motion, specified as a real-valued 3N-element vector. N is the number of spatial degrees of freedom of motion. For each spatial degree of motion, the state vector takes the form shown in this table.
Spatial Dimensions | State Vector Structure |
---|---|
1-D | [x;vx;ax] |
2-D | [x;vx;ax;y;vy;ay] |
3-D | [x;vx;ax;y;vy;ay;z;vz;az] |
For example, x
represents
the x-coordinate, vx
represents
the velocity in the x-direction, and ax
represents
the acceleration in the x-direction. If the motion
model is in one-dimensional space, the y- and z-axes
are assumed to be zero. If the motion model is in two-dimensional
space, values along the z-axis are assumed to be
zero. Position coordinates are in meters. Velocity coordinates are
in meters/second. Acceleration coordinates are in meters/second2.
Example: [5;0.1;0.01;0;-0.2;-0.01;-3;0.05;0]
Data Types: double
frame
— Measurement output frame
'rectangular'
(default) | 'spherical'
Measurement output frame, specified as 'rectangular'
or
'spherical'
. When the frame is 'rectangular'
,
a measurement consists of x, y, and
z Cartesian coordinates. When specified as
'spherical'
, a measurement consists of azimuth, elevation,
range, and range rate.
Data Types: char
sensorpos
— Sensor position
[0;0;0]
(default) | real-valued 3-by-1 column vector
Sensor position with respect to the navigation frame, specified as a real-valued 3-by-1 column vector. Units are in meters.
Data Types: double
sensorvel
— Sensor velocity
[0;0;0]
(default) | real-valued 3-by-1 column vector
Sensor velocity with respect to the navigation frame, specified as a real-valued 3-by-1 column vector. Units are in m/s.
Data Types: double
laxes
— Local sensor coordinate axes
[1,0,0;0,1,0;0,0,1]
(default) | 3-by-3 orthogonal matrix
Local sensor coordinate axes, specified as a 3-by-3 orthogonal matrix. Each column specifies the direction of the local x-, y-, and z-axes, respectively, with respect to the navigation frame. That is, the matrix is the rotation matrix from the global frame to the sensor frame.
Data Types: double
measurementParameters
— Measurement parameters
structure | array of structure
Measurement parameters, specified as a structure or an array of structures. The fields of the structure are:
Field | Description | Example |
---|---|---|
Frame | Frame used to report measurements, specified as one of these values:
Tip In Simulink, when you create an object detection Bus, specify
| 'spherical' |
OriginPosition | Position offset of the origin of the frame relative to the parent frame, specified as an [x y z] real-valued vector. | [0 0 0] |
OriginVelocity | Velocity offset of the origin of the frame relative to the parent frame, specified as a [vx vy vz] real-valued vector. | [0 0 0] |
Orientation | Frame rotation matrix, specified as a 3-by-3 real-valued orthonormal matrix. | [1 0 0; 0 1 0; 0 0 1] |
HasAzimuth | Logical scalar indicating if azimuth is included in the measurement. This
field is not relevant when the | 1 |
HasElevation | Logical scalar indicating if elevation information is included in the measurement. For
measurements reported in a rectangular frame, and if
HasElevation is false, the reported measurements assume 0
degrees of elevation. | 1 |
HasRange | Logical scalar indicating if range is included in the measurement. This
field is not relevant when the | 1 |
HasVelocity | Logical scalar indicating if the reported detections include velocity measurements. For a
measurement reported in the rectangular frame, if HasVelocity
is false , the measurements are reported as [x y
z] . If HasVelocity is true ,
the measurement is reported as [x y z vx vy vz] . For a
measurement reported in the spherical frame, if HasVelocity
is true , the measurement contains range-rate
information. | 1 |
IsParentToChild | Logical scalar indicating if Orientation performs a frame rotation from the parent coordinate frame to the child coordinate frame. When IsParentToChild is false , then Orientation performs a frame rotation from the child coordinate frame to the parent coordinate frame. | 0 |
If you only want to perform one coordinate transformation, such as a transformation from the body frame to the sensor frame, you only need to specify a measurement parameter structure. If you want to perform multiple coordinate transformations, you need to specify an array of measurement parameter structures. To learn how to perform multiple transformations, see the Convert Detections to objectDetection Format (Sensor Fusion and Tracking Toolbox) example.
Data Types: struct
Output Arguments
measurementjac
— Measurement Jacobian
real-valued 3-by-N matrix | real-valued 4-by-N matrix
Measurement Jacobian, specified as a real-valued 3-by-N or
4-by-N matrix. N is the dimension
of the state vector. The interpretation of the rows and columns depends on
the frame
argument, as described in this table.
Frame | Measurement Jacobian |
---|---|
'rectangular' | Jacobian of the measurements
[x;y;z] with respect to the state
vector. The measurement vector is with respect to the
local coordinate system. Coordinates are in
meters. |
'spherical' | Jacobian of the measurement vector
[az;el;r;rr] with respect to the
state vector. Measurement vector components specify the
azimuth angle, elevation angle, range, and range rate of
the object with respect to the local sensor coordinate
system. Angle units are in degrees. Range units are in
meters and range rate units are in
meters/second. |
More About
Azimuth and Elevation Angle Definitions
Define the azimuth and elevation angles used in the toolbox.
The azimuth angle of a vector is the angle between the x-axis and its orthogonal projection onto the xy plane. The angle is positive in going from the x axis toward the y axis. Azimuth angles lie between –180 and 180 degrees. The elevation angle is the angle between the vector and its orthogonal projection onto the xy-plane. The angle is positive when going toward the positive z-axis from the xy plane.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2021a
See Also
Functions
constacc
|constaccjac
|cameas
|constturn
|constturnjac
|ctmeas
|ctmeasjac
|constvel
|constveljac
|cvmeas
|cvmeasjac
Objects
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)