Main Content

radarScenario

Create radar scenario

Since R2021a

Description

radarScenario creates a radar scenario object. A radar scenario simulates a 3-D environment containing multiple platforms. Platforms represent objects 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 the source of signals or reflector of signals.

Populate a radar scenario by calling the platform function for each platform you want to add. You can model platforms as points or cuboids by specifying the 'Dimension' property when calling the platform function. Platforms have signatures with properties that are specific to the type of sensor, such as radar cross-section for radar sensors. You can create trajectories for any platform using the kinematicTrajectory, waypointTrajectory, or geoTrajectory System object™.

After you add all desired platforms, you can simulate the scenario in incremental time steps by using the advance function in a loop. You can run the simulation all at once using the record function.

Creation

Description

scene = radarScenario creates an empty radar scenario scene with default property values. You can specify platform trajectories in the scenario as Cartesian states using the kinematicTrajectory or waypointTrajectory System object.

scene = radarScenario('IsEarthCentered',true) creates an empty Earth-centered radar scenario and sets the IsEarthCentered property as true. You can specify platform trajectories in the scenario as geodetic states using the geoTrajectory System object.

example

scene = radarScenario(Name,Value) configures the properties of a radarScenario object using one or more name-value arguments. Name is a property name and Value is the corresponding value. You can specify several name-value arguments in any order. Any unspecified properties take default values.

Properties

expand all

Enable Earth-centered reference frame and trajectories, specified as a logical 0 (false) or 1 (true).

  • If specified as 0 (false), then you must define the trajectories of platforms as Cartesian states using the kinematicTrajectory or waypointTrajectory System object.

  • If specified as 1 (true), then you must define the trajectories of platforms as geodetic states using the geoTrajectory System object.

You can specify the IsEarthCentered property only when creating the radar scenario.

Data Types: logical

Frequency of simulation updates, specified as a nonnegative scalar in hertz.

  • When specified as a positive scalar, the scenario advances with the time step of 1/F, where F is the value of the UpdateRate property.

  • When specified as 0, the simulation advances to the next scheduled sampling time of any mounted sensors or emitters. For example, if a scenario has two sensors with update rates of 2 Hz and 5 Hz, then the first seven simulation updates are at 0, 0.2, 0.4, 0.5, 0.6, 0.8 and 1.0 seconds, respectively.

Example: 2.0

Data Types: double

This property is read-only.

Current time of the simulation, specified as a positive scalar in seconds. To reset the simulation time to zero and restart the simulation, call the restart function.

Data Types: double

Stop time of the simulation, specified as a positive scalar in seconds. The 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 with waypoints using the waypointTrajectory System object

Example: 60.0

Data Types: double

This property is read-only.

Simulation status, specified as one of these values.

  • NotStarted — When the advance function has not been used on the radar scenario.

  • InProgress — When the advance function has been used on the radar scenario at least once and the scenario has not reached the Completed status.

  • Completed — When the scenario reaches the stop time specified by the StopTime property or any Platform object in the scenario reaches the end of its trajectory.

You can restart a scenario simulation by using the restart object function.

Data Types: enumeration

This property is read-only.

Platforms in the scenario, returned as a cell array of Platform objects. The number of elements in the cell array is equal to the number of platforms in the scenario. To add a platform to the scenario, use the platform function.

Initial advance when calling the advance function, specified as one of these values.

  • Zero — The scenario simulation starts at time 0 in the first call to the advance function.

  • UpdateInterval — The scenario simulation starts at time 1/F, where F is the value of a nonzero UpdateRate property. If the UpdateRate property is specified as 0, then the scenario simulation ignores the InitialAdvance property and starts at time 0.

Data Types: enumeration

This property contains the SurfaceManager object associated with the scenario.

Object Functions

platformAdd platform to radar scenario
landSurfaceAdd land surface to radar scenario
seaSurfaceAdd sea surface to radar scenario
customSurfaceAdd custom surface with complex scattering to a radar scenario
advanceAdvance radar scenario simulation by one time step
atmosphereAdd atmosphere model object to radar scenario
restartRestart simulation of radar scenario
recordRecord simulation of radar scenario
emitCollect emissions from all emitters in radar scenario
propagatePropagate emissions in radar scenario
detectCollect detections from all sensors in radar scenario
receiveReceive IQ signal from radars in the scenario
clutterGeneratorAdd clutter generator for radar
platformProfilesProfiles of radar scenario platforms
platformPosesPosition information for each platform in radar scenario
coverageConfigSensor and emitter coverage configuration
perturbApply perturbations to radar scenario
cloneCreate copy of radar scenario

Examples

collapse all

Create a radar scenario with two platforms that follow different trajectories.

sc = radarScenario('UpdateRate',100,'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)
    {1x1 radar.scenario.Platform}    {1x1 radar.scenario.Platform}

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

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 an Earth-centered radar scenario and specify the update rate.

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

Add a platform to the scenario that represents an airplane. The trajectory of the airplane changes in longitude and altitude. Specify the trajectory using geodetic coordinates.

geoTraj = geoTrajectory([42.300,-71.351,10600;42.300,-124.411,0],[0 21600]);
plane = platform(scene,'Trajectory',geoTraj);

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

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

Convert the distance units from meters to kilometers.

km = 1000;
positions = positions/km;

Visualize the start position, end position, and trajectory in the ECEF frame.

hold on
plot3(positions(1,1),positions(1,2),positions(1,3),'b*')
plot3(positions(end,1),positions(end,2),positions(end,3),'bo')
plot3(positions(:,1),positions(:,2),positions(:,3),'b')

Plot the Earth radial lines of the start position and end position.

plot3([0 positions(1,1)],[0 positions(1,2)],[0 positions(1,3)],'k:')
plot3([0 positions(end,1)],[0 positions(end,2)],[0 positions(end,3)],'k:')
xlabel('x (km)')
ylabel('y (km)')
zlabel('z (km)')
legend('Start position','End position','Trajectory')
view(3)

Version History

Introduced in R2021a