Main Content

initcvmscekf

Constant velocitytrackingMSCEKFinitialization

Description

example

mscekf= initcvmscekf(detection)initializes atrackingMSCEKFclass (extended Kalman filter for tracking in modified spherical coordinates) based on information provided in anobjectDetectionobject,detection. The function assumes a target range of 3e4units and a range-covariance of 1e10units2.

ThetrackingMSCEKFobject can be used with trackers for tracking targets with angle-only measurements from a single observer.

example

mscekf= initcvmscekf(detection,rangeEstimation)allows specifying the range information to the filter. TherangeEstimationvariable is a two-element vector, where the first element specifies the range of the target, and the second element specifies the standard deviation in range.

Examples

collapse all

创建一个n angle-only detection.

detection = objectDetection(0,[30;20],'MeasurementParameters',...struct('Frame','Spherical','HasRange',false));

Useinitcvmscekfto create atrackingMSCEKFfilter initialized using the angle-only detection.

filter = initcvmscekf(detection)
filter = trackingMSCEKF with properties: State: [6x1 double] StateCovariance: [6x6 double] StateTransitionFcn: @constvelmsc StateTransitionJacobianFcn: @constvelmscjac ProcessNoise: [3x3 double] HasAdditiveProcessNoise: 0 ObserverInput: [3x1 double] MeasurementFcn: @cvmeasmsc MeasurementJacobianFcn: @cvmeasmscjac HasMeasurementWrapping: 1 MeasurementNoise: [2x2 double] HasAdditiveMeasurementNoise: 1

Create measurement parameters for subsequent rotation.

measParamSensorToPlat = struct('Frame','Spherical','HasRange',false,...'Orientation',rotmat(quaternion([0 0 30],'rotvecd'),'frame'))
measParamSensorToPlat =struct with fields:Frame: 'Spherical' HasRange: 0 Orientation: [3x3 double]
measParamPlatToScenario = struct('Frame','Rectangular','HasRange',false,...'Orientation',rotmat(quaternion([30 0 0],'rotvecd'),'frame'))
measParamPlatToScenario =struct with fields:Frame: 'Rectangular' HasRange: 0 Orientation: [3x3 double]
measParam = [measParamSensorToPlat;measParamPlatToScenario]; detection = objectDetection(0,[30;20],'MeasurementParameters',measParam);

初始化一个filter.

filter = initcvmscekf(detection);

Check that filter's measurement is same as detection.

cvmeasmsc(filter.State,measParam)
ans =2×130日20

Consider a scenario when the target is moving at a constant velocity along and the observer is moving at a constant acceleration. Define target's initial state using a constant velocity model.

tgtState = [2000;-3;500;-5;0;0];

Define observer's initial state using a constant acceleration model.

observerState = [0;2;0;490;-10;0.2;0;0;0];

创建一个trackerGNNobject to use withinitcvmscekfwith some prior information about range and range-covariance.

range = 1000; rangeStdDev = 1e3; rangeEstimate = [range rangeStdDev]; tracker = trackerGNN('FilterInitializationFcn',@(det)initcvmscekf(det,rangeEstimate));

Simulate synthetic data by using measurement models. Getazandelinformation using thecvmeasfunction.

syntheticParams = struct('Frame','Spherical','HasRange',false,...'OriginPosition',observerState(1:3:end)); meas = cvmeas(tgtState,syntheticParams);

创建一个n angle-only objectDetection to simulate synthetic detection.

detection = objectDetection(0,meas,'MeasurementParameters',...struct('Frame','Spherical','HasRange',false),'MeasurementNoise',0.033*eye(2));

Create trackPlotter and platformPlotter to visualize the scenario.

tp = theaterPlot('XLimits',[0 2500],'YLimits',[0 1000]); targetPlotter = platformPlotter(tp,'DisplayName','Target','MarkerFaceColor','k'); observerPlotter = platformPlotter(tp,'DisplayName','Observer','MarkerFaceColor','r'); trkPlotter = trackPlotter(tp,'DisplayName','Track','MarkerFaceColor','g','HistoryDepth',50); tgtTrajPlotter = trajectoryPlotter(tp,'DisplayName','Target Trajectory','Color','k'); obsTrajPlotter = trajectoryPlotter(tp,'DisplayName','Observer Trajectory','Color','r');

Figure contains an axes object. The axes object contains 6 objects of type line. These objects represent Target, Observer, Track, (history), Target Trajectory, Observer Trajectory.

Run the tracker.

time = 0; dT = 0.1; tgtPoses = []; obsPoses = [];whiletime < 50 [confTracks,tentTracks,allTracks] = tracker(detection,time);fori = 1:numel(allTracks) setTrackFilterProperties(tracker,allTracks(i).TrackID,'ObserverInput',observerState(3:3:end));end% Update synthetic detection.observerState = constacc (observerState, dT);tgtState = constvel(tgtState,dT); syntheticParams.OriginPosition = observerState(1:3:end); detection.Measurement = cvmeas(tgtState,syntheticParams); time = time + dT; detection.Time = time;% Update plotstgtPoses = [tgtPoses;tgtState(1:2:end)'];%#okobsPoses = [obsPoses;observerState(1:3:end)'];%#oktargetPlotter.plotPlatform(tgtState(1:2:end)'); observerPlotter.plotPlatform(observerState(1:3:end)'); tgtTrajPlotter.plotTrajectory({tgtPoses}); obsTrajPlotter.plotTrajectory({obsPoses});% Plot the first track as there are no false alarms, this should be% the target.% Get positions from the MSC state of the track.cartState = cvmeasmsc(allTracks(i).State,'rectangular') + observerState(1:3:end); trkPlotter.plotTrack(cartState');end

Figure contains an axes object. The axes object contains 6 objects of type line. These objects represent Target, Observer, Track, (history), Target Trajectory, Observer Trajectory.

Input Arguments

collapse all

Detection report, specified as anobjectDetectionobject.

Example:detection = objectDetection(0,[1;4.5;3],'MeasurementNoise', [1.0 0 0; 0 2.0 0; 0 0 1.5])

Range information, specified as a two-element vector, where the first element specifies the range of the target, and the second element specifies the standard deviation in range.

Data Types:single|double

Output Arguments

collapse all

Constant velocity tracking extended Kalman filter in an MSC frame, returned as atrackingMSCEKFobject.

Algorithms

  • The function configures the filter with process noise assuming a unit target acceleration standard deviation.

  • The function configures the covariance of the state in an MSC frame by using a linear transformation of covariance in a Cartesian frame.

  • You can use this function as theFilterInitializationFcnproperty oftrackerTOMHTandtrackerGNNSystem objects.

  • The function initializes theObserverInputof thetrackingMSCEKFclass with zero observer acceleration in all directions. You must use thesetTrackFilterPropertiesfunction of the trackers to update theObserverInput.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2018b