# initcaekf

Create constant-acceleration extended Kalman filter from detection report

## Description

creates and initializes a constant-acceleration extended Kalman
`filter`

= initcaekf(`detection`

)`filter`

from information contained in a
`detection`

report. For more details, see Algorithms and `trackingEKF`

.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

The function initializes a

`trackingEKF`

object with a`constacc`

motion model and a`cameas`

measurement model. The state of the filter is defined as [*x*;*v*_{x};*a*_{x};*y*;*v*_{y};*a*_{y};*z*;*v*_{z};*a*_{z}], in which*x*,*y*,*z*are the position coordinates,*v*_{x},*v*_{y},*v*_{z}are the corresponding velocities, and*a*_{x},*a*_{y},*a*_{z}are the corresponding accelerations.The

`detection`

input can be an`objectDetection`

object of Cartesian or spherical measurement:For a Cartesian measurement,

By default, the function assumes the measurement is a 3-D position measurement ([

*x*;*y*;*z*]). The function uses the position measurement to initialize the position state of the filter and sets the velocity and acceleration components of the filter state as 0. For the state error covariance matrix of the filter, the function sets the position components same as those of the measurement noise matrix and sets the velocity and acceleration components as 100 m^{2}/s^{2}and 100 m^{2}/s^{4}, respectively. The function sets all the cross-components of the state error covariance matrix as 0.You can also use a 6-D measurement ([

*x*;*y*;*z*;*v*_{x};*v*_{y};*v*_{z}]) by specifying the`MeasurementParameters`

property of the`objectDetection`

object. Specify the`HasVelocity`

field of the measurement parameter structure as`true`

so that the`initcaekf`

function can recognize the 6-D measurement. In this case, the position and velocity components of the state and the state error covariance matrix are the same as the measurement and measurement noise matrix of the detection, respectively. The function sets the acceleration states as 0 and sets the acceleration components of the state error covariance matrix as 100 m^{2}/s^{4}.

For a spherical measurement, you must specify the

`Frame`

field in the`MeasurementParameters`

property of the`objectDetection`

object as`"Spherical"`

. Also, use the MeasurementParameters property to specify if the detection has azimuth, elevation, range, and range rate. A full spherical measurement has four elements [*az*,*el*,*r*,*rr*], representing azimuth in degrees, elevation in degrees, range in meters, and range-rate in meters per second, respectively. Some of the four elements can be missing.If the detection has elevation, the function uses the elevation measurement and its covariance to construct the position components of the filter state and state error covariance after performing coordinate transformation from the spherical frame to the Cartesian frame. Without elevation, the function sets the elevation as 0 and set its covariance as 180

^{2}/12 deg^{2}before performing the coordinate transformation.If the detection has range-rate, the function uses the range-rate measurement and its covariance to construct the velocity components of the filter sate and state error covariance. The function also assumes the velocity covariance of the cross-range direction is 100 m

^{2}/s^{2}. Without range-rate, the function sets the velocity states of the filter as 0 and its corresponding covariances as 100 m^{2}/s^{2}.

The function sets the acceleration component of the filter state as 0 and set the acceleration components of the state error covariance matrix as 100 m

^{2}/s^{4}. The function sets all the cross-components (for example between position and velocity) of the state error covariance matrix as 0.You can use other fields of the MeasurementParameters property of an

`objectDetection`

object, such as`OriginPosition`

and`OriginaVelocity`

, to further specify the measurement coordinates.

The function models the process noise as non-additive and computes the process noise matrix assuming a unit acceleration increment per step following the Weiner-sequence acceleration model.

The measurement noise matrix in the initialized filter is the same as that in the

`detection`

.You can use this function as the

`FilterInitializationFcn`

property of a tracker object, such as a`trackerGNN`

object.

## Extended Capabilities

## Version History

**Introduced in R2018b**