record
Run tracking scenario and record platform, sensor, and emitter information
Description
returns a record, rec
= record(sc
)rec
, of the evolution of the tracking
scenario simulation, sc
. The function starts from the beginning
of the simulation and stores the record until the end of the simulation. A scenario
simulation ends when either the scenario StopTime
is reached or
any platform in the scenario has finished its trajectory specified by the
Trajectory
property.
specifies additional recording quantities using name-value pairs. Enclose each
rec
= record(___,Name,Value
)Name
in quotes.
Note
The record
function only records detections generated
from sensors contained in the scenario and does not record tracks generated from a
fusionRadarSensor
object contained in the scenario. fusionRadarSensor
generates detections when you set its
TargetReportFormat
property to
'Detetions'
or 'Clustered Detections'
and
generates tracks when you set its TargetReportFormat
property
to 'Tracks'
.
Input Arguments
sc
— Tracking scenario
trackingScenario
object
Tracking scenario, specified as a trackingScenario
object.
format
— Pose orientation format
'quaternion'
(default) | 'rotmat'
Pose orientation format, specified as 'quaternion'
or
'rotmat'
. When specified as
'quaternion'
, the Orientation
field of the platform pose structure is a quaternion. When specified as
'rotmat'
, the Orientation
field is
a rotation matrix.
Example: 'rotmat'
Data Types: char
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.
IncludeEmitters
— Enable recording emission information
false
(default) | true
Enable recording emission information, specified as
true
or false
. When specified
as true
, the rec
output contains
Emissions
,
EmitterConfigurations
,
EmitterPlatformIDs
, and
CoverageConfig
fields.
IncludeSensors
— Enable recording sensor information
false
(default) | true
Enable recording sensor information, specified as
true
or false
. When specified
as true
, the rec
output contains
Detections
,
SensorConfiguration
,
SensorPlatformIDs
, and
CoverageConfig
fields.
InitialSeed
— Initial random seed for recording
current random seed (default) | positive integer
Initial random seed for recording, specified as a positive integer. If specified as a positive integer, the function assigns this number to the random number generator "Twister" before the recording and resets the random number generator at the end of the recording.
HasOcclusion
— Enable occlusion in signal transmission
true
(default) | false
Enable occlusion in signal transmission, specified as
true
or false
. When specified
as true
, the function accounts for the effect of
occlusion in radar emission propagation.
RecordingFormat
— Format of recording
'Struct'
(default) | 'Recording'
Format of recording, specified as 'Struct'
or
'Recording'
. When specified as
'Struct'
, the rec
output is
an array of structures. When specified as
'Recording'
, the rec
output is a
trackingScenarioRecording
object.
CoordinateSystem
— Coordinate system to report recorded poses
'Cartesian'
(default) | 'Geodetic'
Coordinate system to report recorded positions, specified as:
'Cartesian'
— Report recorded poses using Cartesian coordinates in the Earth-Centered-Earth-Fixed coordinate frame.'Geodetic'
— Report recorded positions using geodetic coordinates (latitude, longitude, and altitude). Report recorded orientation, velocity, and acceleration in the local reference frame of each platform (North-East-Down by default) corresponding to the current waypoint.
You can only use this argument when the
IsEarthCentered
property of the tracking
scenario, sc
, is set to
true
.
Output Arguments
rec
— Records of platform states during simulation
M-by-1 array of structures | trackingScenarioRecording
object
Records of platform states during the simulation, returned as an
M-by-1 array of structures if the
RecordingFormat
is specified as
'struct'
(default), or a trackingScenarioRecording
object if the
RecordingFormat
is specified as
'Recording'
. M is the number of
time steps in the simulation. For an example on running a recorded scenario,
see Run Recorded Scenario.
Each record contains the simulation time step and the recorded information
at that time. The record structure has at least two fields:
SimulationTime
and Poses
. It can
also have other optional fields depending on the input.
The SimulationTime
field contains the simulation time
of the record. Poses
is an N-by-1
array of structures, where N is the number of platforms.
Each Poses
structure contains fields that represent the
ground truth state of each platform in the simulation.
Field | Description |
---|---|
PlatformID | Unique identifier for the platform, specified as a positive integer. This is a required field with no default value. |
ClassID | User-defined integer used to classify the type of target, specified as a nonnegative integer. Zero is reserved for unclassified platform types and is the default value. |
Position | Position of platform in scenario coordinates, specified as a real-valued 1-by-3 row vector.
|
Velocity | Velocity of platform in scenario coordinates, specified as a real-valued 1-by-3 row
vector. Units are meters per second. The default value is |
Acceleration | Acceleration of the platform in scenario coordinates, specified as a
1-by-3 row vector in meters per second squared. The default value is
|
Orientation | Orientation of the platform with respect to the local scenario navigation frame,
specified as a scalar quaternion or a 3-by-3 rotation matrix. Orientation
defines the frame rotation from the local navigation coordinate system to
the current platform body coordinate system. Units are dimensionless. The
default value is |
AngularVelocity | Angular velocity of the platform in scenario coordinates, specified as a real-valued
1-by-3 vector. The magnitude of the vector defines the angular speed. The
direction defines the axis of clockwise rotation. Units are degrees per
second. The default value is |
The optional fields in the rec
output
are:
Field | Description |
---|---|
Emissions | A cell array of emissions (such as |
EmitterConfigurations | A struct array of emitter configurations for each emitter |
EmitterPlatformIDs | A numeric array of platform IDs for each emitter |
PointClouds | A cell of point cloud points |
PointCloudClusters | A cell array of point cloud clusters |
Detections | A cell array of |
SensorConfigurations | A struct array of sensor configurations for each sensor |
SensorPlatformIDs | A numeric array of platform IDs for each sensor |
CoverageConfig | A struct array of coverage configurations for each sensor or emitter |
Each emitter configuration structure contains the following fields:
Field | Description |
EmitterIndex | Unique emitter index, returned as a positive integer. |
IsValidTime | Valid emission time, returned as |
IsScanDone | Whether the emitter has completed a scan, returned as |
FieldOfView | Field of view of the emitter, returned as a two-element vector [azimuth; elevation] in degrees. |
MeasurementParameters | Emitter measurement parameters, returned as an array of structures containing the coordinate frame transforms needed to transform positions and velocities in the top-level frame to the current emitter looking-angle frame. |
Each sensor configuration structure contains the following fields:
Field | Description |
SensorIndex | Unique sensor index, returned as a positive integer. |
IsValidTime | Valid detection time, returned as |
IsScanDone |
|
RangeLimits | Lower and upper range detection limits, returned as a two-element real-valued vector in meters. |
RangeRateLimits | Lower and upper range-rate detection limits, returned as a two-element real-valued vector in m/s. |
FieldOfView | Field of view of the sensor, returned as a 2-by-1 vector of positive real values, [ |
MeasurementParameters | Sensor measurement parameters, returned as an array of structures containing the coordinate frame transforms needed to transform positions and velocities in the top-level frame to the current sensor looking-angle frame. |
Each coverage configuration structure contains these fields:
Fields of configurations
Field | Description |
---|---|
Index | A unique integer to identify sensors or emitters. |
LookAngle |
Current boresight angles of the sensor or emitter, specified as:
|
FieldOfView | Field of view of the sensor or emitter, specified as a two-element vector
[azimuth ; elevation ] in
degrees. |
ScanLimits |
Minimum and maximum angles the sensor or emitter can scan from its
|
Range | Range of the beam and coverage area of the sensor or emitter in meters. |
Position | Origin position of the sensor or emitter, specified as a three-element vector
[X , Y , Z ]. |
Orientation | Rotation transformation from the scenario or global frame to the sensor or emitter mounting frame, specified as a rotation matrix, a quaternion, or three Euler angles in ZYX sequence. |
Examples
Record a Tracking Scenario
Create a new scenario and add a platform.
scene = trackingScenario; plat = platform(scene);
Specify the platform trajectory. The distance of the trajectory is 25 meters. The trajectory velocity is 20 m/s in the x-direction.
plat.Trajectory = waypointTrajectory('Waypoints',[0 0 0; 25 0 0], ... 'TimeOfArrival', [0 25/20]);
Run simulation and record results.
r = record(scene)
r=13×1 struct array with fields:
SimulationTime
Poses
Show the record at the initial time.
r(1)
ans = struct with fields:
SimulationTime: 0
Poses: [1x1 struct]
r(1).Poses
ans = struct with fields:
PlatformID: 1
ClassID: 0
Position: [0 0 0]
Velocity: [20 0 0]
Acceleration: [0 0 0]
Orientation: [1x1 quaternion]
AngularVelocity: [0 0 0]
Show the record at the final time.
r(end)
ans = struct with fields:
SimulationTime: 1.2000
Poses: [1x1 struct]
r(end).Poses
ans = struct with fields:
PlatformID: 1
ClassID: 0
Position: [24 0 0]
Velocity: [20 0 0]
Acceleration: [0 0 0]
Orientation: [1x1 quaternion]
AngularVelocity: [0 0 0]
Load and Record Tracking Scenario
Load an air traffic control tracking scenario.
load ATCScenario scenario
Run simulation and record results.
r = record(scenario,'quaternion', ... 'IncludeSensors',true,'InitialSeed',2019);
Show the record at the initial time.
r(1)
ans = struct with fields:
SimulationTime: 0
Poses: [4x1 struct]
Detections: {0x1 cell}
PointClouds: {0x1 cell}
PointCloudClusters: {0x1 cell}
SensorConfigurations: [1x1 struct]
SensorPlatformIDs: 1
CoverageConfig: [1x1 struct]
Show the record at the final time.
r(end)
ans = struct with fields:
SimulationTime: 59.9947
Poses: [4x1 struct]
Detections: {0x1 cell}
PointClouds: {0x1 cell}
PointCloudClusters: {0x1 cell}
SensorConfigurations: [1x1 struct]
SensorPlatformIDs: 1
CoverageConfig: [1x1 struct]
Version History
Introduced in R2018b
See Also
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 (한국어)