Design and Simulate Tracking Scenario with Tracking Scenario Designer

This example shows how to use trackingScenarioDesigner with an existing session file. Using the application, you can add, modify, or remove platforms, monostatic radar sensors, and trajectories of all objects in the scenario. You can also export the scenario as a MATLAB script for further analysis.


The goal of object tracking is to determine the state of an object in the presence of infrequent or uncertain measurements. In the case of multiple objects, tracking algorithms must also address the problem of data association. To test these algorithms, a tracking scenario can be used to synthetically generate realistic detections of objects in a three-dimensional scene.

This example models a scenario where a radar tower equipped with a monostatic radar sensor scans the sky. At a distance far from the sensor, two airplanes fly in close proximity other for a short duration of time. The close spacing of the aircraft trajectories and their distances from the radar tower challenge the radar's capability to properly resolve the two objects. This scenario is described in further detail in the Tracking Closely Spaced Targets Under Ambiguity example.

Launch Tracking Scenario Designer

The matfile TSD_TrackingCloselySpacedTargets was previously saved with a tracking scenario session. To launch the application and load the session file, use the command:


The application opens and loads the scenario. The Tracking Scenario Designer App consists of a toolstrip and three document groups:

  • Platform Properties and Sensor Properties panels on the left

  • Platform Canvas and Sensor Canvas in the center

  • Scenario View showing a three-dimensional world view on the right

Edit and modify the scenario

Red plane

Select the red colored plane by clicking on it in the Platform Canvas.

Inspect its trajectory using the Trajectory Table and the Time-Altitude plot

In the property panel (purple), note that the plane is modeled as a point object whose length, width, and height dimensions are zero. By default, its radar cross section is 10 dBsm.

Click on the Trajectory Table button (red) in the toolstrip to display the list of waypoints for this plane. The trajectory table appears at the bottom center of the application.

Click on the Time-Altitude Plot button (green) in the toolstrip to display the elevation profile of this plane. The plot appears within the same tab as the Platform Canvas.

Observe that the airplane is flying level at an altitude of 3000 m with a ground speed of 83.33 m/s. The duration of the trajectory is 50s.

You can further edit the trajectory by changing the parameter values in the table or by dragging waypoints in the Platform Canvas as shown in the GIF below.

For the remainder of this example, we use the predefined trajectory in the session file.


Select the tower platform by clicking on the platform on the Platform Canvas or by choosing the tower platform from the Current Platform list in the Platform Properties tab.

Upon selecting the platform, the Sensor Properties and the Sensor Canvas for the tower platform become active.

Observe the monostatic radar sensor properties in the panel (yellow). The radar has an update rate of 100 Hz, and a scan range of 40 degrees in azimuth and 10 degrees in elevation. Its field of view is 1.5 deg in azimuth and 10 deg in elevation. Note that we use 10.001 def to ensure the beam is not exactly the size of the elevation scan range, in which case the radar would sweep twice in elevation.

Note that the default platform frame is NED (North-East-Down). Also the Mounting Location of the sensor is defined as X = 0, Y = 0, Z = -15 to ensure that the radar is located at the top of the 15m high tower.

On the Sensor Canvas, you can use the toolbar (green) to display the side views of the tower. The axes are platform centric coordinates.

The sensor can be reconfigured using the property panel and its mounting location can be dragged on the Sensor Canvas for coarse editing.

Additionally, you can select a new sensor in the toolstrip gallery and mount it on the tower, or add a new platform in the scene using the platform gallery and then mount a new sensor on it. This is illustrated in the GIF below.

Simulate the scenario

As this scenario is already set up, the next step is to run the simulation to generate the synthetic radar detections.

Click Run to run the simulation. Alternatively, use the drop-down to select Run Without Detections to simulate the ground truth only.

The application goes into simulation mode and the simulation begins automatically. You will see the two planes moving along their trajectories. When an aircraft is detected by the tower, you can see a dark purple marker show at the instant of detection.

To better observe the scene, you can use the axes toolbar to quickly navigate between X-Y, X-Z, or Y-Z view. Additionally, you can turn on and off the sensor coverage plot, the trajectory lines, the ground plane projection, and the orientation indicator.


Playback Controls and Time Scroll Bar

To observe the detection creation as the beam scans a target, use the playback control which allow you to pause, step back, and step forward the simulation.

The time scroll bar is located at the bottom of the Scenario View. It represents the current status of the simulation as well as the current time of display.

The light blue progress bar shows progress in the data simulation of the scenario. The darker blue rectangle slider shows the progress of the animation of the scenario.

The rectangle slider can be dragged backward (left) or forward in time (right) within the time range that has been simulated.

Step through the simulation, and observe that the radar generates a single detection per sweep between t = 19.30 s and t = 20.50 s. This is the region of ambiguity where the two planes cannot be resolved by the radar.

Export to MATLAB

To view and edit the code used to design the scenario, you can export the scenario as a MATLAB script. Use the script to add trackers and interact with the scenario programmatically.

Click Export to view the equivalent script that creates the scenario.

After clicking Export, you will see a script that can be saved to a file name of your choice. The current 3D view angles of the Scenario View are also exported to the script.

Run Generated Script

Visualize Targets and Detections

Once the script is saved, you can run it and observe the animated theater plot in MATLAB.

Edit the generated script for tracking

You can add the following commands to define a tracker as shown in the Tracking Closely Spaced Targets Under Ambiguity example.

Note: This code may need to be modified if you edit or use a different scenario.

The generated script from Tracking Scenario Designer has several comments that indicate where to add more code.

1) Configure a trackerJPDA

% Configure your tracker here:
numTracks = 20;
gate = 45;
vol = 1e9;
beta = 1e-14;
pd = 0.8;
far = 1e-6;
tracker = trackerJPDA(...
    'MaxNumTracks', numTracks, ...
    'MaxNumSensors', 1, ...
    'AssignmentThreshold',gate, ...
    'DetectionProbability', pd, ...
    'ClutterDensity', far/vol, ...
    'NewTargetDensity', beta,...

2) Define a track plotter

% Add a trackPlotter here:
trackp = trackPlotter(tp,'DisplayName','Tracks','ConnectHistory','on','ColorizeHistory','on');

3) Define a buffer for detections before the loop

% Main simulation loop
detBuffer = {};

4) Update the tracker within the loop

% Update your tracker here:
detBuffer = [detBuffer; dets]; %#ok<AGROW>
if configs.IsScanDone
    tracks = tracker(detBuffer,scenario.SimulationTime);
    pos = getTrackPositions(tracks,[1 0 0 0 0 0; 0 0 1 0 0 0 ; 0 0 0 0 1 0]);
    labels = string([tracks.TrackID]);
    detBuffer = {};

4) Update track plotter

% Update the trackPlotter here:
if configs.IsScanDone

Visualize Tracks

Observe the tracking animation by rerunning the script with the above additions. You will now visualize the tracks of the two planes.


In this example, you used the Tracking Scenario Designer application to load a tracking scenario session file. You also learned how to navigate the application and how to simulate the scenario. In the scenario, two aircraft are detected by a single radar. For a portion of the time, the two aircraft are so close that the radar cannot resolve them. You learned how to export the scenario to a MATLAB script to rerun the simulation and how to modify the script to add a JPDA tracker.