Main Content

getTrackVelocities

Obtain updated track velocities and velocity covariance matrix

Since R2021a

Description

positions = getTrackVelocities(tracks,modelName) returns a matrix of track velocities based on tracks and the model name.

velocities = getTrackVelocities(tracks,velocitySelector) returns a matrix of track velocities based on tracks and the velocity selector.

[velocities,velocityCovariances] = getTrackVelocities(tracks,velocitySelector) also returns the track velocity covariance matrices.

Examples

Input Arguments

collapse all

Object tracks, specified as an array of objectTrack objects or an array of structures containing sufficient information to obtain the track velocity information. At a minimum, these structures must contain a State column vector field and a positive-definite StateCovariance matrix field. For a sample track structure, see toStruct.

Note

If you specify tracks as an empty objectTrack object, an empty cell, or an empty track structure, velocities and velocityCovariances are returned based on the second argument (velocitySelector or modelName) as follows.

Second input argumentvelocitiesvelocityCovariances
velocitySelector

velocities is returned as a zeros(0,D) vector, where D is the row-dimension of the velocity selector. In this case, if the velocitySelector is specified in single-precision, the positions output is in single-precision.

velocityCovariances is returned as a zeros(D,D,0) matrix, where D is the row-dimension of the velocity selector. In this case, if the velocitySelector is specified in single-precision, the velocityCovariances output is in single-precision.

modelName

velocities is returned as a zeros(0,3) vector.

velocityCovariances is returned as a zeros(3,3,0) matrix.

Motion model name, specified as one of these options:

  • "constvel" — The function obtains the velocity states based on the state definition in the constvel function.

  • "constacc" — The function obtains the velocity states based on the state definition in the constacc function.

  • "constturn" — The function obtains the velocity states based on the state definition in the constturn function.

  • "singer" — The function obtains the velocity states based on the state definition in the singer (Sensor Fusion and Tracking Toolbox) function. The use of singer model requires the Sensor Fusion and Tracking Toolbox™.

Velocity selector, specified as a D-by-N real-valued matrix of ones and zeros. D is the number of dimensions of the tracker. N is the size of the state vector. Using this matrix, the function extracts track velocities from the state vector. Multiply the state vector by velocity selector matrix returns velocities. The same selector is applied to all object tracks.

Output Arguments

collapse all

Velocities of tracked objects at last update time, returned as a 1-by-D vector or a real-valued M-by-D matrix. D represents the number of velocity elements. M represents the number of tracks.

Velocity covariance matrices of tracked objects, returned as a real-valued D-by-D-matrix or a real-valued D-by-D-by-M array. D represents the number of velocity elements. M represents the number of tracks. Each D-by-D submatrix is a velocity covariance matrix for a track.

More About

collapse all

Velocity Selector for 2-Dimensional Motion

Show the velocity selection matrix for two-dimensional motion when the state consists of the position and velocity.

[01000001]

Velocity Selector for 3-Dimensional Motion

Show the velocity selection matrix for three-dimensional motion when the state consists of the position and velocity.

[010000000100000001]

Velocity Selector for 3-Dimensional Motion with Acceleration

Show the velocity selection matrix for three-dimensional motion when the state consists of the position, velocity, and acceleration.

[010000000000010000000000010]

Extended Capabilities

Version History

Introduced in R2021a

expand all

See Also

Functions

Objects