platform
Description
Examples
Create Platform with Circular Trajectory
Create a radar scenario.
rs = radarScenario;
Create a platform with default property values and add it to the scenario.
plat = platform(rs);
Specify the trajectory of the platform as 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.
wpts = [0 10 0; 10 0 0; 0 -10 0; -10 0 0; 0 10 0]; times = [0; 0.25; .5; .75; 1.0]; plat.Trajectory = waypointTrajectory(wpts,times);
Display the properties of the platform object.
plat
plat = Platform with properties: PlatformID: 1 ClassID: 0 Position: [0 10 0] Orientation: [-1.7180e-05 0 0] Dimensions: [1x1 struct] Trajectory: [1x1 waypointTrajectory] PoseEstimator: [1x1 insSensor] Emitters: {} Sensors: {} Signatures: {[1x1 rcsSignature]}
Perform the simulation, advancing one time step at a time. Display the simulation time and the position and velocity of the platform at each time step.
while advance(rs) p = pose(plat); disp(strcat("Time = ",num2str(rs.SimulationTime))) disp(strcat(" Position = [",num2str(p.Position),"]")) disp(strcat(" Velocity = [",num2str(p.Velocity),"]")) end
Time = 0
Position = [0 10 0]
Velocity = [62.8318 -1.88403e-05 0]
Time = 0.1
Position = [5.8779 8.0902 0]
Velocity = [50.832 -36.9316 0]
Time = 0.2
Position = [9.5106 3.0902 0]
Velocity = [19.4161 -59.7566 0]
Time = 0.3
Position = [9.5106 -3.0902 0]
Velocity = [-19.4161 -59.7567 0]
Time = 0.4
Position = [5.8779 -8.0902 0]
Velocity = [-50.832 -36.9316 0]
Time = 0.5
Position = [0 -10 0]
Velocity = [-62.8319 1.88181e-05 0]
Time = 0.6
Position = [-5.8779 -8.0902 0]
Velocity = [-50.832 36.9316 0]
Time = 0.7
Position = [-9.5106 -3.0902 0]
Velocity = [-19.4161 59.7566 0]
Time = 0.8
Position = [-9.5106 3.0902 0]
Velocity = [19.4161 59.7566 0]
Time = 0.9
Position = [-5.8779 8.0902 0]
Velocity = [50.832 36.9316 0]
Time = 1
Position = [-7.10543e-15 10 0]
Velocity = [62.8319 -1.88404e-05 0]
Create Cuboid Platforms with Circular Trajectory
Create a radar scenario.
rs = radarScenario;
Create a cuboid platform for a truck with dimensions 5 m by 2.5 m by 3.5 m.
dim1 = struct('Length',5,'Width',2.5,'Height',3.5,'OriginOffset',[0 0 0]); truck = platform(rs,'Dimension',dim1);
Specify the trajectory of the truck as a circle with radius 20 m.
truck.Trajectory = waypointTrajectory('Waypoints', ... [20*cos(2*pi*(0:10)'/10) 20*sin(2*pi*(0:10)'/10) -1.75*ones(11,1)], ... 'TimeOfArrival',linspace(0,50,11)');
Create the platform for a small quadcopter with dimensions 0.3 m by 0.3 m by 0.1 m.
dim2 = struct('Length',.3,'Width',.3,'Height',.1,'OriginOffset',[0 0 0]); quad = platform(rs,'Dimension',dim2);
Specify the trajectory of the quadcopter as a circle 10 m above the truck with a small angular delay. Note that the negative z coordinates correspond to positive elevation.
quad.Trajectory = waypointTrajectory('Waypoints', ... [20*cos(2*pi*((0:10)'-.6)/10) 20*sin(2*pi*((0:10)'-.6)/10) -11.80*ones(11,1)], ... 'TimeOfArrival',linspace(0,50,11)');
Visualize the results using theaterPlot
.
tp = theaterPlot('XLim',[-30 30],'YLim',[-30 30],'Zlim',[-12 5]); pp1 = platformPlotter(tp,'DisplayName','truck','Marker','s'); pp2 = platformPlotter(tp,'DisplayName','quadcopter','Marker','o');
Specify a view direction and run the simulation.
view(-28,37); set(gca,'Zdir','reverse'); while advance(rs) poses = platformPoses(rs); plotPlatform(pp1,poses(1).Position,truck.Dimensions,poses(1).Orientation); plotPlatform(pp2,poses(2).Position,quad.Dimensions,poses(2).Orientation); end
Input Arguments
scenario
— Radar scenario
radarScenario
object
Radar scenario, specified as a radarScenario
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'ClassID',2
ClassID
— Platform classification identifier
0
(default) | nonnegative integer
Platform classification identifier, specified as a nonnegative integer. You can
define your own platform classification scheme and assign ClassID
values to platforms according to the scheme. The value of 0
is
reserved for an object of unknown or unassigned class.
Example: 5
Data Types: double
Trajectory
— Platform motion
kinematicTrajectory
object | waypointTrajectory
object | geoTrajectory
object
Platform motion, specified as a kinematicTrajectory
object, a waypointTrajectory
object, or a geoTrajectory
object. The
trajectory object defines the time evolution of the position and velocity of the
platform frame origin, as well as the orientation of the platform frame relative to the
scenario frame.
When the
IsEarthCentered
property of the scenario is set tofalse
, use thekinematicTrajectory
or thewaypointTrajectory
object. By default, the platform uses a stationarykinematicTrajectory
object.When the
IsEarthCentered
property of the scenario is set totrue
, use thegeoTrajectory
object. By default, the platform uses a stationarygeoTrajectory
object.
Position
— Position of platform
three-element vector of scalars
This property is read-only.
Current position of the platform, specified as a three-element vector of scalars.
When the
IsEarthCentered
property of the scenario is set tofalse
, the position is specified as a three-element Cartesian state [x
,y
,z
] in meters.When the
IsEarthCentered
property of the scenario is set totrue
, the position is specified as a three-element geodetic state:latitude
in degrees,longitude
in degrees, andaltitude
in meters.
Specify this argument only when creating a stationary platform. If you choose to
specify the trajectory of the platform, use the Trajectory
argument.
Data Types: double
Orientation
— Orientation of platform
three-element numeric vector
This property is read-only.
Orientation of the platform, specified as a three-element numeric vector in
degrees. The three elements are the [yaw
, pitch
,
roll
] rotation angles from the local reference frame to the body
frame of the platform.
Specify this argument only when creating a stationary platform. If you choose to
specify the orientation over time, use the Trajectory
argument.
Data Types: double
Signatures
— Platform signatures
cell array of signature objects | {}
Platform signatures, specified as a cell array of signature objects or an empty
cell array ({}
). The default value is a cell array containing an
rcsSignature
object with default property values. If you have Sensor Fusion and Tracking Toolbox™, then the cell array can also include irSignature
(Sensor Fusion and Tracking Toolbox)
and tsSignature
(Sensor Fusion and Tracking Toolbox)
objects. The cell array contains at most one instance for each type of signature
object. A signature represents the reflection or emission pattern of a platform such
as its radar cross-section, target strength, or IR intensity.
Dimensions
— Platform dimensions and origin offset
struct('Length',0,'Width',0,'Height',0,'OriginOffset',[0 0
0])
| structure
Platform dimensions and origin offset, specified as a structure. The structure contains the
Length
, Width
, Height
, and
OriginOffset
of a cuboid that approximates the dimensions of the
platform. The OriginOffset
is the position vector from the center of
the cuboid to the origin of the platform coordinate frame. The
OriginOffset
is expressed in the platform coordinate system. For
example, if the platform origin is at the center of the cuboid rear face as shown in the
figure, then set OriginOffset
as [-L/2,
0, 0]
. The default value for Dimensions
is a structure
with all fields set to zero, which corresponds to a point model.
Fields of Dimensions
Fields | Description | Default |
---|---|---|
Length | Dimension of a cuboid along the x direction | 0 |
Width | Dimension of a cuboid along the y direction | 0 |
Height | Dimension of a cuboid along the z direction | 0 |
OriginOffset | Position of the platform coordinate frame origin with respect to the cuboid center | [0 0 0 ] |
Example: struct('Length',5,'Width',2.5,'Height',3.5,'OriginOffset',[-2.5 0 0])
For the
radarTransceiver
platformLength
,Width
, andHeight
can be set to any non-negative values when used in aradarScenario
.For the
radarDataGenerator
, platformLength
,Width
, andHeight
are ignored if set to non-zero values in aradarScenario
. All platforms are considered points.
Data Types: struct
PoseEstimator
— Platform pose estimator
insSensor
object (default) | pose estimator object
Platform pose estimator, specified as a pose-estimator object such as an insSensor
object. The pose estimator determines platform pose with respect to the local NED
scenario coordinates. The interface of any pose estimator must match the interface of
the insSensor
object. By default, the platform sets the pose
estimator accuracy properties to zero.
Emitters
— Emitters mounted on platform
cell array of emitter objects
Emitters mounted on the platform, specified as a cell array of emitter objects
such as radarEmitter
objects. If you have Sensor Fusion and Tracking Toolbox, then the cell array can also include sonarEmitter
(Sensor Fusion and Tracking Toolbox) objects.
Sensors
— Sensors mounted on platform
cell array of sensor objects
Sensors mounted on the platform, specified as a cell array of sensor objects such
as radarDataGenerator
objects.
Output Arguments
plat
— Scenario platform
Platform
object
Scenario platform, returned as a Platform
object.
Version History
Introduced in R2021a
See Also
Platform
| radarScenario
| waypointTrajectory
| rcsSignature
| insSensor
| radarEmitter
| radarDataGenerator
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)