This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

ctmeas

Measurement function for constant turn-rate motion

Syntax

measurement = ctmeas(state)
measurement = ctmeas(state,frame)
measurement = ctmeas(state,frame,sensorpos)
measurement = ctmeas(state,frame,sensorpos,sensorvel)
measurement = ctmeas(state,frame,sensorpos,sensorvel,laxes)
measurement = ctmeas(state,measurementParameters)

Description

example

measurement = ctmeas(state) returns the measurement for a constant turn-rate Kalman filter motion model in rectangular coordinates. The state argument specifies the current state of the filter.

example

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

example

measurement = ctmeas(state,frame,sensorpos) also specifies the sensor position, sensorpos.

measurement = ctmeas(state,frame,sensorpos,sensorvel) also specifies the sensor velocity, sensorvel.

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

example

measurement = ctmeas(state,measurementParameters) specifies the measurement parameters, measurementParameters.

Examples

collapse all

Create a measurement from an object undergoing constant turn-rate motion. The state is the position and velocity in each dimension and the turn-rate. The measurements are in rectangular coordinates.

state = [1;10;2;20;5];
measurement = ctmeas(state)
measurement = 3×1

     1
     2
     0

The z-component of the measurement is zero.

Define the state of an object in 2-D constant turn-rate motion. The state is the position and velocity in each dimension, and the turn rate. The measurements are in spherical coordinates.

state = [1;10;2;20;5];
measurement = ctmeas(state,'spherical')
measurement = 4×1

   63.4349
         0
    2.2361
   22.3607

The elevation of the measurement is zero and the range rate is positive indicating that the object is moving away from the sensor.

Define the state of an object moving in 2-D constant turn-rate motion. The state consists of position and velocity, and the turn rate. The measurements are in spherical coordinates with respect to a frame located at [20;40;0].

state = [1;10;2;20;5];
measurement = ctmeas(state,'spherical',[20;40;0])
measurement = 4×1

 -116.5651
         0
   42.4853
  -22.3607

The elevation of the measurement is zero and the range rate is negative indicating that the object is moving toward the sensor.

Define the state of an object moving in 2-D constant turn-rate motion. The state consists of position and velocity, and the turn rate. The measurements are in spherical coordinates with respect to a frame located at [20;40;0].

state2d = [1;10;2;20;5];
frame = 'spherical';
sensorpos = [20;40;0];
sensorvel = [0;5;0];
laxes = eye(3);
measurement = ctmeas(state2d,frame,sensorpos,sensorvel,laxes)
measurement = 4×1

 -116.5651
         0
   42.4853
  -17.8885

The elevation of the measurement is zero and the range rate is negative indicating that the object is moving toward the sensor.

Put the measurement parameters in a structure and use the alternative syntax.

measparm = struct('Frame',frame,'OriginPosition',sensorpos, ...
    'OriginVelocity',sensorvel,'Orientation',laxes);
measurement = ctmeas(state2d,measparm)
measurement = 4×1

 -116.5651
         0
   42.4853
  -17.8885

Input Arguments

collapse all

State vector for a constant turn-rate motion model in two or three spatial dimensions, specified as a real-valued vector or matrix.

  • When specified as a 5-element vector, the state vector describes 2-D motion in the x-y plane. You can specify the state vector as a row or column vector. The components of the state vector are [x;vx;y;vy;omega] where x represents the x-coordinate and vx represents the velocity in the x-direction. y represents the y-coordinate and vy represents the velocity in the y-direction. omega represents the turn rate.

    When specified as a 5-by-N matrix, each column represents a different state vector N represents the number of states.

  • When specified as a 7-element vector, the state vector describes 3-D motion. You can specify the state vector as a row or column vector. The components of the state vector are [x;vx;y;vy;omega;z;vz] where x represents the x-coordinate and vx represents the velocity in the x-direction. y represents the y-coordinate and vy represents the velocity in the y-direction. omega represents the turn rate. z represents the z-coordinate and vz represents the velocity in the z-direction.

    When specified as a 7-by-N matrix, each column represents a different state vector. N represents the number of states.

Position coordinates are in meters. Velocity coordinates are in meters/second. Turn rate is in degrees/second.

Example: [5;0.1;4;-0.2;0.01]

Data Types: double

Measurement frame, specified as 'rectangular' or 'spherical'. When the frame is 'rectangular', a measurement consists of the x, y, and z Cartesian coordinates of the tracked object. When specified as 'spherical', a measurement consists of the azimuth, elevation, range, and range rate of the tracked object.

Data Types: char

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

Data Types: double

Sensor velocity with respect to the global coordinate system, specified as a real-valued 3-by-1 column vector. Units are in meters/second.

Data Types: double

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 global coordinate system.

Data Types: double

Measurement parameters, specified as a structure. The fields of the structure are:

measurementParameters struct

ParameterDefinitionDefault
OriginPositionSensor position with respect to the global coordinate system, specified as a real-valued 3-by-1 column vector. Units are in meters.[0;0;0]
OriginVelocitySensor velocity with respect to the global coordinate system, specified as a real-valued 3-by-1 column vector. Units are in m/s.[0;0;0]
OrientationLocal 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 global coordinate system.eye(3)
HasVelocityIndicates whether measurements contain velocity or range rate components, specified as true or false.false when frame argument is 'rectangular' and true when frame argument is 'spherical'
HasElevationIndicates whether measurements contain elevation components, specified as true or false.true

Data Types: struct

Output Arguments

collapse all

Measurement vector, returned as an N-by-1 column vector. The form of the measurement depends upon which syntax you use.

  • When the syntax does not use the measurementParameters argument, the measurement vector is [x,y,z] when the frame input argument is set to 'rectangular' and [az;el;r;rr] when the frame is set to 'spherical'.

  • When the syntax uses the measurementParameters argument, the size of the measurement vector depends on the values of the frame, HasVelocity, and HasElevation fields in the measurementParameters structure.

    framemeasurement
    'spherical'

    Specifies 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

      HasElevation
      falsetrue
    HasVelocityfalse[az;r][az;el;r]
    true[az;r;rr][az;el;r;rr]

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

    'rectangular

    Specifies the Cartesian position and velocity coordinates of the tracked object with respect to the ego vehicle coordinate system.

    Rectangular measurements

    HasVelocityfalse[x;y;y]
    true[x;vx;y,vy;z;vz]

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

Data Types: double

More About

collapse all

Azimuth and Elevation Angle Definitions

Define the azimuth and elevation angles used in Sensor Fusion and Tracking 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™.

Introduced in R2018b