Main Content

trackingScenario

Create tracking scenario

Description

trackingScenario creates a tracking scenario object. A tracking scenario simulates a 3-D arena containing multiple platforms. Platforms represent anything that you want to simulate, such as aircraft, ground vehicles, or ships. Some platforms carry sensors, such as radar, sonar, or infrared. Other platforms act as sources of signals or reflect signals. Platforms can also include stationary obstacles that can influence the motion of other platforms. Platforms can be modeled as points or cuboids by specifying the 'Dimension' property when calling platform. Platforms can have aspect-dependent properties including radar cross-section or sonar target strength. You can populate a tracking scenario by calling the platform method for each platform you want to add. Platforms are Platform objects. You can create trajectories for any platform using the kinematicTrajectory, waypointTrajectory, or geoTrajectory System objects. After creating the scenario, run the simulation by calling the advance object function.

Creation

sc = trackingScenario creates an empty tracking scenario with default property values. In this case, you can specify platform trajectories in the scenario as Cartesian states using the kinematicTrajectory or waypointTrajectory objects.

sc = trackingScenario('IsEarthCentered',ture) creates an empty Earth-centered tracking scenario with default property values. In this case, you can specify platform trajectories in the scenario as geodetic states using the geoTrajectory object.

sc = trackingScenario(Name,Value) configures a trackingScenario object with properties using one or more Name,Value pair arguments. Name is a property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN. Any unspecified properties take default values.

Properties

expand all

Enable Earth-centered reference frame and trajectories, specified as true or false.

  • If specified as false, you must use the kinematicTrajectory or waypointTrajectory object to define the trajectories of platforms as Cartesian states in the tracking scenario.

  • If specified as true, you must use the geoTrajectory object to define the trajectories of platforms in the ECEF (Earth-Centered-Earth-Fixed) as geodetic coordinates in the tracking scenario. In this case, you must specify the IsEarthCentered property during the tracking scenario creation.

Data Types: logical

Stop time of simulation, specified as a positive scalar. A simulation stops when either of these conditions is met:

  • The stop time is reached.

  • Any platform reaches the end of its trajectory and you have specified the platform Motion property using waypoints, waypointTrajectory.

Units are in seconds.

Example: 60.0

Data Types: double

This property is read-only.

Current time of the simulation, defined as a positive scalar. To reset the simulation time to zero and restart the simulation, call the restart method. Units are in seconds.

Data Types: double

Frequency of simulation updates, specified as a positive scalar. This is the rate at which to provide successive updates of the scenario simulation. Units are in Hz.

Example: 2.0

Data Types: double

This property is read-only.

Run-state of simulation, defined as true or false. If the simulation is running, IsRunning is true. If the simulation has stopped, IsRunning is false. A simulation stops when either of these conditions is met:

  • The stop time is reached.

  • Any platform reaches the end of its trajectory, and you have specified that platform Motion strategy with waypoints using the waypointTrajectory System object™.

Units are in seconds.

Data Types: logical

This property is read-only.

Platforms in the scenario, returned as a cell or cell array of Platform objects. To add a platform to the scenario, use the platform object function.

Object Functions

platformAdd platform to tracking scenario
advanceAdvance tracking scenario simulation by one time step
restartRestart tracking scenario simulation
recordRun tracking scenario and record platform, sensor, and emitter information
emitCollect emissions from emitters in tracking scenario
propagatePropagate emissions in tracking scenario
detectCollect detections from all the sensors in tracking scenario
lidarDetectReport point cloud detections from all lidar sensor in trackingScenario
platformPosesPositions, velocities, and orientations of all platforms in tracking scenario
platformProfilesProfiles of platforms in tracking scenario
coverageConfigSensor and emitter coverage configuration
cloneCreate copy of tracking scenario
perturbApply perturbations to tracking scenario

Examples

collapse all

Construct a tracking scenario with two platforms that follow different trajectories.

sc = trackingScenario('UpdateRate',100.0,'StopTime',1.2);

Create two platforms.

platfm1 = platform(sc);
platfm2 = platform(sc);

Platform 1 follows a circular path of radius 10 m for one second. This is accomplished by placing waypoints in a circular shape, ensuring that the first and last waypoint are the same.

wpts1 = [0 10 0; 10 0 0; 0 -10 0; -10 0 0; 0 10 0];
time1 = [0; 0.25; .5; .75; 1.0];
platfm1.Trajectory = waypointTrajectory(wpts1, time1);

Platform 2 follows a straight path for one second.

wpts2 = [-8 -8 0; 10 10 0];
time2 = [0; 1.0];
platfm2.Trajectory = waypointTrajectory(wpts2,time2);

Verify the number of platforms in the scenario.

disp(sc.Platforms)
    {1×1 fusion.scenario.Platform}    {1×1 fusion.scenario.Platform}

Run the simulation and plot the current position of each platform. Use an animated line to plot the position of each platform.

figure
grid
axis equal
axis([-12 12 -12 12])
line1 = animatedline('DisplayName','Trajectory 1','Color','b','Marker','.');
line2 = animatedline('DisplayName','Trajectory 2','Color','r','Marker','.');
title('Trajectories')
p1 = pose(platfm1);
p2 = pose(platfm2);
addpoints(line1,p1.Position(1),p1.Position(2));
addpoints(line2,p2.Position(2),p2.Position(2));

while advance(sc)
    p1 = pose(platfm1);
    p2 = pose(platfm2);
    addpoints(line1,p1.Position(1),p1.Position(2));
    addpoints(line2,p2.Position(2),p2.Position(2));
    pause(0.1)
end

Plot the waypoints for both platforms.

hold on
plot(wpts1(:,1),wpts1(:,2),' ob')
text(wpts1(:,1),wpts1(:,2),"t = " + string(time1),'HorizontalAlignment','left','VerticalAlignment','bottom')
plot(wpts2(:,1),wpts2(:,2),' or')
text(wpts2(:,1),wpts2(:,2),"t = " + string(time2),'HorizontalAlignment','left','VerticalAlignment','bottom')
hold off

Create a tracking scenario with specified updated rate.

scene = trackingScenario('IsEarthCentered',true,'UpdateRate',0.01);

Add an airplane in the scenario. The trajectory of the airplane changes in latitude and altitude.

plane = platform(scene,'Trajectory',geoTrajectory([-12.338,-71.349,10600;42.390,-71.349,0],[0 36000]));

Advance the tracking scenario and record the geodetic and Cartesian positions of the plane target.

positions = [];
while advance(scene)
    poseLLA = pose(plane,'CoordinateSystem','Geodetic');
    poseCart = pose(plane,'CoordinateSystem','Cartesian');
    positions = [positions;poseCart.Position];%#ok<AGROW> Allow the buffer to grow.
end

Visualize the trajectory in the ECEF frame.

figure()
km = 1000;
% Plot the trajectory.
plot3(positions(1,1)/km,positions(1,2)/km,positions(1,3)/km, 'b*');
hold on;
plot3(positions(end,1)/km,positions(end,2)/km,positions(end,3)/km, 'bo');
plot3(positions(:,1)/km,positions(:,2)/km,positions(:,3)/km,'b');

% Plot the Earth radial lines.
plot3([0 positions(1,1)]/km,[0 positions(1,2)]/km,[0 positions(1,3)]/km,'k:');
plot3([0 positions(end,1)]/km,[0 positions(end,2)]/km,[0 positions(end,3)]/km,'k:');
xlabel('x (km)'); ylabel('y (km)'); zlabel('z (km)');
legend('Start position','End position','Trajectory')

See Also

System Objects

Introduced in R2018b