Main Content

cameasjac

Jacobian of measurement function for constant-acceleration motion model

Description

measurementjac = cameasjac(state) the Jacobian of the measurement function, measurementjac, based on the constant-acceleration motion model. The state argument specifies the current state.

example

measurementjac = cameasjac(state,frame) also specifies the measurement coordinate system, frame.

example

measurementjac = cameasjac(state,frame,sensorpos) also specifies the sensor position, sensorpos.

example

measurementjac = cameasjac(state,frame,sensorpos,sensorvel) also specifies the sensor velocity, sensorvel.

measurementjac = cameasjac(state,frame,sensorpos,sensorvel,laxes) also specifies the local sensor axes orientation, laxes.

measurementjac = cameasjac(state,measurementParameters) specifies the measurement parameters, measurementParameters.

example

Examples

collapse all

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

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

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

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

collapse all

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 DimensionsState 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: single | double

Frame to report measurements, specified as 'rectangular' or 'spherical'. When you specify frame as 'rectangular', a measurement consists of x, y, and z Cartesian coordinates. When you specify frame as 'spherical', a measurement consists of azimuth, elevation, range, and range rate.

Data Types: char | string

Sensor position with respect to the navigation frame, specified as a real-valued 3-by-1 column vector. Units are in meters.

Data Types: single | double

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: single | double

Local sensor axes coordinates, 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. The matrix is the rotation matrix from the global frame to the sensor frame.

Data Types: single | double

Measurement parameters, specified as a structure or an array of structures. This table lists the fields in the structure.

FieldDescriptionExample
Frame

Frame used to report measurements, specified as one of these values:

  • 'Rectangular' — Detections are reported in rectangular coordinates.

  • 'Spherical' — Detections are reported in spherical coordinates.

Tip

In Simulink, when you create an object detection Bus, specify Frame as an enumeration object of fusionCoordinateFrameType.Rectangular or fusionCoordinateFrameType.Spherical because Simulink does not support variables such as a character vector that can vary in size.

'spherical'
OriginPositionPosition offset of the origin of the frame relative to the parent frame, specified as an [x y z] real-valued vector.[0 0 0]
OriginVelocityVelocity offset of the origin of the frame relative to the parent frame, specified as a [vx vy vz] real-valued vector.[0 0 0]
OrientationFrame 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 Frame field is 'Rectangular'.

1
HasElevationLogical 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 Frame is 'Rectangular'.

1
HasVelocityLogical 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
IsParentToChildLogical 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 want to perform only one coordinate transformation, such as a transformation from the body frame to the sensor frame, you must specify a measurement parameter structure. If you want to perform multiple coordinate transformations, you must 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

collapse all

Jacobian of the measurement function, returned as a real-valued M-by-N matrix. The function constructs the Jacobian from the partial derivatives of the measurement vector with respect to the input state. The form of the measurement vector depends on the syntax.

  • When you do not specify the measurementParameters argument and set the frame argument to 'rectangular', the function outputs measurement vectors in the format of [x;y;z].

  • When you do not specify the measurementParameters argument and set the frame argument to 'spherical', the function outputs measurement vectors in the format of [az;el;r;rr].

  • When you specify the measurementParameters argument and set the frame field to 'rectangular', the size of the measurement vector depends on the value of the HasVelocity field in the measurementParameters structure. The measurement vector includes the Cartesian position and velocity coordinates of the tracked object with respect to the ego vehicle coordinate system.

    Rectangular Measurements

    HasVelocity = 'false'[x;y;z]
    HasVelocity = 'true'[x;y;z;vx;vy;vz]

    Position units are in meters and velocity units are in m/s.

  • When you specify the measurementParameters argument and set the frame field to 'spherical', the size of the measurement vector depends on the value of the HasVelocity, HasRange, and HasElevation fields in the measurementParameters structure. The measurement vector includes the azimuth angle, az, elevation angle, el, range, r, and range rate, rr, of the object with respect to the local ego vehicle coordinate system. Positive values for range rate indicate that an object is moving away from the sensor.

    Spherical Measurements

     HasRange = 'true'HasRange = 'false'
     HasElevation = 'false'HasElevation = 'true'HasElevation = 'false'HasElevation = 'true'
    HasVelocity = 'false'[az;r][az;el;r][az][az;el]
    HasVelocity = 'true'[az;r;rr][az;el;r;rr][az][az;el]

    Angle units are in degrees, range units are in meters, and range rate units are in m/s.

More About

collapse all

Azimuth and Elevation Angle Definitions

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 when 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 R2017a

See Also

Functions

Objects