%% Air Traffic Control
% This example shows how to generate an air traffic control scenario,
% simulate radar detections from an airport surveillance radar (ASR), and
% configure a global nearest neighbor (GNN) tracker to track the simulated
% targets using the radar detections. This enables you to evaluate
% different target scenarios, radar requirements, and tracker
% configurations without needing access to costly aircraft or equipment.
% This example covers the entire synthetic data workflow.
% Copyright 2017-2019 The MathWorks, Inc.
%% Air Traffic Control Scenario
% Simulate an air traffic control (ATC) tower and moving targets
% in the scenario as _platforms_. Simulation of the motion of the platforms
% in the scenario is managed by |trackingScenario|.
%
% Create a |trackingScenario| and add the ATC tower to the scenario.
% Create tracking scenario
scenario = trackingScenario;
% Add a stationary platform to model the ATC tower
tower = platform(scenario);
%% Airport Surveillance Radar
% Add an airport surveillance radar (ASR) to the ATC tower. A typical ATC
% tower has a radar mounted 15 meters above the ground. This radar scans
% mechanically in azimuth at a fixed rate to provide 360 degree coverage in
% the vicinity of the ATC tower. Common specifications for an ASR are
% listed:
%
% * Sensitivity: 0 dBsm @ 111 km
% * Mechanical Scan: Azimuth only
% * Mechanical Scan Rate: 12.5 RPM
% * Electronic Scan: None
% * Field of View: 1.4 deg azimuth, 10 deg elevation
% * Azimuth Resolution: 1.4 deg
% * Range Resolution: 135 m
%
% Model the ASR with the above specifications using the
% |monostaticRadarSensor|.
rpm = 12.5;
fov = [1.4;10];
scanrate = rpm*360/60; % deg/s
updaterate = scanrate/fov(1); % Hz
radar = monostaticRadarSensor(1, 'Rotator', ...
'UpdateRate', updaterate, ... % Hz
'FieldOfView', fov, ... % [az;el] deg
'MaxMechanicalScanRate', scanrate, ... % deg/sec
'AzimuthResolution', fov(1), ... % deg
'ReferenceRange', 111e3, ... % m
'ReferenceRCS', 0, ... % dBsm
'RangeResolution', 135, ... % m
'HasINS', true, ...
'DetectionCoordinates', 'Scenario');
% Mount radar at the top of the tower
radar.MountingLocation = [0 0 -15];
tower.Sensors = radar;
%%
% Tilt the radar so that it surveys a region beginning at 2 degrees above
% the horizon. To do this, enable elevation and set the mechanical scan
% limits to span the radar's elevation field of view beginning at 2 degrees
% above the horizon. Because |trackingScenario| uses a North-East-Down
% (NED) coordinate frame, negative elevations correspond to points above
% the horizon.
% Enable elevation scanning
radar.HasElevation = true;
% Set mechanical elevation scan to begin at 2 degrees above the horizon
elFov = fov(2);
tilt = 2; % deg
radar.MechanicalScanLimits(2,:) = [-fov(2) 0]-tilt; % deg
%%
% Set the elevation field of view to be slightly larger than the elevation
% spanned by the scan limits. This prevents raster scanning in elevation
% and tilts the radar to point in the middle of the elevation scan limits.
radar.FieldOfView(2) = elFov+1e-3;
%%
% The |monostaticRadarSensor| models range and elevation bias due to
% atmospheric refraction. These biases become more pronounced at lower
% altitudes and for targets at long ranges. Because the index of refraction
% changes (decreases) with altitude, the radar signals propagate along a
% curved path. This results in the radar observing targets at altitudes
% which are higher than their true altitude and at ranges beyond their
% line-of-sight range.
%%
% Add three airliners within the ATC control sector. One airliner
% approaches the ATC from a long range, another departs, and the third is
% flying tangential to the tower. Model the motion of these airliners over
% a 60 second interval.
%
% |trackingScenario| uses a North-East-Down (NED) coordinate frame. When
% defining the waypoints for the airliners below, the z-coordinate
% corresponds to down, so heights above the ground are set to negative
% values.
% Duration of scenario
sceneDuration = 60; % s
% Inbound airliner
ht = 3e3;
spd = 900*1e3/3600; % m/s
wp = [-5e3 -40e3 -ht;-5e3 -40e3+spd*sceneDuration -ht];
traj = waypointTrajectory('Waypoints',wp,'TimeOfArrival',[0 sceneDuration]);
platform(scenario,'Trajectory', traj);
% Outbound airliner
ht = 4e3;
spd = 700*1e3/3600; % m/s
wp = [20e3 10e3 -ht;20e3+spd*sceneDuration 10e3 -ht];
traj = waypointTrajectory('Waypoints',wp,'TimeOfArrival',[0 sceneDuration]);
platform(scenario,'Trajectory', traj);
% Tangential airliner
ht = 4e3;
spd = 300*1e3/3600; % m/s
wp = [-20e3 -spd*sceneDuration/2 -ht;-20e3 spd*sceneDuration/2 -ht];
traj = waypointTrajectory('Waypoints',wp,'TimeOfArrival',[0 sceneDuration]);
platform(scenario,'Trajectory', traj);
% Create a display to show the true, measured, and tracked positions of the
% airliners.
[theater,fig] = helperATCExample('Create Display',scenario);
helperATCExample('Update Display',theater,scenario,tower);
%% GNN Tracker
% Create a |trackerGNN| to form tracks from the radar detections generated
% from the three airliners. Update the tracker with the detections
% generated after the completion of a full 360 degree scan in azimuth.
%
% The tracker uses the |initFilter| supporting function to initialize a
% constant velocity extended Kalman filter for each new track. |initFilter|
% modifies the filter returned by |initcvekf| to match the target
% velocities and tracker update interval.
tracker = trackerGNN( ...
'Assignment', 'Auction', ...
'AssignmentThreshold',50, ...
'FilterInitializationFcn',@initFilter);
%% Simulate and Track Airliners
% The following loop advances the platform positions until the end of the
% scenario has been reached. For each step forward in the scenario, the
% radar generates detections from targets in its field of view. The tracker
% is updated with these detections after the radar has completed a 360
% degree scan in azimuth.
% Set simulation to advance at the update rate of the radar
scenario.UpdateRate = radar.UpdateRate;
% Create a buffer to collect the detections from a full scan of the radar
scanBuffer = {};
% Initialize the track array
tracks = [];
% Set random seed for repeatable results
rng(2020)
while advance(scenario) && ishghandle(fig)
% Generate detections on targets in the radar's current field of view
[dets,config] = detect(scenario);
scanBuffer = [scanBuffer;dets]; %#ok<AGROW>
% Update tracks when a 360 degree scan is complete
simTime = scenario.SimulationTime;
if config.IsScanDone
% Update tracker
tracks = tracker(scanBuffer,simTime);
% Clear scan buffer for next scan
scanBuffer = {};
elseif isLocked(tracker)
% Predict tracks to the current simulation time
tracks = predictTracksToTime(tracker,'confirmed',simTime);
end
% Update display with current beam position, buffered detections, and
% track positions
helperATCExample('Take Snapshots',fig,scenario,config);
helperATCExample('Update Display',theater,scenario,tower,scanBuffer,tracks);
helperATCExample('Take Snapshots',fig,scenario,config);
end
helperATCExample('Take Snapshots',fig,scenario,config);
%%
% Use |helperATCExample| to show the first snapshot taken at the
% completion of the radar's second scan.
helperATCExample('Show Snapshots',1);
%%
% The preceding figure shows the scenario at the end of the radar's second
% 360 degree scan. Radar detections, shown as blue dots, are present for
% each of the simulated airliners. At this point, the tracker has already
% been updated by one complete scan of the radar. Internally, the tracker
% has initialized tracks for each of the airliners. These tracks will be
% shown after the update following this scan, when the tracks are promoted
% to confirmed, meeting the t
评论0