Main Content

plotScenario

Plot tracking scenario in trackingGlobeViewer

Since R2021b

Description

plotScenario(viewer,scene) plots the tracking scenario scene on the viewer. Internally, the function calls the plotPlatform object function to plot platforms and their associated trajectories, as well as the plotCoverage function to plot sensor coverages. When calling the plotPlatform function,:

  • If a platform has a kinematicTrajectory object or a static geoTrajectory object, then the plotScenario function specifies the TrajectoryMode name-value argument of the plotPlatform function as "History", showing only the previously plotted platform positions.

  • If a platform has a waypointTrajectory object or a nonstatic geoTrajectory object, then the plotScenario function sets the TrajectoryMode name-value argument of the plotPlatform function as "Full", showing the entire platform trajectory, including the future platform positions.

example

plotScenario(viewer,scene,detections) also plots detections on the viewer.

plotScenario(viewer,scene,detections,tracks) also plots tracks on the viewer.

Examples

collapse all

Create an Earth-centered scenario with two platforms and one sensor.

  scene = trackingScenario(IsEarthCentered=true);  

Specify the first platform and the sensor.

  poslla = [10 10 500];
  sensor = fusionRadarSensor(1);
  platform(scene,'Position',poslla,'Sensors',sensor);  

Specify the second platform.

  trajlla = geoTrajectory([10 11 500; 10 18 500],[0 3600]);
  platform(scene,Trajectory=trajlla);

Create the tracking globe viewer and plot the scenario.

  viewer = trackingGlobeViewer;
  plotScenario(viewer,scene);

Adjust the camera position from which to view the platforms.

  campos(viewer,[10.14 10.18 242190]);

Take a snapshot and show the results.

  drawnow
  snapshot(viewer);

Create a trackingGlobeViewer and specify its reference location.

refloc = [10 10 0];
viewer = trackingGlobeViewer(ReferenceLocation=refloc);

Create a non-Earth-centered scenario.

scene2 = trackingScenario(IsEarthCentered=false);
poslla2 = [0 0 -500];

Specify two platforms in the scenario.

sensor = fusionRadarSensor(1);
platform(scene2,'Position',poslla2,'Sensors',sensor);
trajlla = geoTrajectory([10 11 500; 10 18 500],[0 3600]);

To obtain the same waypointTrajectory positions as the geoTrajectory, transform the waypoints from LLA coordinates to north-east-down Cartesian waypoints using the lla2ned function.

trajned = waypointTrajectory(lla2ned(trajlla.Waypoints,refloc,"ellipsoid"),[0 3600]);
platform(scene2,Trajectory=trajned);

Plot the scenario.

plotScenario(viewer,scene2)
campos(viewer,[10.14 10.18 242190]); % Adjust camera position

Take a snapshot and show the results.

drawnow
snapshot(viewer)

Input Arguments

collapse all

Tracking globe viewer, specified as a trackingGlobeViewer object.1

Tracking scenario, specified as a trackingScenario object.

Object detections, specified as an objectDetection object, an array of objectDetection objects, or a cell array of objectDetection objects.

Object tracks, specified as an objectTrack object, an array of objectTrack objects, or a cell array of objectTrack objects. In any of these three formats, you can replace the objectTrack object by a track structure containing these fields: SourceIndex, TrackID, State, and StateCovariance. The specifications of these fields are the same as the corresponding properties in the objectTrack object.

Version History

Introduced in R2021b


1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.