design driving scenarios, configure sensors, and generate synthetic data -凯发k8网页登录
design driving scenarios, configure sensors, and generate synthetic data
description
the driving scenario designer app enables you to design synthetic driving scenarios for testing your autonomous driving systems.
using the app, you can:
create road and actor models using a drag-and-drop interface.
configure vision, radar, lidar, ins, and ultrasonic sensors mounted on the ego vehicle. you can use these sensors to generate actor and lane boundary detections, point cloud data, and inertial measurements.
load driving scenarios representing european new car assessment programme (euro ncap®) test protocols [1][2][3] and other prebuilt scenarios.
import asam opendrive® roads and lanes into a driving scenario. the app supports opendrive® file versions 1.4 and 1.5, as well as asam opendrive file version 1.6.
import road data from openstreetmap®, here hd live map 1 , or zenrin japan map api 3.0 (itsumo navi api 3.0) 2 web services into a driving scenario.
importing data from the zenrin japan map api 3.0 (itsumo navi api 3.0) service requires .
export the road network in a driving scenario to the asam opendrive file format. the app supports opendrive file versions 1.4 and 1.5, as well as asam opendrive file version 1.6.
export road network, actors, and trajectories in a driving scenario to the asam openscenario® 1.0 file format.
export synthetic sensor detections to matlab®.
generate matlab code of the scenario and sensors, and then programmatically modify the scenario and import it back into the app for further simulation.
generate a simulink® model from the scenario and sensors, and use the generated models to test your sensor fusion or vehicle control algorithms.
to learn more about the app, see these videos:
open the driving scenario designer app
matlab toolstrip: on the apps tab, under automotive, click the app icon.
matlab command prompt: enter
drivingscenariodesigner
.
examples
create a driving scenario
create a driving scenario of a vehicle driving down a curved road, and export the road and vehicle models to the matlab workspace. for a more detailed example of creating a driving scenario, see .
open the driving scenario designer app.
drivingscenariodesigner
create a curved road. on the app toolstrip, click add road. click the bottom of the canvas, extend the road path to the middle of the canvas, and click the canvas again. extend the road path to the top of the canvas, and then double-click to create the road. to make the curve more complex, click and drag the road centers (open circles), double-click the road to add more road centers, or double-click an entry in the heading (°) column of the road centers table to specify a heading angle as a constraint to a road center point.
add lanes to the road. in the left pane, on the roads
tab, expand the lanes section. set number of
lanes to 2
. by default, the road is
one-way and has solid lane markings on either side to indicate the
shoulder.
add a vehicle at one end of the road. on the app toolstrip, select add actor > car. then click the road to set the initial position of the car.
set the driving trajectory of the car. right-click the car, select add forward waypoints, and add waypoints for the car to pass through. after you add the last waypoint, press enter. the car autorotates in the direction of the first waypoint.
adjust the speed of the car as it passes between waypoints. in the
waypoints, speeds, wait times, and yaw table in the
left pane, set the velocity, v (m/s), of the ego
vehicle as it enters each waypoint segment. increase the speed of the car
for the straight segments and decrease its speed for the curved segments.
for example, the trajectory has six waypoints, set the v
(m/s) cells to 30
, 20
,
15
, 15
, 20
, and
30
.
run the scenario, and adjust settings as needed. then click save > roads & actors to save the road and car models to a mat file.
generate sensor data from scenario
generate lidar point cloud data from a prebuilt euro ncap driving scenario.
for more details on prebuilt scenarios available from the app, see .
for more details on available euro ncap scenarios, see .
load a euro ncap autonomous emergency braking (aeb) scenario of a collision with a pedestrian child. at collision time, the point of impact occurs 50% of the way across the width of the car.
path = fullfile(matlabroot,'toolbox','shared','drivingscenario', ... 'prebuiltscenarios','euroncap'); addpath(genpath(path)) % add folder to path drivingscenariodesigner('aeb_pedestrianchild_nearside_50width.mat') rmpath(path) % remove folder from path
add a lidar sensor to the ego vehicle. first click add lidar. then, on the sensor canvas, click the predefined sensor location at the roof center of the car. the lidar sensor appears in black at the predefined location. the gray color that surrounds the car is the coverage area of the sensor.
run the scenario. inspect different aspects of the scenario by toggling between canvases and views. you can toggle between the sensor canvas and scenario canvas and between the bird's-eye plot and ego-centric view.
in the bird's-eye plot and ego-centric view, the actors are displayed as meshes instead of as cuboids. to change the display settings, use the display options on the app toolstrip.
export the sensor data to the matlab workspace. click export > export sensor data, enter a workspace variable name, and click ok.
import programmatic driving scenario and sensors
programmatically create a driving scenario, radar sensor, and camera sensor. then import the scenario and sensors into the app. for more details on working with programmatic driving scenarios and sensors, see .
create a simple driving scenario by using a object. in
this scenario, the ego vehicle travels straight on a 50-meter road segment
at a constant speed of 30 meters per second. for the ego vehicle, specify a
classid
property of 1
. this value
corresponds to the app class id of
1
, which refers to actors of class
car
. for more details on how the app defines classes, see
the class parameter description in the actors
parameter tab.
scenario = drivingscenario; roadcenters = [0 0 0; 50 0 0]; road(scenario,roadcenters); egovehicle = vehicle(scenario,'classid',1,'position',[5 0 0]); waypoints = [5 0 0; 45 0 0]; speed = 30; smoothtrajectory(egovehicle,waypoints,speed)
create a radar sensor by using a object, and create a camera sensor by using a object. place both sensors at the vehicle origin, with the radar facing forward and the camera facing backward.
radar = drivingradardatagenerator('mountinglocation',[0 0 0]); camera = visiondetectiongenerator('sensorlocation',[0 0],'yaw',-180);
import the scenario, front-facing radar sensor, and rear-facing camera sensor into the app.
drivingscenariodesigner(scenario,{radar,camera})
you can then run the scenario and modify the scenario and sensors. to
generate new drivingscenario
,
drivingradardatagenerator
, and
visiondetectiongenerator
objects, on the app toolstrip,
select export > export matlab function, and then run the generated function.
generate simulink model of scenario and sensor
load a driving scenario containing a sensor and generate a simulink model from the scenario and sensor. for a more detailed example on generating simulink models from the app, see .
load a prebuilt driving scenario into the app. the scenario contains two vehicles crossing through an intersection. the ego vehicle travels north and contains a camera sensor. this sensor is configured to detect both objects and lanes.
path = fullfile(matlabroot,'toolbox','shared','drivingscenario','prebuiltscenarios'); addpath(genpath(path)) % add folder to path drivingscenariodesigner('egovehiclegoesstraight_vehiclefromleftgoesstraight.mat') rmpath(path) % remove folder from path
generate a simulink model of the scenario and sensor. on the app toolstrip, select export > export simulink model. if you are prompted, save the scenario file.
the block reads the road and actors from the scenario file. to update the scenario data in the model, update the scenario in the app and save the file.
the block recreates the camera sensor defined in the app. to update the sensor in the model, update the sensor in the app, select export > export sensor simulink model, and copy the newly generated sensor block into the model. if you updated any roads or actors while updating the sensors, then select export > export simulink model. in this case, the scenario reader block accurately reads the actor profile data and passes it to the sensor.
specify vehicle trajectories for 3d simulation
create a scenario with vehicle trajectories that you can later recreate in simulink for simulation in a 3d environment.
open one of the prebuilt scenarios that recreates a default scene
available through the 3d environment. on the app toolstrip, select open > prebuilt scenario > simulation3d and select a scenario. for example, select the
doublelanechange.mat
scenario.
specify a vehicle and its trajectory.
update the dimensions of the vehicle to match the dimensions of the predefined vehicle types in the 3d simulation environment.
on the actors tab, select the 3d display type option you want.
on the app toolstrip, select 3d display > use 3d simulation actor dimensions. in the scenario canvas, the actor dimensions update to match the predefined dimensions of the actors in the 3d simulation environment.
preview how the scenario will look when you later recreate it in simulink. on the app toolstrip, select 3d display > view simulation in 3d display. after the 3d display window opens, click run.
modify the vehicle and trajectory as needed. avoid changing the road network or the actors that were predefined in the scenario. otherwise, the app scenario will not match the scenario that you later recreate in simulink. if you change the scenario, the 3d display window closes.
when you are done modifying the scenario, you can recreate it in a simulink model for use in the 3d simulation environment. for an example that shows how to set up such a model, see .
related examples
parameters
roads
— road width, bank angle, heading angle, lane specifications, and road center
locations
tab
to enable the roads parameters, add at least one road to the scenario. then, select a road from either the scenario canvas or the road parameter. the parameter values in the roads tab are based on the road you select.
parameter | description |
---|---|
road | road to modify, specified as a list of the roads in the scenario. |
name | name of the road. the name of an imported road depends on the map service. for example, when you generate a road using openstreetmap data, the app uses the name of the road when it is available. otherwise, the app uses the road id specified by the openstreetmap data. |
width (m) | width of the road, in meters, specified as a decimal scalar in the range (0, 50]. if the curvature of the road is too sharp to accommodate the specified road width, the app does not generate the road. default:
|
number of road segments | number of road segments, specified as a positive integer. use this parameter to enable composite lane specification by dividing the road into road segments. each road segment represents a part of the road with a distinct lane specification. lane specifications differ from one road segment to another. for more information on composite lane specifications, see . default: |
segment range | normalized range for each road segment, specified
as a row vector of values in the range (0, 1). the
length of the vector must be equal to the
number of road segments
parameter value. the sum of the vector must be equal to
by default, the range of each road segment is the inverse of the number of road segments. dependencies to enable this
parameter, specify a number of road
segments parameter value greater than
|
road segment | select a road segment from the list to specify its lanes parameters. dependencies to enable this
parameter, specify a number of road
segments parameter value greater than
|
lanes
— lane specifications, such as lane types and lane markings
tab section
use these parameters to specify lane information, such as lane
types and lane markings. when the value of the number
of road segments parameter is greater than
1
, these parameters apply to the selected
road segment.
parameter | description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
number of lanes | number of lanes in the road, specified as one of these values:
if you increase the number of lanes, the added lanes are of the width specified in the lane width (m) parameter. if lane width (m) is a vector of differing lane widths, then the added lanes are of the width specified in the last vector element. | ||||||||||||
lane width (m) | width of each lane in the road, in meters, specified as one of these values:
the width of each lane must be greater than the width of the lane markings it contains. these lane markings are specified by the marking > width (m) parameter. | ||||||||||||
lane types | lanes in the road, specified as a list of the lane types in the selected road. to modify one or more lane parameters that include lane type, color, and strength, select the desired lane from the drop-down list. | ||||||||||||
lane types > type | type of lane, specified as one of these values:
default:
| ||||||||||||
lane types > color | color of lane, specified as an rgb triplet with default values as:
alternatively, you can also specify some common colors as an rgb triplet, hexadecimal color code, color name, or short color name. for more information, see color specifications for lanes and markings. | ||||||||||||
lane types > strength | saturation strength of lane color, specified as a decimal scalar in the range [0, 1].
default:
| ||||||||||||
lane markings | lane markings, specified as a list of the lane markings in the selected road. to modify one or more lane marking parameters which include marking type, color, and strength, select the desired lane marking from the drop-down list. a road with n lanes has (n 1) lane markings. | ||||||||||||
lane markings > specify multiple marker types along a lane | select this parameter to define composite lane markings. a composite lane marking comprises multiple marker types along a lane. the portion of the lane marking that contains each marker type is referred as a marker segment. for more information on composite lane markings, see . | ||||||||||||
lane markings > number of marker segments | number of marker segments in a composite lane marking, specified as an integer greater than or equal to 2. a composite lane marking must have at least two marker segments. the app supports a maximum of 10 marker segments for every 1 meter of road length. for example, when you specify composite lane marking for a 10-meter road segment, the number of marker segments must be less than or equal to 100. default:
dependencies to enable this parameter, select the specify multiple marker types along a lane parameter. | ||||||||||||
lane markings > segment range | normalized range for each marker segment in a composite lane marking, specified as a row vector of values in the range [0, 1]. the length of the vector must be equal to the number of marker segments parameter value. default: dependencies to enable this parameter, select the specify multiple marker types along a lane parameter. | ||||||||||||
lane markings > marker segment | marker segments, specified as a list of marker types in the selected lane marking. to modify one or more marker segment parameters that include marking type, color, and strength, select the desired marker segment from the drop-down list. dependencies to enable this parameter, select the specify multiple marker types along a lane parameter. | ||||||||||||
lane markings > type | type of lane marking, specified as one of these values:
by default, for a one-way road, the leftmost lane marking is a solid yellow line, the rightmost lane marking is a solid white line, and the markings for the inner lanes are dashed white lines. for two-way roads, the default outermost lane markings are both solid white lines and the dividing lane marking is two solid yellow lines. if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. | ||||||||||||
lane markings > color | color of lane marking, specified as an rgb triplet, hexadecimal color code, color name, or short color name. for a lane marker specifying a double line, the same color is used for both lines. you can also specify some common colors as an rgb triplet, hexadecimal color code, color name, or short color name. for more information, see color specifications for lanes and markings. if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. | ||||||||||||
lane markings > strength | saturation strength of lane marking color, specified as a decimal scalar in the range [0, 1].
for a lane marker specifying a double line, the same strength is used for both lines. default:
if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. | ||||||||||||
lane markings > width (m) | width of lane marking, in meters, specified as a positive decimal scalar. the width of the lane marking must be less than the width of its enclosing lane. the enclosing lane is the lane directly to the left of the lane marking. for a lane marker specifying a double line, the same width is used for both lines. default:
if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. | ||||||||||||
lane markings > length (m) | length of dashes in dashed lane markings, in meters, specified as a decimal scalar in the range (0, 50]. for a lane marker specifying a double line, the same length is used for both lines. default:
if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. | ||||||||||||
lane markings > space (m) | length of spaces between dashes in dashed lane markings, in meters, specified as a decimal scalar in the range (0, 150]. for a lane marker specifying a double line, the same space is used for both lines. default:
if you enable the specify multiple marker types along a lane parameter, then this value is applied to the selected marker segment in a composite lane marking. |
segment taper
— specifications of taper between two road segments
tab section
to enable the segment taper parameters,
specify a number of road segments parameter
value greater than 1
, and specify a distinct
value for either the number of lanes or
lane width (m) parameter of at least
one road segment. then, select a taper from the drop-down list
to specify taper parameters.
a road with n road segments has (n – 1) segment tapers. the lth taper, where l < n, is part of the lth road segment.
parameter | description |
---|---|
shape | taper shape of the road segment,
specified as either default:
|
length (m) | taper length of the road segment, specified as a positive scalar. units are in meters. the default taper length is
the smaller of the
specified taper length must be less than the
length of the corresponding road segment.
otherwise, the app resets it to a value that is
dependencies to
enable this parameter, set the
shape parameter to
|
position | edge of the road segment from which to add or drop lanes, specified as one of these values:
you can specify the value of this parameter for connecting two one-way road segments. when connecting two-way road segments to each other, or one-way road segments to two-way road segments, the app determines the value of this parameter based on the specified number of lanes parameter. to add or drop lanes from both edges of a one-way road segment, the number of lanes in the one-way road segments must differ by an even number. default:
dependencies to enable this parameter, specify different integer scalars for the number of lanes parameters of different road segments. |
road centers
— road center locations
tab section
use these parameters to specify the orientation of the road.
parameter | description |
---|---|
bank angle (deg) | side-to-side incline of the road, in degrees, specified as one of these values:
when you add an actor to a road, you do not have to change the actor position to match the bank angles specified by this parameter. the actor automatically follows the bank angles of the road. default:
|
each row of the road centers table contains the x-, y-, and z-positions, as well as the heading angle, of a road center within the selected road. all roads must have at least two unique road center positions. when you update a cell within the table, the scenario canvas updates to reflect the new road center position. the orientation of the road depends on the values of the road centers and the heading angles. the road centers specify the direction in which the road renders in the scenario canvas. for more information, see .
parameter | description |
---|---|
x (m) | x-axis position of the road center, in meters, specified as a decimal scalar. |
y (m) | y-axis position of the road center, in meters, specified as a decimal scalar. |
z (m) | z-axis position of the road center, in meters, specified as a decimal scalar.
default:
|
heading (°) | heading angle of the road about its x-axis at the road center, in degrees, specified as a decimal scalar. when you specify a heading angle, it acts as a constraint on that road center point and the app automatically determines the other heading angles. specifying heading angles enables finer control over the shape and orientation of the road in the scenario canvas. for more information, see . when you export the driving scenario to a matlab function and run that function, matlab wraps the heading angles of the road in the output scenario, to the range [–180, 180]. |
road group centers
— intersection center locations
tab section
each row of the road group centers table contains the x-, y-, and z-positions of a center within the selected intersection of an imported road network. these center location parameters are read-only parameters since intersections cannot be created interactively. use the function to add an intersection to the scenario programmatically.
parameter | description |
---|---|
x (m) | x-axis position of the intersection center, in meters, specified as a decimal scalar. |
y (m) | y-axis position of the intersection center, in meters, specified as a decimal scalar. |
z (m) | z-axis position of the road center, in meters, specified as a decimal scalar.
dependencies to enable this parameter, select the intersection from the scenario canvas. the app enables this parameter for these cases only:
|
actors
— actor positions, orientations, rcs patterns, and trajectories
tab
to enable the actors parameters, add at least one actor to the scenario. then, select an actor from either the scenario canvas or from the list on the actors tab. the parameter values in the actors tab are based on the actor you select. if you select multiple actors, then many of these parameters are disabled.
parameter | description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
color | to change the color of an actor, next to the actor selection list, click the color patch for that actor. then, use the color picker to select one of the standard colors commonly used in matlab graphics. alternatively, select a custom color from the custom colors tab by first clicking in the upper-right corner of the color dialog box. you can then select custom colors from a gradient or specify a color using an rgb triplet, hexadecimal color code, or hsv triplet. by default, the app sets each newly
created actor to a new color. this color order is based
on the default color order of to set a single default color for all newly created actors of a specific class, on the app toolstrip, select add actor > edit actor classes. then, select set default color and click the corresponding color patch to set the color. to select a default color for a class, the scenario canvas must contain no actors of that class. color changes made in the app are carried forward into visualizations. | ||||||||||||||
set as ego vehicle | set the selected actor as the ego vehicle in the scenario. when you add sensors to your scenario, the app adds them to the ego vehicle. in addition, the ego-centric view and bird's-eye plot windows display simulations from the perspective of the ego vehicle. only actors who have vehicle
classes, such as for more details on actor classes, see the class parameter description. | ||||||||||||||
name | name of actor. | ||||||||||||||
class | class of actor, specified as the list of classes to which you can change the selected actor. you
can change the class of vehicle actors only to other
vehicle classes. the default vehicle classes are
the list of vehicle and nonvehicle classes appear in the app toolstrip, in the add actor > vehicles and add actor > other or add actor > barriers sections, respectively. actors created in the app have default sets of dimensions, radar cross-section patterns, and other properties based on their class id value. the table shows the default class id values and actor classes.
to modify actor classes or create new actor classes, on the app toolstrip, select add actor > edit actor classes or add actor > new actor class, respectively. | ||||||||||||||
3d display type | display type of actor as it appears in the 3d display window, specified as the list of display types to which you can change the selected actor. to display the scenario in the 3d display window during simulation, on the app toolstrip, click 3d display > view simulation in 3d display. the app renders this display by using the unreal engine® from epic games®. for any actor, the available 3d display type options depend on the actor class specified in the class parameter.
if you change the dimensions of an
actor using the actor properties
parameters, the app applies these changes in the
scenario canvas display but not
in the 3d display. this case does not apply to actors
whose 3d display type is set to
in the 3d display, actors of all other display types have predefined dimensions. to use the same dimensions in both displays, you can apply the predefined 3d display dimensions to the actors in the scenario canvas display. on the app toolstrip, under 3d display, select use 3d simulation actor dimensions. |
actor properties
— actor properties, including position and orientation
tab section
use these parameters to specify properties such as the position and orientation of an actor.
parameter | description |
---|---|
length (m) | length of actor, in meters, specified as a decimal scalar in the range (0, 60]. for vehicles, the length must be greater than (front overhang rear overhang). |
width (m) | width of actor, in meters, specified as a decimal scalar in the range (0, 20]. |
height (m) | height of actor, in meters, specified as a decimal scalar in the range (0, 20]. |
front overhang | distance between the front axle and front bumper, in meters, specified as a decimal scalar. the front overhang must be less than (length (m) – rear overhang). this parameter applies to vehicles only. default:
|
rear overhang | distance between the rear axle and rear bumper, in meters, specified as a decimal scalar. the rear overhang must be less than (length (m) – front overhang). this parameter applies to vehicles only. default:
|
roll (°) | orientation angle of the actor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the actor. when you export the matlab function of the driving scenario and run that function, the roll angles of actors in the output scenario are wrapped to the range [–180, 180]. default:
|
pitch (°) | orientation angle of the actor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the actor. when you export the matlab function of the driving scenario and run that function, the pitch angles of actors in the output scenario are wrapped to the range [–180, 180]. default:
|
yaw (°) | orientation angle of the actor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. however, the scenario canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing actors on this canvas, yaw (°) is counterclockwise-positive. when you export the matlab function of the driving scenario and run that function, the yaw angles of actors in the output scenario are wrapped to the range [–180, 180]. default:
|
radar cross section
— rcs of actor
tab section
use these parameters to manually specify the radar cross-section (rcs) of an actor. alternatively, to import an rcs from a file or from the matlab workspace, expand this parameter section and click import.
parameter | description |
---|---|
azimuth angles (deg) | horizontal reflection pattern of actor, in degrees, specified as a vector of monotonically increasing decimal values in the range [–180, 180]. default: |
elevation angles (deg) | vertical reflection pattern of actor, in degrees, specified as a vector of monotonically increasing decimal values in the range [–90, 90]. default: |
pattern (dbsm) | rcs pattern, in decibels per square meter, specified as a q-by-p table of decimal values. rcs is a function of the azimuth and elevation angles, where:
|
trajectory
— actor trajectories
tab section
use the waypoints, speeds, wait times, and yaw table to manually set or modify the positions, speeds, wait times, and yaw orientation angles of actors at their specified waypoints. when specifying trajectories, to switch between adding forward and reverse motion waypoints, use the add forward and reverse motion waypoint buttons .
parameter | description |
---|---|
constant speed (m/s) | default speed of actors as you add waypoints, specified as a positive decimal scalar in meters per second. if you set specific speed values in the v (m/s) column of the waypoints, speeds, wait times, and yaw table, then the app clears the constant speed (m/s) value. if you then specify a new constant speed (m/s) value, then the app sets all waypoints to the new constant speed value. the default speed of an actor varies by actor class. for example, cars and trucks have a default constant speed of 30 meters per second, whereas pedestrians have a default constant speed of 1.5 meters per second. |
waypoints, speeds, wait times, and yaw | actor waypoints, specified as a table. each row corresponds to a waypoint and contains the position, speed, and orientation of the actor at that waypoint. the table has these columns:
|
use smooth, jerk-limited trajectory | select this parameter to specify a smooth trajectory for the actor. smooth trajectories have no discontinuities in acceleration and are required for ins sensor simulation. if you mount an ins sensor to the ego vehicle, then the app updates the ego vehicle to use a smooth trajectory. if the app is unable to generate a smooth trajectory, try making these adjustments:
the app computes smooth trajectories by using the function. default:
|
jerk (m/s3) | maximum longitudinal jerk of the actor, in meters per second cubed, specified as a real-valued scalar greater than or equal to 0.1. |
actor spawn and despawn during simulation
parameter | description |
---|---|
actor spawn and despawn | select this parameter to spawn or despawn an actor in the driving scenario, while the simulation is running. to enable this parameter, you must first select an actor in the scenario by clicking on the actor. specify values for the entry time (s) and exit time (s) parameters to make the actor enter (spawn) and exit (despawn) the scenario, respectively. default:
|
entry time (s) | entry time at which an actor spawns into the scenario during simulation, specified as one of these values:
the default value for entry
time is |
exit time (s) | exit time at which an actor despawns from the scenario during simulation, specified as one of these values:
the default value for exit
time is |
to get expected spawning and despawning behavior, the entry time (s) and exit time (s) parameters must satisfy these conditions:
each value for the entry time (s) parameter must be less than the corresponding value for the exit time (s) parameter.
each value for the entry time (s) and the exit time (s) parameters must be less than the entire simulation time that is set by either the stop condition or the stop time.
when the entry time (s) and exit time (s) parameters are specified as vectors:
the elements of each vector must be in ascending order.
the lengths of both the vectors must be the same.
barriers
— barrier segment properties, barrier center locations, and rcs patterns
tab
to enable the barriers parameters, add at least one barrier to the scenario. then, select a barrier from either the scenario canvas or from the barriers tab. the parameter values in the barriers tab are based on the barrier you select.
parameter | description |
---|---|
color | to change the color of a barrier, next to the actor selection list, click the color patch for that barrier. then, use the color picker to select one of the standard colors commonly used in matlab graphics. alternatively, select a custom color from the custom colors tab by first clicking in the upper-right corner of the color dialog box. you can then select custom colors from a gradient or specify a color using an rgb triplet, hexadecimal color code, or hsv triplet. color changes made in the app are carried forward into visualizations. |
name | name of barrier |
bank angle (°) | side-to-side incline of the barrier, in degrees, specified as one of these values:
this property is valid only when you add a barrier using barrier centers. when you add a barrier to a road, the barrier automatically takes the bank angles of the road. default:
|
barrier type | barrier type, specified as one of the following options:
|
barrier properties
— barrier properties
tab section
use these parameters to specify physical properties of the barrier.
parameter | description |
---|---|
width (m) | width of the barrier, in meters, specified as a decimal scalar in the range (0,20] . default:
|
height (m) | height of the barrier, in meters, specified as a decimal scalar in the range (0,20] . default:
|
segment length (m) | length of each barrier segment, in meters, specified as a decimal scalar in the range (0,100]. default:
|
segment gap (m) | gap between consecutive barrier
segments, in meters, specified as a decimal scalar
in the range [0, default:
|
radar cross section
— rcs of barrier
tab section
use these parameters to manually specify the radar cross-section (rcs) of a barrier. alternatively, to import an rcs from a file or from the matlab workspace, expand this parameter section and click import.
parameter | description |
---|---|
azimuth angles (deg) | horizontal reflection pattern of barrier, in degrees, specified as a vector of monotonically increasing decimal values in the range [–180, 180]. default: |
elevation angles (deg) | vertical reflection pattern of barrier, in degrees, specified as a vector of monotonically increasing decimal values in the range [–90, 90]. default: |
pattern (dbsm) | rcs pattern, in decibels per square meter, specified as a q-by-p table of decimal values. rcs is a function of the azimuth and elevation angles, where:
|
barrier centers
— barrier center locations
tab section
each row of the barrier centers table contains the x-, y-, and z-positions of a barrier center within the selected barrier. all barriers must have at least two unique barrier center positions. when you update a cell within the table, the scenario canvas updates to reflect the new barrier center position. the orientation of the barrier depends on the values of the barrier centers. the barrier centers specifies the direction in which the barrier renders in the scenario canvas.
parameter | description |
---|---|
road edge offset (m) | distance by which the barrier is offset from the road edge in the lateral direction, in meters, specified as a decimal scalar. |
x (m) | x-axis position of the barrier center, in meters, specified as a decimal scalar. |
y (m) | y-axis position of the barrier center, in meters, specified as a decimal scalar. |
z (m) | z-axis position of the barrier center, in meters, specified as a decimal scalar. default:
|
sensors (camera)
— camera sensor placement, intrinsic camera parameters, and detection parameters
tab
to access these parameters, add at least one camera sensor to the scenario by following these steps:
on the app toolstrip, click add camera.
from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.
parameter | description |
---|---|
enabled | enable or disable the selected sensor. select this parameter to capture sensor data during simulation and visualize that data in the bird's-eye plot pane. |
name | name of sensor. |
update interval (ms) | frequency at which the sensor updates, in milliseconds, specified as an integer multiple of the app sample time defined under settings, in the sample time (ms) parameter. the
default update interval (ms) value of
if you update the app sample time such that a sensor is no longer a multiple of the app sample time, the app prompts you with the option to automatically update the update interval (ms) parameter to the closest integer multiple. default:
|
type | type of sensor, specified as radar, vision, lidar, ins, or ultrasonic. |
sensor placement
— camera position and orientation
tab section
use these parameters to set the position and orientation of the selected camera sensor.
parameter | description |
---|---|
x (m) | x-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the x-axis points forward from the vehicle. the origin is located at the center of the vehicle's rear axle. |
y (m) | y-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the y-axis points to the left of the vehicle. the origin is located at the center of the vehicle's rear axle. |
height (m) | height of the sensor above the ground, in meters, specified as a positive decimal scalar. |
roll (°) | orientation angle of the sensor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the sensor. |
pitch (°) | orientation angle of the sensor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the sensor. |
yaw (°) | orientation angle of the sensor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. the sensor canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing sensor coverage areas on this canvas, yaw (°) is counterclockwise-positive. |
camera settings
— intrinsic camera parameters
tab section
use these parameters to set the intrinsic parameters of the camera sensor.
parameter | description |
---|---|
focal length x | horizontal point at which the camera is in focus, in pixels, specified as a positive decimal scalar. the default focal length changes depending on where you place the sensor on the ego vehicle. |
focal length y | vertical point at which the camera is in focus, in pixels, specified as a positive decimal scalar. the default focal length changes depending on where you place the sensor on the ego vehicle. |
image width | horizontal camera resolution, in pixels, specified as a positive integer. default:
|
image height | vertical camera resolution, in pixels, specified as a positive integer. default:
|
principal point x | horizontal image center, in pixels, specified as a positive decimal scalar. default:
|
principal point y | vertical image center, in pixels, specified as a positive decimal scalar. default:
|
sensor parameters
— camera detection parameters
tab section
to view all camera detection parameters in the app, expand the sensor limits, lane settings, and accuracy & noise settings sections.
parameter | description |
---|---|
detection type | type of detections reported by camera, specified as one of these values:
default:
|
detection probability | probability that the camera detects an object, specified as a decimal scalar in the range (0, 1]. default:
|
false positives per image | number of false positives reported per update interval, specified as a nonnegative decimal scalar. this value must be less than or equal to the maximum number of detections specified in the limit # of detections parameter. default:
|
limit # of detections | select this parameter to limit the number of simultaneous object detections that the sensor reports. specify limit # of detections as a positive integer less than 263. to
enable this parameter, set the detection
type parameter to
default:
|
detection coordinates | coordinate system of output detection locations, specified as one of these values:
default: |
sensor limits
parameter | description |
---|---|
max speed (m/s) | fastest relative speed at which the camera can detect objects, in meters per second, specified as a nonnegative decimal scalar. default:
|
max range (m) | farthest distance at which the camera can detect objects, in meters, specified as a positive decimal scalar. default:
|
max allowed occlusion | maximum percentage of object that can be blocked while still being detected, specified as a decimal scalar in the range [0, 1). default:
|
min object image width | minimum horizontal size of objects that the camera can detect, in pixels, specified as positive decimal scalar. default:
|
min object image height | minimum vertical size of objects that the camera can detect, in pixels, specified as positive decimal scalar. default:
|
lane settings
parameter | description |
---|---|
lane update interval (ms) | frequency at which the sensor updates lane detections, in milliseconds, specified as a decimal scalar. default:
|
min lane image width | minimum horizontal size of objects that the sensor can detect, in pixels, specified as a decimal scalar. to enable this
parameter, set the detection
type parameter to
default:
|
min lane image height | minimum vertical size of objects that the sensor can detect, in pixels, specified as a decimal scalar. to enable this
parameter, set the detection
type parameter to
default:
|
boundary accuracy | accuracy with which the sensor places a lane boundary, in pixels, specified as a decimal scalar. to enable this parameter, set
the detection type parameter
to default:
|
limit # of lanes | select this parameter to limit the number of lane detections that the sensor reports. specify limit # of lanes as a positive integer. to enable this
parameter, set the detection
type parameter to
default:
|
accuracy & noise settings
parameter | description |
---|---|
bounding box accuracy | positional noise used for fitting bounding boxes to targets, in pixels, specified as a positive decimal scalar. default:
|
process noise intensity (m/s^2) | noise intensity used for smoothing position and velocity measurements, in meters per second squared, specified as a positive decimal scalar. default:
|
has noise | select this parameter to enable adding noise to sensor measurements. default:
|
sensors (radar)
— radar sensor placement and detection parameters
tab
to access these parameters, add at least one radar sensor to the scenario.
on the app toolstrip, click add radar.
on the sensors tab, select the sensor from the list. the parameter values change based on the sensor you select.
parameter | description |
---|---|
enabled | enable or disable the selected sensor. select this parameter to capture sensor data during simulation and visualize that data in the bird's-eye plot pane. |
name | name of sensor. |
update interval (ms) | frequency at which the sensor updates, in milliseconds, specified as an integer multiple of the app sample time defined under settings, in the sample time (ms) parameter. the
default update interval (ms) value of
if you update the app sample time such that a sensor is no longer a multiple of the app sample time, the app prompts you with the option to automatically update the update interval (ms) parameter to the closest integer multiple. default:
|
type | type of sensor, specified as radar, vision, lidar, ins, or ultrasonic. |
sensor placement
— radar position and orientation
tab section
use these parameters to set the position and orientation of the selected radar sensor.
parameter | description |
---|---|
x (m) | x-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the x-axis points forward from the vehicle. the origin is located at the center of the vehicle's rear axle. |
y (m) | y-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the y-axis points to the left of the vehicle. the origin is located at the center of the vehicle's rear axle. |
height (m) | height of the sensor above the ground, in meters, specified as a positive decimal scalar. |
roll (°) | orientation angle of the sensor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the sensor. |
pitch (°) | orientation angle of the sensor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the sensor. |
yaw (°) | orientation angle of the sensor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. the sensor canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing sensor coverage areas on this canvas, yaw (°) is counterclockwise-positive. |
sensor parameters
— radar detection parameters
tab section
to view all radar detection parameters in the app, expand the advanced parameters and accuracy & noise settings sections.
parameter | description |
---|---|
detection probability | probability that the radar detects an object, specified as a decimal scalar in the range (0, 1]. default:
|
false alarm rate | probability of a false detection per resolution rate, specified as a decimal scalar in the range [1e-07, 1e-03]. default:
|
field of view azimuth | horizontal field of view of radar, in degrees, specified as a positive decimal scalar. default:
|
field of view elevation | vertical field of view of radar, in degrees, specified as a positive decimal scalar. default:
|
max range (m) | farthest distance at which the radar can detect objects, in meters, specified as a positive decimal scalar. default:
|
range rate min, range rate max | select this parameter to set minimum and maximum range rate limits for the radar. specify range rate min and range rate max as decimal scalars, in meters per second, where range rate min is less than range rate max. default (min):
default (max):
|
has elevation | select this parameter to enable the radar to measure the elevation of objects. this parameter enables the elevation parameters in the accuracy & noise settings section. default:
|
has occlusion | select this parameter to enable the radar to model occlusion. default:
|
advanced parameters
parameter | description |
---|---|
reference range | reference range for a given probability of detection, in meters, specified as a positive decimal scalar. the reference range is the range at which the radar detects a target of the size specified by reference rcs, given the probability of detection specified by detection probability. default:
|
reference rcs | reference rcs for a given probability of detection, in decibels per square meter, specified as a nonnegative decimal scalar. the reference rcs is the target size at which the radar detects a target, given the reference range specified by reference range and the probability of detection specified by detection probability. default:
|
limit # of detections | select this parameter to limit the number of simultaneous detections that the sensor reports. specify limit # of detections as a positive integer less than 263. default:
|
detection coordinates | coordinate system of output detection locations, specified as one of these values:
default: |
accuracy & noise settings
parameter | description |
---|---|
azimuth resolution | minimum separation in azimuth angle at which the radar can distinguish between two targets, in degrees, specified as a positive decimal scalar. the azimuth resolution is typically the 3 db downpoint in the azimuth angle beamwidth of the radar. default:
|
azimuth bias fraction | maximum azimuth accuracy of the radar, specified as a nonnegative decimal scalar. the azimuth bias is expressed as a fraction of the azimuth resolution specified by the azimuth resolution parameter. units are dimensionless. default:
|
elevation resolution | minimum separation in elevation angle at which the radar can distinguish between two targets, in degrees, specified as a positive decimal scalar. the elevation resolution is typically the 3 db downpoint in the elevation angle beamwidth of the radar. to enable this parameter, in the sensor parameters section, select the has elevation parameter. default:
|
elevation bias fraction | maximum elevation accuracy of the radar, specified as a nonnegative decimal scalar. the elevation bias is expressed as a fraction of the elevation resolution specified by the elevation resolution parameter. units are dimensionless. to enable this parameter, under sensor parameters, select the has elevation parameter. default:
|
range resolution | minimum range separation at which the radar can distinguish between two targets, in meters, specified as a positive decimal scalar. default:
|
range bias fraction | maximum range accuracy of the radar, specified as a nonnegative decimal scalar. the range bias is expressed as a fraction of the range resolution specified in the range resolution parameter. units are dimensionless. default:
|
range rate resolution | minimum range rate separation at which the radar can distinguish between two targets, in meters per second, specified as a positive decimal scalar. to enable this parameter, in the sensor parameters section, select the range rate min, range rate max parameter and set the range rate values. default:
|
range rate bias fraction | maximum range rate accuracy of the radar, specified as a nonnegative decimal scalar. the range rate bias is expressed as a fraction of the range rate resolution specified in the range rate resolution parameter. units are dimensionless. to enable this parameter, in the sensor parameters section, select the range rate min, range rate max parameter and set the range rate values. default:
|
has noise | select this parameter to enable adding noise to sensor measurements. default:
|
has false alarms | select this parameter to enable false alarms in sensor detections. default:
|
sensors (lidar)
— lidar sensor placement, point cloud reporting, and detection parameters
tab
to access these parameters, add at least one lidar sensor to the scenario.
on the app toolstrip, click add lidar.
on the sensors tab, select the sensor from the list. the parameter values change based on the sensor you select.
when you add a lidar sensor to a scenario, the bird's-eye plot and ego-centric view display the mesh representations of actors. for example, here is a sample view of actor meshes on the ego-centric view.
the lidar sensors use these more detailed representations of actors to generate point cloud data. the scenario canvas still displays only the cuboid representations. the other sensors still base their detections on the cuboid representations.
to turn off actor meshes, use the properties under display on the app toolstrip. to modify the mesh display types of actors, select add actor > edit actor classes. in the class editor, modify the mesh display type parameter of that actor class.
parameter | description |
---|---|
enabled | enable or disable the selected sensor. select this parameter to capture sensor data during simulation and visualize that data in the bird's-eye plot pane. |
name | name of sensor. |
update interval (ms) | frequency at which the sensor updates, in milliseconds, specified as an integer multiple of the app sample time defined under settings, in the sample time (ms) parameter. the
default update interval (ms) value of
if you update the app sample time such that a sensor is no longer a multiple of the app sample time, the app prompts you with the option to automatically update the update interval (ms) parameter to the closest integer multiple. default:
|
type | type of sensor, specified as radar, vision, lidar, ins, or ultrasonic. |
sensor placement
— lidar position and orientation
tab section
use these parameters to set the position and orientation of the selected lidar sensor.
parameter | description |
---|---|
x (m) | x-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the x-axis points forward from the vehicle. the origin is located at the center of the vehicle's rear axle. |
y (m) | y-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the y-axis points to the left of the vehicle. the origin is located at the center of the vehicle's rear axle. |
height (m) | height of the sensor above the ground, in meters, specified as a positive decimal scalar. |
roll (°) | orientation angle of the sensor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the sensor. |
pitch (°) | orientation angle of the sensor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the sensor. |
yaw (°) | orientation angle of the sensor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. the sensor canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing sensor coverage areas on this canvas, yaw (°) is counterclockwise-positive. |
point cloud reporting
— point cloud reporting parameters
tab section
parameter | description |
---|---|
detection coordinates | coordinate system of output detection locations, specified as one of these values:
default: |
output organized point cloud locations | select this parameter to output the generated sensor data as an organized point cloud. if you clear this parameter, the output is unorganized. default:
|
include ego vehicle in generated point cloud | select this parameter to include the ego vehicle in the generated point cloud. default:
|
include roads in generated point cloud | select this parameter to include roads in the generated point cloud. default:
|
sensor parameters
— lidar detection parameters
tab section
sensor limits
parameter | description |
---|---|
max range (m) | farthest distance at which the lidar can detect objects, in meters, specified as a positive decimal scalar. default:
|
range accuracy (m) | accuracy of range measurements, in meters, specified as a positive decimal scalar. default:
|
azimuth | azimuthal resolution of the lidar sensor, in degrees, specified as a positive decimal scalar. the azimuthal resolution defines the minimum separation in azimuth angle at which the lidar can distinguish two targets. default:
|
elevation | elevation resolution of the lidar sensor, in degrees, specified as a positive decimal scalar. the elevation resolution defines the minimum separation in elevation angle at which the lidar can distinguish two targets. default:
|
azimuthal limits (deg) | azimuthal limits of the lidar sensor,
in degrees, specified as a two-element vector of
decimal scalars of the form default: |
elevation limits (deg) | elevation limits of the lidar sensor,
in degrees, specified as a two-element vector of
decimal scalars of the form default: |
has noise | select this parameter to enable adding noise to sensor measurements. default:
|
sensors (ins)
— ins sensor placement, measurement parameters
tab
to access these parameters, add at least one ins sensor to the scenario by following these steps:
on the app toolstrip, click add ins.
from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.
parameter | description |
---|---|
enabled | enable or disable the selected sensor. select this parameter to capture sensor data during simulation and visualize that data in the bird's-eye plot pane. |
name | name of sensor. |
update interval (ms) | frequency at which the sensor updates, in milliseconds, specified as an integer multiple of the app sample time defined under settings, in the sample time (ms) parameter. the
default update interval (ms) value of
if you update the app sample time such that a sensor is no longer a multiple of the app sample time, the app prompts you with the option to automatically update the update interval (ms) parameter to the closest integer multiple. default:
|
type | type of sensor, specified as radar, vision, lidar, ins, or ultrasonic. |
sensor placement
— ins position
tab section
use these parameters to set the position of the selected ins sensor. the orientation of the sensor is assumed to be aligned with the ego vehicle origin, so the roll (°), pitch (°), and yaw (°) properties are disabled for this sensor.
parameter | description |
---|---|
x (m) | x-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the x-axis points forward from the vehicle. the origin is located at the center of the vehicle's rear axle. |
y (m) | y-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the y-axis points to the left of the vehicle. the origin is located at the center of the vehicle's rear axle. |
height (m) | height of the sensor above the ground, in meters, specified as a positive decimal scalar. |
roll (°) | orientation angle of the sensor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the sensor. |
pitch (°) | orientation angle of the sensor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the sensor. |
yaw (°) | orientation angle of the sensor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. the sensor canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing sensor coverage areas on this canvas, yaw (°) is counterclockwise-positive. |
sensor parameters
— ins measurement parameters
tab section
for additional details about these parameters, see the object reference page.
parameter | description |
---|---|
roll accuracy (°) | roll accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the roll measurement noise. default:
|
pitch accuracy (°) | pitch accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the pitch measurement noise. default:
|
yaw accuracy (°) | yaw accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the yaw measurement noise. default:
|
position accuracy (m) | accuracy of x-, y-, and z-position measurements, in meters, specified as a decimal scalar or three-element decimal scalar. this value sets the standard deviation of the position measurement noise. specify a scalar to set the accuracy of all three positions to this value. default: |
velocity accuracy (m/s) | accuracy of velocity measurements, in meters per second, specified as a decimal scalar. this value sets the standard deviation of the velocity measurement noise. default:
|
acceleration accuracy | accuracy of acceleration measurements, in meters per second squared, specified as a decimal scalar. this value sets the standard deviation of the acceleration measurement noise. default:
|
angular velocity accuracy | accuracy of angular velocity measurements, in degrees per second, specified as a decimal scalar. this value sets the standard deviation of the angular velocity measurement noise. default:
|
has gnss fix | enable global navigation satellite system (gnss) receiver fix. if you clear this parameter, then position measurements drift at a rate specified by the position error factor parameter. default:
|
position error factor | position error factor without gnss fix, specified as a nonnegative decimal scalar or 1-by-3 decimal vector. default: |
random stream | source of random number stream, specified as one of these options:
default: |
seed | initial seed of the mt19937ar random number generator algorithm, specified as a nonnegative integer. default:
|
sensors (ultrasonic)
— ultrasonic sensor placement, measurement parameters
tab
to access these parameters, add at least one ultrasonic sensor to the scenario by following these steps:
on the app toolstrip, click add ultrasonic.
from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.
parameter | description |
---|---|
enabled | enable or disable the selected sensor. select this parameter to capture sensor data during simulation and visualize that data in the bird's-eye plot pane. |
name | name of sensor. |
update interval (ms) | frequency at which the sensor updates, in milliseconds, specified as an integer multiple of the app sample time defined under settings, in the sample time (ms) parameter. the
default update interval (ms) value of
if you update the app sample time such that a sensor is no longer a multiple of the app sample time, the app prompts you with the option to automatically update the update interval (ms) parameter to the closest integer multiple. default:
|
type | type of sensor, specified as radar, vision, lidar, ins, or ultrasonic. |
sensor placement
— ultrasonic position
tab section
use these parameters to set the position of the selected ultrasonic sensor.
parameter | description |
---|---|
x (m) | x-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the x-axis points forward from the vehicle. the origin is located at the center of the vehicle's rear axle. |
y (m) | y-axis position of the sensor in the vehicle coordinate system, in meters, specified as a decimal scalar. the y-axis points to the left of the vehicle. the origin is located at the center of the vehicle's rear axle. |
height (m) | height of the sensor above the ground, in meters, specified as a positive decimal scalar. |
roll (°) | orientation angle of the sensor about its x-axis, in degrees, specified as a decimal scalar. roll (°) is clockwise-positive when looking in the forward direction of the x-axis, which points forward from the sensor. |
pitch (°) | orientation angle of the sensor about its y-axis, in degrees, specified as a decimal scalar. pitch (°) is clockwise-positive when looking in the forward direction of the y-axis, which points to the left of the sensor. |
yaw (°) | orientation angle of the sensor about its z-axis, in degrees, specified as a decimal scalar. yaw (°) is clockwise-positive when looking in the forward direction of the z-axis, which points up from the ground. the sensor canvas has a bird's-eye-view perspective that looks in the reverse direction of the z-axis. therefore, when viewing sensor coverage areas on this canvas, yaw (°) is counterclockwise-positive. |
sensor parameters
— ultrasonic measurement parameters
tab section
for additional details about these parameters, see the object reference page.
parameter | description |
---|---|
field of view azimuth | horizontal field of view of ultrasonic sensor, in degrees, specified as a positive decimal scalar. default:
|
field of view elevation | vertical field of view of ultrasonic sensor, in degrees, specified as a positive decimal scalar. default:
|
max range (m) | farthest distance at which the ultrasonic sensor can detect objects and report distance values, in meters, specified as a positive decimal scalar. default:
|
min range (m) | nearest distance at which the ultrasonic sensor can detect objects and report distance values, in meters, specified as a positive decimal scalar. default:
|
min detection-only range (m) | nearest distance at which the ultrasonic sensor can only detect objects but not report distance values, in meters, specified as a positive decimal scalar. default:
|
settings
— simulation sample time, stop condition, and stop time
dialog box
to access these parameters, on the app toolstrip, click settings.
simulation settings
parameter | description |
---|---|
sample time (ms) | frequency at which the simulation updates, in milliseconds. increase the sample time to speed up simulation. this increase has no effect on actor speeds, even though actors can appear to go faster during simulation. the actor positions are just being sampled and displayed on the app at less frequent intervals, resulting in faster, choppier animations. decreasing the sample time results in smoother animations, but the actors appear to move slower, and the simulation takes longer. the sample time does not correlate
to the actual time. for example, if the app samples
every 0.1 seconds (sample time
(ms) = default:
|
stop condition | stop condition of simulation, specified as one of these values:
default: |
stop time (s) | stop time of simulation, in seconds, specified as a positive decimal scalar. to enable
this parameter, set the stop
condition parameter to default:
|
use rng seed | select this parameter to use a random number generator (rng) seed to reproduce the same results for each simulation. specify the rng seed as a nonnegative integer less than 232. default:
|
programmatic use
drivingscenariodesigner
drivingscenariodesigner
opens the driving scenario
designer app.
drivingscenariodesigner(scenariofilename)
drivingscenariodesigner(scenariofilename)
opens the app and
loads the specified scenario mat file into the app. this file must be a scenario
file saved from the app. this file can include all roads, actors, and sensors in the
scenario. it can also include only the roads and actors component, or only the
sensors component.
if the scenario file is not in the current folder or not in a folder on the matlab path, specify the full path name. for example:
drivingscenariodesigner('c:\desktop\mydrivingscenario.mat');
you can also load prebuilt scenario files. before loading a prebuilt scenario, add the folder containing the scenario to the matlab path. for an example, see generate sensor data from scenario.
drivingscenariodesigner(scenario)
drivingscenariodesigner(scenario)
loads the specified object into the app.
the classid
properties of actors in this object must correspond
to these default class id parameter values in the app:
1
— car2
— truck3
— bicycle4
— pedestrian5
— jersey barrier6
— guardrail
when you create actors in the app, the actors with these class id values have a default set of dimensions, radar cross-section patterns, and other properties. the camera and radar sensors process detections differently depending on type of actor specified by the class id values.
when importing drivingscenario
objects into the app, the behavior
of the app depends on the classid
of the actors in that
scenario.
if an actor has a
classid
of0
, the app returns an error. indrivingscenario
objects, aclassid
of0
is reserved for an object of an unknown or unassigned class. the app does not recognize or use this value. assign these actors one of the app class id values and import thedrivingscenario
object again.if an actor has a nonzero
classid
that does not correspond to a class id value, the app returns an error. either change theclassid
of the actor or add a new actor class to the app. on the app toolstrip, select add actor > new actor class.if an actor has properties that differ significantly from the properties of its corresponding class id actor, the app returns a warning. the
actorid
property referenced in the warning corresponds to the id value of an actor in the list at the top of the actors tab. the id value precedes the actor name. to address this warning, consider updating the actor properties or itsclassid
value. alternatively, consider adding a new actor class to the app.
drivingscenariodesigner(___,sensors)
drivingscenariodesigner(___,sensors)
loads the
specified sensors into the app, using any of the previous syntaxes. specify
sensors
as a , , or object, or as a cell array of such objects. if you specify
sensors
along with a scenario file that contains sensors,
the app does not import the sensors from the scenario file.
for an example of importing sensors, see import programmatic driving scenario and sensors.
limitations
clothoid import/export limitations
driving scenarios presently support only the clothoid interpolated roads. when you import roads created using other geometric interpolation methods, the generated road shapes might contain inaccuracies.
heading limitations to road group centers
when you load a
drivingscenario
object containing a road group of road segments with specified headings into the driving scenario designer app, the generated road network might contain inaccuracies. these inaccuracies occur because the app does not support heading angle information in the road group centers table.
parking lot limitations
the importing of parking lots created using the function is not supported. if you import a scenario containing a parking lot into the app, the app omits the parking lot from the scenario.
sensor import/export limitations
when you import a
drivingradardatagenerator
sensor that reports clustered detections or tracks into the app and then export the sensor to matlab or simulink, the exported sensor object or block reports unclustered detections. this change in reporting format occurs because the app supports the generation of unclustered detections only.
openstreetmap — import limitations
when importing openstreetmap data, road and lane features have these limitations:
lane-level information is not imported from openstreetmap roads. lane specifications are based only on the direction of travel specified in the openstreetmap road network, where:
one-way roads are imported as single-lane roads with default lane specifications. these lanes are programmatically equivalent to
(1)
.two-way roads are imported as two-lane roads with bidirectional travel and default lane specifications. these lanes are programmatically equivalent to
([1 1])
.
the table shows these differences in the openstreetmap road network and the road network in the imported driving scenario.
openstreetmap road network imported driving scenario when importing openstreetmap road networks that specify elevation data, if elevation data is not specified for all roads being imported, then the generated road network might contain inaccuracies and some roads might overlap.
openstreetmap files containing large road networks can take a long time to load. in addition, these road networks can make some of the app options unusable. to avoid this limitation, import files that contain only an area of interest, typically smaller than 20 square kilometers.
the basemap used in the app can have slight differences from the map used in the openstreetmap service. some imported road issues might also be due to missing or inaccurate map data in the openstreetmap service. to check whether the data is missing or inaccurate due to the map service, consider viewing the map data on an external map viewer.
here hd live map — import limitations
importing here hdlm roads with lanes of varying widths is not supported. in the generated road network, each lane is set to have the maximum width found along its entire length. consider a here hdlm lane with a width that varies from 2 to 4 meters along its length. in the generated road network, the lane width is 4 meters along its entire length. this modification to road networks can sometimes cause roads to overlap in the driving scenario.
the basemap used in the app might have slight differences from the map used in the here hdlm service.
some issues with the imported roads might be due to missing or inaccurate map data in the here hdlm service. for example, you might see black lines where roads and junctions meet. to check where the issue stems from in the map data, use the here hd live map viewer to view the geometry of the here hdlm road network. this viewer requires a valid here license. for more details, see the website.
here hd live map — route selection limitations
when selecting here hd live map roads to import from a region of interest, the maximum allowable size of the region is 20 square kilometers. if you specify a driving route that is greater than 20 square kilometers, the app draws a region that is optimized to fit as much of the beginning of the route as possible into the display. this figure shows an example of a region drawn around the start of a route that exceeds this maximum size.
zenrin japan map api 3.0 (itsumo navi api 3.0) — import limitations
when you import zenrin japan map api 3.0 (itsumo navi api 3.0) data, the generated road network has these limitations. as a result of these limitations, the generated network might contain inaccuracies and the roads might overlap.
the generated road network uses road elevation data when the zenrin japan map api 3.0 (itsumo navi api 3.0) provides it. otherwise, the generated network uses terrain elevation data provided by the service.
when the zenrin japan map api 3.0 (itsumo navi api 3.0) service provides information using a range, such as by specifying a road with two to three lanes or a road between 3–5.5 meters wide, the generated road network uses scalar values instead. consider a zenrin japan map api 3.0 (itsumo navi api 3.0) road that has two to three lanes. the generated road network has two lanes.
lanes within roads in the generated network have a uniform width. consider a road that is 4.25 meters wide with two lanes. in the generated road network, each lane is 2.125 meters wide.
where possible, the generated road network uses road names provided by the zenrin japan map api 3.0 (itsumo navi api 3.0) service. otherwise, the generated road network uses default names, such as
road1
androad2
.
zenrin japan map api 3.0 (itsumo navi api 3.0) — route selection limitations
when selecting zenrin japan map api 3.0 (itsumo navi api 3.0) roads to import from a region of interest, the maximum allowable size of the region is 500 square meters. if you specify a driving route that is greater than 500 square meters, the app draws a region that is optimized to fit as much of the beginning of the route as possible into the display. this figure shows an example of a region drawn around the start of a route that exceeds this maximum size.
asam opendrive import limitations
you can import only lanes, lane type information, and roads. the import of road objects and traffic signals is not supported.
asam opendrive files containing large road networks can take up to several minutes to load. in addition, these road networks can cause slow interactions on the app canvas. examples of large road networks include ones that model the roads of a city or ones with roads that are thousands of meters long.
lanes with variable widths are not supported. the width is set to the highest width found within that lane. for example, if a lane has a width that varies from 2 meters to 4 meters, the app sets the lane width to 4 meters throughout.
when you import one-way roads with multiple lane specifications, the app supports only those segment taper positions that match the travel direction of lane. for example, the app supports importing only right taper position for the right lanes. left or both types of taper position are not supported for right lanes.
roads with lane type information specified as
driving
,border
,restricted
,shoulder
, andparking
are supported. lanes with any other lane type information are imported as border lanes.lane marking styles
bott dots
,curbs
, andgrass
are not supported. lanes with these marking styles are imported as unmarked.
asam opendrive export limitations
the cubic polynomial and the parametric cubic polynomial geometry types in the scenario are exported as spiral geometry types. this causes some variations in the exported road geometry if the road is a curved road.
when segments of adjacent roads overlap with each other, the app does not export the overlapping segments of the roads.
when a road with multiple lane specifications contains a taper between two road segments, the app exports the road without taper.
when a road consisting of multiple segments is connected to a junction, the app does not export the road.
the junctions of the road network are processed without lane connection information, so the junction shapes may not be accurate in the exported scenario.
the app does not export any actor that is present either on a junction or on a road with multiple road segments.
when a junction is not connected to any road, the app does not export such junction.
euro ncap limitations
scenarios of speed assistance systems (sas) are not supported. these scenarios require the detection of speed limits from traffic signs, which the app does not support.
3d display limitations
these limitations describe how 3d display visualizations differ from the cuboid visualizations that appear on the scenario canvas.
roads do not form junctions with unmarked lanes at intersections. the roads and their lane markings overlap.
not all actor or lane marking colors are supported. the 3d display matches the selected color to the closest available color that it can render.
lane type colors of nondriving lanes are not supported. if you select a nondriving lane type, in the 3d display, the lane displays as a driving lane.
on the actors tab, specified roll (°) and pitch (°) parameter values of an actor are ignored. in the waypoints table, z (m) values (that is, elevation values) are also ignored. during simulation, actors follow the elevation and banking angle of the road surface.
multiple marking styles along a lane are not supported. the 3d display applies the first lane marking style of the first lane segment along the entire length of the lane.
actors with a 3d display type of
cuboid
do not move in the 3d display. during simulation, these actors remain stationary at their initial specified positions.
more about
actor and vehicle positions and dimensions
in driving scenarios, an actor is a cuboid (box-shaped) object with a specific length, width, and height. actors also have a radar cross-section (rcs) pattern, specified in dbsm, which you can refine by setting angular azimuth and elevation coordinates. the position of an actor is defined as the center of its bottom face. this center point is used as the actor's rotational center, its point of contact with the ground, and its origin in its local coordinate system. in this coordinate system:
the x-axis points forward from the actor.
the y-axis points left from the actor.
the z-axis points up from the ground.
roll, pitch, and yaw are clockwise-positive when looking in the forward direction of the x-, y-, and z-axes, respectively.
a vehicle is an actor that moves on wheels. vehicles have three extra properties that govern the placement of their front and rear axle.
wheelbase — distance between the front and rear axles
front overhang — distance between the front of the vehicle and the front axle
rear overhang — distance between the rear axle and the rear of the vehicle
unlike other types of actors, the position of a vehicle is defined by the point on the ground that is below the center of its rear axle. this point corresponds to the natural center of rotation of the vehicle. as with nonvehicle actors, this point is the origin in the local coordinate system of the vehicle, where:
the x-axis points forward from the vehicle.
the y-axis points left from the vehicle.
the z-axis points up from the ground.
roll, pitch, and yaw are clockwise-positive when looking in the forward direction of the x-, y-, and z-axes, respectively.
the origin (that is, the position) of cuboid vehicles differs from the origin of vehicles in the 3d simulation environment. in the 3d simulation environment, vehicle origins are on the ground, at the geometric center of the vehicle.
cuboid vehicle origin | 3d simulation vehicle origin |
---|---|
for nonvehicle actors, the origins are identical and located at the bottom of the geometric center of the actors.
in simulink, to convert a vehicle from the cuboid origin to the 3d simulation origin, use a block. for more details about 3d simulation coordinates, see .
color specifications for lanes and markings
this table lists the named color options, the equivalent rgb triplets, and hexadecimal color codes that you can use for specifying the color of lanes and markings in a road.
color name | short name | rgb triplet | hexadecimal color code | appearance |
---|---|---|---|---|
red | r | [1 0 0] | #ff0000 |
|
green | g | [0 1 0] | #00ff00 |
|
blue | b | [0 0 1] | #0000ff |
|
cyan
| c | [0 1 1] | #00ffff |
|
magenta | m | [1 0 1] | #ff00ff |
|
yellow | y | [0.98 0.86 0.36] | #fadb5c |
|
black | k | [0 0 0] | #000000 |
|
white | w | [1 1 1] | #ffffff |
|
draw direction of road and numbering of lanes
to create a road by using the function, specify the road centers as a matrix input. the function creates a directed line that traverses the road centers, starting from the coordinates in the first row of the matrix and ending at the coordinates in the last row of the matrix. the coordinates in the first two rows of the matrix specify the draw direction of the road. these coordinates correspond to the first two consecutive road centers. the draw direction is the direction in which the roads render in the scenario plot.
to create a road by using the driving scenario designer app, you can either specify the road centers parameter or interactively draw on the scenario canvas. for a detailed example, see create a driving scenario. in this case, the draw direction is the direction in which roads render in the scenario canvas.
for a road with a top-to-bottom draw direction, the difference between the x-coordinates of the first two consecutive road centers is positive.
for a road with a bottom-to-top draw direction, the difference between the x-coordinates of the first two consecutive road centers is negative.
|
|
for a road with a left-to-right draw direction, the difference between the y-coordinates of the first two consecutive road centers is positive.
for a road with a right-to-left draw direction, the difference between the y-coordinates of the first two consecutive road centers is negative.
|
|
lanes must be numbered from left to right, with the left edge of the road defined relative to the draw direction of the road. for a one-way road, by default, the left edge of the road is a solid yellow marking which indicates the end of the road in transverse direction (direction perpendicular to draw direction). for a two-way road, by default, both edges are marked with solid white lines.
for example, these diagrams show how the lanes are numbered in a one-way and two-way road with a draw direction from top-to-bottom.
numbering lanes in a one-way road | numbering lanes in a two-way road |
specify the number of lanes as a positive integer for a one-way road. if
you set the integer value as 1, 2, 3 denote the first, second, and third lanes of the road, respectively. | specify the number of lanes as a two-element vector of positive integer
for a two-way road. if you set the vector as [ 1l denote the only left lane of the road. 1r and 2r denote the first and second right lanes of the road, respectively. |
the lane specifications apply by the order in which the lanes are numbered.
composite lane marking
a composite lane marking comprises two or more marker segments that define multiple marking types along a lane. the geometric properties for a composite lane marking include the geometric properties of each marking type and the normalized lengths of the marker segments.
the order in which the specified marker segments occur in a composite lane
marking depends on the draw direction of the road. each marker segment is a directed
segment with a start point and moves towards the last road center. the first marker
segment starts from the first road center and moves towards the last road center for a
specified length. the second marker segment starts from the end point of the first
marker segment and moves towards the last road center for a specified length. the same
process applies for each marker segment that you specify for the composite lane marking.
you can set the normalized length for each of these marker segments by specifying the
range
input argument.
for example, consider a one-way road with two lanes. the second lane marking
from the left edge of the road is a composite lane marking with marking types
solid
and dashed
. the normalized range for
each marking type is 0.5. the first marker segment is a solid marking and the second
marker segment is a dashed marking. these diagrams show the order in which the marker
segments apply for left-to-right and right-to-left draw directions of the road.
|
|
for information on the geometric properties of lane markings, see .
composite lane specification
a composite lane specification consists of an array of two or more lane specifications for a single road. each lane specification defines a road segment, which is a section of the road with independent geometric properties, normalized range, and taper.
each road segment is a directed segment that moves toward the final road center, with the first segment beginning at the first road center, the second segment starting where the first ends, and so on. the range of each road segment is a normalized distance that specifies a proportion of the total length of the road. when a road segment adds or drops lanes from a previous segment, the preceding segment tapers along a specified distance to accommodate the change in number of lanes.
when you render a road with composite lane specifications, the road segments render in the draw direction of the road. for example, consider a one-way road with two road segments and a default normalized range of 0.5 for each road segment. the first road segment contains four lanes and the second segment contains only two lanes. the first segment tapers from four lanes to two lanes, dropping one lane from each side, as it approaches the halfway point of the road, which is the start point of the second segment. these diagrams show the direction in which the road segments render, and how the taper applies to the road, for both the left-to-right and right-to-left draw directions.
|
|
for information on the geometric properties of lanes, see .
tips
when importing map data, the map regions you specify and the number of roads you select have a direct effect on app performance. to improve performance, specify the smallest map regions and select the fewest roads that you need to create your driving scenario.
you can undo (press ctrl z) and redo (press ctrl y) changes you make on the scenario and sensor canvases. for example, you can use these shortcuts to delete a recently placed road center or redo the movement of a radar sensor. for more shortcuts, see
in scenarios that contain many actors, to keep track of the ego vehicle, you can add an indicator around the vehicle. on the app toolstrip, select display > show ego indicator. the circle around the ego vehicle highlights the location of the vehicle in the scenario. this circle is not a sensor coverage area.
references
[1] european new car assessment programme. euro ncap assessment protocol - sa. version 8.0.2. january 2018.
[2] european new car assessment programme. euro ncap aeb c2c test protocol. version 2.0.1. january 2018.
[3] european new car assessment programme. euro ncap lss test protocol. version 2.0.1. january 2018.
version history
introduced in r2018ar2018b: corrections to image width and image height camera parameters of driving scenario designer
starting in r2018b, in the camera settings group of the driving scenario designer app, the image width and image height parameters set their expected values. previously, image width set the height of images produced by the camera, and image height set the width of images produced by the camera.
if you are using r2018a, to produce the expected image sizes, transpose the values set in the image width and image height parameters.
see also
apps
blocks
- | | | |
objects
- | | | | |
topics
external websites
1 you need to enter into a separate agreement with in order to gain access to the hdlm services and to get the required credentials (access_key_id and access_key_secret) for using the here service.
2 to gain access to the zenrin japan map api 3.0 (itsumo navi api 3.0) service and get the required credentials (a client id and secret key), you must enter into a separate agreement with
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
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
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)