ctmeas
Measurement function for constant turn-rate and velocity-magnitude motion model
Syntax
Description
measurement = ctmeas(state)state argument specifies
                the current state.
measurement = ctmeas(state,frame)frame.
measurement = ctmeas(state,frame,sensorpos)sensorpos.
measurement = ctmeas(state,frame,sensorpos,sensorvel)sensorvel.
measurement = ctmeas(state,measurementParameters)measurementParameters.
[
                returns the measurement bounds, used by a tracking filter (measurement,bounds] = ctmeas(___)trackingEKF or trackingUKF) in residual calculations. See the
                    HasMeasurementWrapping of the filter object for more
                details.
Examples
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
Specify a 2-D state and specify a measurement structure such that the function outputs azimuth, range, and range-rate measurements.
state = [10 1 10 1 0.5]'; % [x vx y vy omega]' mp = struct("Frame","Spherical", ... "HasAzimuth",true, ... "HasElevation",false, ... "HasRange",true, ... "HasVelocity",false);
Output the measurement and wrapping bounds using the ctmeas function.
[measure,bounds] = ctmeas(state,mp)
measure = 2×1
   45.0000
   14.1421
bounds = 2×2
  -180   180
  -Inf   Inf
Input Arguments
Current state for constant turn-rate motion, specified as a real-valued vector or matrix.
- When you specify the current state as a five-element vector, the state vector describes 2-D motion in the xy-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- xand- yrepresent the x-coordinate and y-coordinate in meters.
- vxand- vyrepresent the velocity in the x and y direction in meters/second.
- omegarepresents the turn-rate in degrees/second.
 - When specified as a 5-by-N matrix, each column represents a different state vector N represents the number of states. 
- When you specify the current state as a seven-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,- y, and- zrepresent the x-, y-, and- z-coordinate in meters.
- vx,- vy, and- vzrepresent the velocity in the x, y, and z direction in meters/second.
- omegarepresents the turn-rate in degrees/second.
 - When specified as a 7-by-N matrix, each column represents a different state vector. N represents the number of states. 
Example: [5;0.1;4;-0.2;0.01]
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. This matrix serves as the rotation matrix that transforms coordinates from the sensor frame to the global frame.
Data Types: single | double
Measurement parameters, specified as a structure or an array of structures. This table lists the fields in the structure.
| 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. By default, the Orientationmatrix describes the rotation from the sensor
                    frame to the navigation (global) frame. If you want to specify the rotation
                    matrix that transforms coordinates from the navigation frame to the sensor
                    frame, set theIsParentToChildparameter totrue. | [1 0 0; 0 1 0; 0 0 1] | 
| IsParentToChild | Logical scalar indicating if Orientationperforms a frame
                    rotation from the parent coordinate frame to the child coordinate frame. By
                    default, theIsParentToChildparameter is set tofalse, meaning theOrientationperforms a frame rotation from the child coordinate frame to the parent
                    coordinate frame. | 0 | 
| 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 HasElevationis 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 HasVelocityisfalse, the measurements are reported as[x y
                        z]. IfHasVelocityistrue,
                    the measurement is reported as[x y z vx vy vz]. For a
                    measurement reported in the spherical frame, ifHasVelocityistrue, the measurement contains range-rate
                    information. | 1 | 
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
Measurement vector, returned as an N-element real-valued row vector or an M-by-N real-valued matrix. M, the size of each measurement, can vary depending on the syntax. For more information, see the following table. N, the number of measurements, is the same as the number of states. The format of the measurement vector depends on the syntax.
- When you do not specify the - measurementParametersargument and set the- frameargument to- 'rectangular', the function outputs measurement vectors in the format of- [x;y;z].
- When you do not specify the - measurementParametersargument and set the- frameargument to- 'spherical', the function outputs measurement vectors in the format of- [az;el;r;rr].
- When you specify the - measurementParametersargument and set the- framefield to- 'rectangular', the size of the measurement vector depends on the value of the- HasVelocityfield in the- measurementParametersstructure. 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 - measurementParametersargument and set the- framefield to- 'spherical', the size of the measurement vector depends on the value of the- HasVelocity,- HasRange, and- HasElevationfields in the- measurementParametersstructure. 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. 
Data Types: double
Measurement residual wrapping bounds, returned as a two-element real-valued row vector or an
        M-by-2 real-valued matrix, where M is the size of each
      measurement. Each row of the matrix corresponds to the lower and upper bounds, respectively,
      of each measurement in the measurement output.
The function returns different bound values based on the frame input.
- If you specify - frameas- 'Rectangular', each row of the matrix is- [-Inf Inf], indicating that the filter did not wrap the measurement residual.
- If you specify - frameas- 'Spherical', the function returns bounds for each measurement based on the following:- When - HasAzimuth=- true, the matrix includes a row of- [-180 180], indicating that the filter wrapped the azimuth residual in the range of- [-180 180]in degrees.
- When - HasElevation=- true, the matrix includes a row of- [-90 90], indicating that the filter wrapped the elevation residual in the range of- [-90 90]in degrees.
- When - HasRange=- true, the matrix includes a row of- [-Inf Inf], indicating that the filter did not wrap the range residual.
- When - HasVelocity=- true, the matrix includes a row of- [-Inf Inf], indicating that the filter did not wrap the range rate residual.
 
If you set any of the fields to false, the returned
        bounds do not contain the corresponding row. For example, if
        HasAzimuth = true, HasElevation =
        false, HasRange = true,
        HasVelocity = true, then the function returns the
      bounds as:
-180 180 -Inf Inf -Inf Inf
The filter wraps the measuring residuals based on this equation:
where x is the residual to wrap, a is the lower bound, b is the upper bound, mod is the remainder after division, and xwrap is the wrapped residual.
Data Types: single | double
More About
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
- constturn(Sensor Fusion and Tracking Toolbox) |- constturnjac(Sensor Fusion and Tracking Toolbox) |- ctmeasjac(Sensor Fusion and Tracking Toolbox) |- cvmeas|- cameas|- ctrvmeas(Sensor Fusion and Tracking Toolbox) |- singermeas(Sensor Fusion and Tracking Toolbox) |- initctekf(Sensor Fusion and Tracking Toolbox) |- initctukf(Sensor Fusion and Tracking Toolbox)
Objects
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)