# platform

Since R2021a

## Syntax

``plat = platform(scenario)``
``plat = platform(scenario,Name,Value)``

## Description

example

````plat = platform(scenario)` creates a new `Platform` object, `plat`, and adds the platform to the radar scenario, `scenario`.```

example

````plat = platform(scenario,Name,Value)` creates a new `Platform` object with additional properties specified by one or more name-value arguments.```

## Examples

collapse all

`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] ```

`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

collapse all

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`

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`

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 to `false`, use the `kinematicTrajectory` or the `waypointTrajectory` object. By default, the platform uses a stationary `kinematicTrajectory` object.

• When the `IsEarthCentered` property of the scenario is set to `true`, use the `geoTrajectory` object. By default, the platform uses a stationary `geoTrajectory` object.

Current position of the platform, specified as a three-element vector of scalars.

• When the `IsEarthCentered` property of the scenario is set to `false`, the position is specified as a three-element Cartesian state [`x`, `y`, `z`] in meters.

• When the `IsEarthCentered` property of the scenario is set to `true`, the position is specified as a three-element geodetic state: `latitude` in degrees, `longitude` in degrees, and `altitude` 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 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`

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.

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`

FieldsDescriptionDefault
`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])`

Data Types: `struct`

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 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 mounted on the platform, specified as a cell array of sensor objects such as `radarDataGenerator` objects.

## Output Arguments

collapse all

Scenario platform, returned as a `Platform` object.

## Version History

Introduced in R2021a