read
Description
[
returns one recorded data set at the simulation time, simTime
,poses
,detections
,sensorConfigs
,sensorPlatformIDs
,emissions
,emitterConfigs
,emitterPlatformIDs
] = read(recording
)simTime
, from a
radar scenario recording.
Examples
Run Recorded Radar Scenario
Load prerecorded data from a radar scenario. The data is saved as a struct with the variable name recordedData
. Create a radarScenarioRecording
object using the recorded data.
load recordedRadarScenarioData.mat
recording = radarScenarioRecording(recordedData);
Construct a theater plot to display the recorded data using multiple plotters.
tp = theaterPlot('AxesUnits',["km" "km" "km"], ... 'XLimits',[-50 50]*1e3,'YLimits',[-50 50]*1e3,'ZLimits',[-20 20]*1e3); to = platformPlotter(tp,'DisplayName','Tower','Marker','d'); pp = platformPlotter(tp,'DisplayName','Targets'); dp = detectionPlotter(tp,'DisplayName','Detections','MarkerFaceColor','black'); cp = coveragePlotter(tp,'DisplayName','Radar Beam'); coverage = struct('Index',1,'LookAngle',[0;-7],'FieldOfView',[1;10], ... 'ScanLimits',[0 365;-12 -2],'Range',100e3,'Position',[0;0;-15], ... 'Orientation',eye(3));
Run the recorded scenario and animate the results.
scanBuffer = {}; while ~isDone(recording) % Step the reader to read the next frame of data [simTime,poses,covcon,dets,senconfig] = read(recording); scanBuffer = [scanBuffer;dets]; %#ok<AGROW> plotPlatform(to,poses(1).Position); plotPlatform(pp,reshape([poses(2:4).Position]',3,[])'); plotCoverage(cp,covcon); if ~isempty(dets) plotDetection(dp,cell2mat(cellfun(@(c) c.Measurement(:)', scanBuffer, 'UniformOutput', false))); end % Clear the buffer when a 360 degree scan is complete if senconfig.IsScanDone scanBuffer = {}; dp.clearData; end end
Input Arguments
recording
— Radar scenario recording
radarScenarioRecording
object
Radar scenario recording, specified as a radarScenarioRecording
object.
Output Arguments
simTime
— Simulation time
nonnegative scalar
Simulation time, returned as a nonnegative scalar.
poses
— Poses of platforms
array of structures
Poses of platforms, returned as an array of structures. Each structure has these fields.
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 target 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 |
detections
— Detections
cell array of objectDetection
objects
Detections, returned as a cell array of objectDetection
objects.
sensorConfigs
— Sensor configurations
array of structures
Sensor configurations, returned as an array of structures. Each structure has these fields.
Field | Description |
SensorIndex | Unique sensor index, returned as a positive integer. |
IsValidTime | Valid detection time, returned as |
IsScanDone |
|
FieldOfView | Field of view of the sensor, returned as a 2-by-1 vector of positive
real values, [ |
RangeLimits | Minimum and maximum range of sensor, in meters, specified as a 1-by-2
nonnegative real-valued vector of the form
|
RangeRateLimits | Minimum and maximum range rate of sensor, in meters per second,
specified as a 1-by-2 real-valued vector of the form
|
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 frame. |
sensorPlatformIDs
— Platform IDs of sensors
array of nonnegative integers
Platform IDs of sensors, returned as an array of nonnegative integers.
emissions
— Emissions
cell array of emission objects
Emissions, returned as a cell array of emission objects such as radarEmission
objects.
emitterConfigs
— Emitter configurations
array of structures
Emitter configurations, returned as an array of structures. Each structure has these 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 frame. |
emitterPlatformIDs
— Platform IDs of emitters
array of nonnegative integers
Platform IDs of emitters, returned as an array of nonnegative integers.
Version History
Introduced in R2021a
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 (한국어)