main content

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 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.

an animation of a road built by creating road centers

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.

a two-lane road with a dashed white lane marking in the center

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.

a blue car on the road but not aligned with the direction of the road

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.

the car with a trajectory that follows the right lane of the road

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.

the v (m/s) values for the six waypoints specified in the table

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

a driving scenario containing a moving car, two parked cars, and a pedestrian

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.

a car on the sensor canvas with a lidar on its roof center

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.

the scenario displays with the sensor canvas on the left and the bird's-eye plot on the right.

export the sensor data to the matlab workspace. click export > export sensor data, enter a workspace variable name, and click ok.

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})

a driving scenario of a car on a straight road

sensor view of vehicle. the vehicle contains two sensors mounted to the center of the rear axle. the radar sensor in red points forward and the camera sensor in blue points backward.

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.

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

on the left, the scenario view of cars crossing at an intersection. on the right, a bird's-eye view of the scenario that displays detections and sensor coverage areas.

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.

generated model containing a scenario reader block and a vision detection generator block

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.

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.

divided highway scene with traffic cones for completing a double lane change maneuver

specify a vehicle and its trajectory.

car driving to avoid traffic cone to complete the double lane change maneuver

update the dimensions of the vehicle to match the dimensions of the predefined vehicle types in the 3d simulation environment.

  1. on the actors tab, select the 3d display type option you want.

  2. 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.

on left, double lane change maneuver in driving scenario designer. on right, double lane change maneuver in 3d display.

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

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.

parameterdescription
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: 6

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: 1

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 1.

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 1.

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 1.

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.

parameterdescription
number of lanes

number of lanes in the road, specified as one of these values:

  • integer, m, in the range [1, 30] — creates an m-lane road whose default lane markings indicate that the road is one-way.

  • two-element vector, [m n], where m and n are positive integers whose sum must be in the range [2, 30] — creates a road with (m n) lanes. the default lane markings of this road indicate that it is two-way. the first m lanes travel in one direction. the next n lanes travel in the opposite direction.

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:

  • decimal scalar in the range (0, 50] — the same width applies to all lanes.

  • n-element vector of decimal values in the range (0, 50] — a different width applies to each lane, where n is the total number of lanes specified in the number of lanes parameter.

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 typeslanes 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:

  • 'driving' — lanes for driving.

  • 'border' — lanes at the road borders.

  • 'restricted' — lanes reserved for high occupancy vehicles.

  • 'shoulder' — lanes reserved for emergency stopping.

  • 'parking'— lanes alongside driving lanes, intended for parking vehicles.

default: 'driving'

lane types > color

color of lane, specified as an rgb triplet with default values as:

typecolor (default values)
'driving'[0.8 0.8 0.8]
'border'[0.72 0.72 0.72]
'restricted'[0.59 0.56 0.62]
'shoulder'[0.59 00.59 0.59]
'parking'[0.28 0.28 0.28]

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

  • a value of 0 specifies that the lane color is fully unsaturated, resulting in a gray colored lane.

  • a value of 1 specifies that the lane color is fully saturated, resulting in a true colored lane.

default: 1

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: 2

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: [0.5 0.5]

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:

  • unmarked — no lane marking

  • solid — solid line

  • dashed — dashed line

  • doublesolid — two solid lines

  • doubledashed — two dashed lines

  • soliddashed — solid line on left, dashed line on right

  • dashedsolid — dashed line on left, solid line on right

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

  • a value of 0 specifies that the lane marking color is fully unsaturated, resulting in a gray colored lane marking.

  • a value of 1 specifies that the lane marking color is fully saturated, resulting in a true colored lane marking.

for a lane marker specifying a double line, the same strength is used for both lines.

default: 1

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: 0.15

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: 3

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: 9

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.

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.

parameterdescription
shape

taper shape of the road segment, specified as either linear or none.

default: none

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 241 meters or 75 percent of length of the road segment containing the taper.

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 75 percent of the length of the corresponding road segment.

dependencies

to enable this parameter, set the shape parameter to linear.

position

edge of the road segment from which to add or drop lanes, specified as one of these values:

  • right — add or drop lanes from the right edge of the road segment.

  • left — add or drop lanes from the left edge of the road segment.

  • both — add or drop lanes from both edges of the road segment.

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: right

dependencies

to enable this parameter, specify different integer scalars for the number of lanes parameters of different road segments.

use these parameters to specify the orientation of the road.

parameterdescription
bank angle (deg)

side-to-side incline of the road, in degrees, specified as one of these values:

  • decimal scalar — applies a uniform bank angle along the entire length of the road

  • n-element vector of decimal values — applies a different bank angle to each road center, where n is the number of road centers in the selected road

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: 0

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 .

parameterdescription
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.

  • the z-axis specifies the elevation of the road. if the elevation between road centers is too abrupt, adjust these elevation values.

  • when you add an actor to a road, you do not have to change the actor position to match changes in elevation. the actor automatically follows the elevation of the road.

  • when two elevated roads form a junction, the elevation around that junction can vary widely. the exact amount of elevation depends on how close the road centers of each road are to each other. if you try to place an actor at the junction, the app might be unable to compute the precise elevation of the actor. in this case, the app cannot place the actor at that junction.

    to address this issue, in the scenario canvas, modify the intersecting roads by moving the road centers of each road away from each other. alternatively, manually adjust the elevation of the actor to match the elevation of the road surface.

default: 0

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

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.

parameterdescription
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.

  • the z-axis specifies the elevation of the intersection.

  • when you try to place an actor at the intersection formed by elevated roads, the app might be unable to compute the precise elevation of the actor. manually adjust the elevation of the actor to match the elevation of the intersection surface.

dependencies

to enable this parameter, select the intersection from the scenario canvas. the app enables this parameter for these cases only:

  • you load a scenario that contains an intersection defined using the function.

  • you import a here hd live map road network containing an intersection.

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.

parameterdescription
color

to change the color of an actor, next to the actor selection list, click the color patch for that actor.

blue color patch selected for actor with name

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 axes objects. for more details, see the property for axes objects.

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 car or truck, can be set as the ego vehicle. the ego vehicle must also have a 3d display type parameter value other than cuboid.

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 car and truck. similarly, you can change the class of nonvehicle actors only to other nonvehicle classes. the default nonvehicle classes are pedestrian, bicycle, jersey barrier, and guardrail.

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.

class idactor class
1car
2truck
3bicycle
4pedestrian
5jersey barrier
6guardrail

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.

actor class3d display type options
car
  • sedan (default for car class)

  • muscle car

  • suv

  • small pickup truck

  • hatchback

  • box truck (default for truck class)

  • cuboid (default for custom vehicle classes)

truck

custom vehicle class

to create a custom vehicle class:

  1. on the app toolstrip, select add actor > new actor class.

  2. in the class editor window, select the vehicle parameter.

  3. set other class properties as needed and click ok.

bicycle
  • bicyclist (default for bicycle class)

  • male pedestrian (default for pedestrian class)

  • female pedestrian

  • barrier (default for jersey barrier class)

  • cuboid (default for guardrail class and custom nonvehicle classes)

pedestrian
jersey barrier
guardrail

custom nonvehicle class

to create a custom nonvehicle class:

  1. on the app toolstrip, select add actor > new actor class.

  2. in the class editor window, clear the vehicle parameter.

  3. set other class properties as needed and click ok.

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 barrier or cuboid. the dimensions of these actors change in both displays.

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.

use these parameters to specify properties such as the position and orientation of an actor.

parameterdescription
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: 0.9

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: 1

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: 0

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: 0

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: 0

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.

parameterdescription
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: [-180 180]

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: [-90 90]

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:

  • q is the number of elevation angles specified by the elevation angles (deg) parameter.

  • p is the number of azimuth angles specified by the azimuth angles (deg) parameter.

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 .

parameterdescription
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:

  • x (m) — world coordinate x-position of each waypoint in meters.

  • y (m) — world coordinate y-position of each waypoint in meters.

  • z (m) — world coordinate z-position of each waypoint in meters.

  • v (m/s) — actor speed, in meters per second, at each waypoint. by default, the app sets the v (m/s) of newly added waypoints to the constant speed (m/s) parameter value. to specify a reverse motion between trajectories, set v (m/s) to a negative value. positive speeds (forward motions) and negative speeds (reverse motions) must be separated by a waypoint with a speed of 0.

  • wait (s) — wait time for an actor, in seconds, at each waypoint. when you set the wait time to a positive value, the corresponding velocity value v (m/s) resets to 0. you cannot set wait times at consecutive waypoints along the trajectory of an actor to positive values.

  • yaw (°) — yaw orientation angle of an actor, in degrees, at each waypoint. yaw angles are counterclockwise-positive when looking at the scenario from the top down. by default, the app computes the yaw automatically based on the specified trajectory. to constrain the trajectory so that the vehicle has specific orientations at certain waypoints, set the desired yaw (°) values at those waypoints. to restore a yaw back to its default value, right-click the waypoint and select restore default yaw.

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:

  • increase the distance between waypoints.

  • reduce the speed between waypoints.

  • increase the maximum jerk by using the jerk (m/s3) parameter.

the app computes smooth trajectories by using the function.

default: off

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

parameterdescription
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: off

entry time (s)

entry time at which an actor spawns into the scenario during simulation, specified as one of these values:

  • positive scalar — spawn an actor only once.

  • vector of positive values — spawn an actor multiple times.

the default value for entry time is 0. units are in seconds.

exit time (s)

exit time at which an actor despawns from the scenario during simulation, specified as one of these values:

  • positive scalar — despawn an actor only once.

  • vector of positive values — despawn an actor multiple times.

the default value for exit time is inf. units are in seconds.

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.

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.

parameterdescription
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.

namename of barrier
bank angle (°)

side-to-side incline of the barrier, in degrees, specified as one of these values:

  • decimal scalar — applies a uniform bank angle along the entire length of the barrier

  • n-element vector of decimal values — applies a different bank angle to each barrier segment, where n is the number of barrier centers in the selected barrier

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: 0

barrier type

barrier type, specified as one of the following options:

  • jersey barrier

  • guardrail

use these parameters to specify physical properties of the barrier.

parameterdescription
width (m)

width of the barrier, in meters, specified as a decimal scalar in the range (0,20] .

default:

  • jersey barrier: 0.61

  • guardrail: 0.433

height (m)

height of the barrier, in meters, specified as a decimal scalar in the range (0,20] .

default:

  • jersey barrier: 0.81

  • guardrail: 0.75

segment length (m)

length of each barrier segment, in meters, specified as a decimal scalar in the range (0,100].

default: 5

segment gap (m)

gap between consecutive barrier segments, in meters, specified as a decimal scalar in the range [0,segment length].

default: 0

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.

parameterdescription
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: [-180 180]

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: [-90 90]

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:

  • q is the number of elevation angles specified by the elevation angles (deg) parameter.

  • p is the number of azimuth angles specified by the azimuth angles (deg) parameter.

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.

parameterdescription
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: 0

to access these parameters, add at least one camera sensor to the scenario by following these steps:

  1. on the app toolstrip, click add camera.

  2. from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.

parameterdescription
enabledenable 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.
namename 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 100 is an integer multiple of the default sample time (ms) parameter value of 10. when the update interval is a multiple of the sample time, it ensures that the app samples and generates the data found at each update interval during simulation.

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: 100

typetype of sensor, specified as radar, vision, lidar, ins, or ultrasonic.

use these parameters to set the position and orientation of the selected camera sensor.

parameterdescription
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.

use these parameters to set the intrinsic parameters of the camera sensor.

parameterdescription
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: 640

image height

vertical camera resolution, in pixels, specified as a positive integer.

default: 480

principal point x

horizontal image center, in pixels, specified as a positive decimal scalar.

default: 320

principal point y

vertical image center, in pixels, specified as a positive decimal scalar.

default: 240

to view all camera detection parameters in the app, expand the sensor limits, lane settings, and accuracy & noise settings sections.

parameterdescription
detection type

type of detections reported by camera, specified as one of these values:

  • objects — report object detections only.

  • objects & lanes — report object and lane boundary detections.

  • lanes — report lane boundary detections only.

default: objects

detection probability

probability that the camera detects an object, specified as a decimal scalar in the range (0, 1].

default: 0.9

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: 0.1

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 objects or objects & lanes.

default: off | 50 (when on)

detection coordinates

coordinate system of output detection locations, specified as one of these values:

  • ego cartesian — the app outputs detections in the coordinate system of the ego vehicle.

  • sensor cartesian — the app outputs detections in the coordinate system of the sensor.

default: ego cartesian

sensor limits

parameterdescription
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: 100

max range (m)

farthest distance at which the camera can detect objects, in meters, specified as a positive decimal scalar.

default: 150

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: 0.5

min object image width

minimum horizontal size of objects that the camera can detect, in pixels, specified as positive decimal scalar.

default: 15

min object image height

minimum vertical size of objects that the camera can detect, in pixels, specified as positive decimal scalar.

default: 15

lane settings

parameterdescription
lane update interval (ms)

frequency at which the sensor updates lane detections, in milliseconds, specified as a decimal scalar.

default: 100

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 lanes or objects & lanes.

default: 3

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 lanes or objects & lanes.

default: 20

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 lanes or objects & lanes.

default: 3

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 lanes or objects & lanes.

default: off | 30 (when on)

accuracy & noise settings

parameterdescription
bounding box accuracy

positional noise used for fitting bounding boxes to targets, in pixels, specified as a positive decimal scalar.

default: 5

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: 5

has noise

select this parameter to enable adding noise to sensor measurements.

default: off

to access these parameters, add at least one radar sensor to the scenario.

  1. on the app toolstrip, click add radar.

  2. on the sensors tab, select the sensor from the list. the parameter values change based on the sensor you select.

parameterdescription
enabledenable 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.
namename 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 100 is an integer multiple of the default sample time (ms) parameter value of 10. when the update interval is a multiple of the sample time, it ensures that the app samples and generates the data found at each update interval during simulation.

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: 100

typetype of sensor, specified as radar, vision, lidar, ins, or ultrasonic.

use these parameters to set the position and orientation of the selected radar sensor.

parameterdescription
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.

to view all radar detection parameters in the app, expand the advanced parameters and accuracy & noise settings sections.

parameterdescription
detection probability

probability that the radar detects an object, specified as a decimal scalar in the range (0, 1].

default: 0.9

false alarm rate

probability of a false detection per resolution rate, specified as a decimal scalar in the range [1e-07, 1e-03].

default: 1e-06

field of view azimuth

horizontal field of view of radar, in degrees, specified as a positive decimal scalar.

default: 20

field of view elevation

vertical field of view of radar, in degrees, specified as a positive decimal scalar.

default: 5

max range (m)

farthest distance at which the radar can detect objects, in meters, specified as a positive decimal scalar.

default: 150

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): -100

default (max): 100

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: off

has occlusion

select this parameter to enable the radar to model occlusion.

default: on

advanced parameters

parameterdescription
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: 100

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: 0

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: off | 50 (when on)

detection coordinates

coordinate system of output detection locations, specified as one of these values:

  • body — the app outputs detections in the coordinate system of the ego vehicle body.

  • sensor rectangular — the app outputs detections in the coordinate system of the sensor.

  • sensor spherical — the app outputs detections in a spherical coordinate system. this coordinate system is centered at the radar and aligned with the orientation of the radar on the ego vehicle.

default: ego cartesian

accuracy & noise settings

parameterdescription
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: 4

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: 0.1

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: 5

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: 0.1

range resolution

minimum range separation at which the radar can distinguish between two targets, in meters, specified as a positive decimal scalar.

default: 2.5

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: 0.05

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: 0.5

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: 0.05

has noise

select this parameter to enable adding noise to sensor measurements.

default: on

has false alarms

select this parameter to enable false alarms in sensor detections.

default: on

to access these parameters, add at least one lidar sensor to the scenario.

  1. on the app toolstrip, click add lidar.

  2. 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.

an ego-centric view of the scenario

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.

parameterdescription
enabledenable 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.
namename 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 100 is an integer multiple of the default sample time (ms) parameter value of 10. when the update interval is a multiple of the sample time, it ensures that the app samples and generates the data found at each update interval during simulation.

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: 100

typetype of sensor, specified as radar, vision, lidar, ins, or ultrasonic.

use these parameters to set the position and orientation of the selected lidar sensor.

parameterdescription
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.

parameterdescription
detection coordinates

coordinate system of output detection locations, specified as one of these values:

  • ego cartesian — the app outputs detections in the coordinate system of the ego vehicle.

  • sensor cartesian — the app outputs detections in the coordinate system of the sensor.

default: ego cartesian

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: on

include ego vehicle in generated point cloud

select this parameter to include the ego vehicle in the generated point cloud.

default: on

include roads in generated point cloud

select this parameter to include roads in the generated point cloud.

default: off

sensor limits

parameterdescription
max range (m)

farthest distance at which the lidar can detect objects, in meters, specified as a positive decimal scalar.

default: 50

range accuracy (m)

accuracy of range measurements, in meters, specified as a positive decimal scalar.

default: 0.002

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: 1.6

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: 1.25

azimuthal limits (deg)

azimuthal limits of the lidar sensor, in degrees, specified as a two-element vector of decimal scalars of the form [min, max].

default: [-45 45]

elevation limits (deg)

elevation limits of the lidar sensor, in degrees, specified as a two-element vector of decimal scalars of the form [min, max].

default: [-20 20]

has noise

select this parameter to enable adding noise to sensor measurements.

default: off

to access these parameters, add at least one ins sensor to the scenario by following these steps:

  1. on the app toolstrip, click add ins.

  2. from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.

parameterdescription
enabledenable 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.
namename 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 100 is an integer multiple of the default sample time (ms) parameter value of 10. when the update interval is a multiple of the sample time, it ensures that the app samples and generates the data found at each update interval during simulation.

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: 100

typetype of sensor, specified as radar, vision, lidar, ins, or ultrasonic.

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.

parameterdescription
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.

for additional details about these parameters, see the object reference page.

parameterdescription
roll accuracy (°)

roll accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the roll measurement noise.

default: 0.2

pitch accuracy (°)

pitch accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the pitch measurement noise.

default: 0.2

yaw accuracy (°)

yaw accuracy, in degrees, specified as a nonnegative decimal scalar. this value sets the standard deviation of the yaw measurement noise.

default: 1

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: [1 1 1]

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: 0.05

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: 0

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: 0

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: on

position error factor

position error factor without gnss fix, specified as a nonnegative decimal scalar or 1-by-3 decimal vector.

default: [0 0 0]

random stream

source of random number stream, specified as one of these options:

  • global stream –– generate random numbers using the current global random number stream.

  • mt19937ar with seed –– generate random numbers using the mt19937ar algorithm, with the seed specified by the seed parameter.

default: global stream

seed

initial seed of the mt19937ar random number generator algorithm, specified as a nonnegative integer.

default: 67

to access these parameters, add at least one ultrasonic sensor to the scenario by following these steps:

  1. on the app toolstrip, click add ultrasonic.

  2. from the sensors tab, select the sensor from the list. the parameter values in this tab are based on the sensor you select.

parameterdescription
enabledenable 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.
namename 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 100 is an integer multiple of the default sample time (ms) parameter value of 10. when the update interval is a multiple of the sample time, it ensures that the app samples and generates the data found at each update interval during simulation.

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: 100

typetype of sensor, specified as radar, vision, lidar, ins, or ultrasonic.

use these parameters to set the position of the selected ultrasonic sensor.

parameterdescription
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.

for additional details about these parameters, see the object reference page.

parameterdescription
field of view azimuth

horizontal field of view of ultrasonic sensor, in degrees, specified as a positive decimal scalar.

default: 70

field of view elevation

vertical field of view of ultrasonic sensor, in degrees, specified as a positive decimal scalar.

default: 35

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: 5.5

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: 0.15

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: 0.03

to access these parameters, on the app toolstrip, click settings.

simulation settings

parameterdescription
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) = 100) and runs for 10 seconds, the amount of elapsed actual time might be less than the 10 seconds of elapsed simulation time. any apparent synchronization between the sample time and actual time is coincidental.

default: 10

stop condition

stop condition of simulation, specified as one of these values:

  • first actor stops — simulation stops when the first actor reaches the end of its trajectory.

  • last actor stops — simulation stops when the last actor reaches the end of its trajectory.

  • set time — simulation stops at the time specified by the stop time (s) parameter.

default: first actor stops

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 set time.

default: 0.1

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: off

programmatic use

drivingscenariodesigner opens the driving scenario designer app.

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) 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 — car

  • 2 — truck

  • 3 — bicycle

  • 4 — pedestrian

  • 5 — jersey barrier

  • 6 — 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 of 0, the app returns an error. in drivingscenario objects, a classid of 0 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 the drivingscenario 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 the classid 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 its classid value. alternatively, consider adding a new actor class to the app.

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 networkimported driving scenario

    two one-way roads gradually taper into one lane

    two single-lane roads, with no direction of travel indicated, abruptly transition into a two-lane road with bidirectional travel

  • 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.

part of a driving route surrounded by a selection rectangle. the rest of the route is outside the rectangle.

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 and road2.

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.

part of a driving route surrounded by a selection rectangle. the rest of the route is outside the rectangle.

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, and parking are supported. lanes with any other lane type information are imported as border lanes.

  • lane marking styles bott dots, curbs, and grass 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

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.

    three vehicles with a circle around the center vehicle, that is, the ego vehicle

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 r2018a

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

      网站地图