R2022b

New Features, Bug Fixes, Compatibility Considerations

Ground Truth Labeling

Labeler Enhancements: 3D line ROI labels for point clouds

This table describes enhancements for these labeling apps:

FeatureImage Labeler Video Labeler Ground Truth Labeler Lidar Labeler Medical Image Labeler
The cuboid2img function returns rectangular projected cuboids to create data compatible with the labeling apps.YesYesYesNoNo
Automate projected cuboid labeling with the temporal interpolator automation algorithm.NoYesYesNoNo

The boxLabelDatastore object, the gatherLabelData (Automated Driving Toolbox), and the objectDetectorTrainingData object, used in creating training data for object detection, now support 2-D projected cuboid labels.

YesYesYesNoNo
Visualize the color information of the point cloud using the updated colormap.NoNoNoYesNo
Add background color for the point cloud.NoNoYesYesNo
Visualize the XY, YZ, and ZX views of the point cloud.NoNoYesYesNo
Label 2-D and 3-D medical images for semantic segmentation.NoNoNoNoYes

 Functionality being removed or changed

Keyboard shortcuts to pan across a point cloud frame has changed

Behavior change

Starting from R2022b, use a, d, w, and s as keyboard shortcuts for Ground Truth Labeler and Lidar Labeler (Lidar Toolbox) apps to pan across a point cloud frame.

ActionKeyboard Shortcut
Pan forward or backward

w — Forward

s — Backward

Pan left or right

a — Left

d — Right

File I/O

ADTF File Reader Enhancements: Read new stream types, sample and chunk timestamps for streams

You can now use the adtfFileReader object to read adtf/substreams and adtf/plaintype stream types. Also, for every frame in a stream, you can now read a sample timestamp, and a chunk timestamp along with a flag indicating whether the read operation was successful. For data items, you can read a substream index for every frame. For an example of these enhancements, see Read Data From ADTF DAT Files.

Cuboid Scenario Simulation

Ultrasonic Detection Generator Block: Generate synthetic range measurements in driving scenarios in Simulink

Use the Ultrasonic Detection Generator block to simulate an ultrasonic sensor in Simulink® and generate range measurements.

You can now also export scenarios that contain ultrasonic sensors from the Driving Scenario Designer app to Simulink.

Bird's-Eye Scope Enhancements: Visualize ultrasonic sensor detections

In the Bird's-Eye Scope, you can now visualize sensor coverage area and detections obtained from the ultrasonic sensors modeled using the Ultrasonic Detection Generator block.

ASAM OpenDRIVE Import Enhancements: Import multiple lane specifications and road heading angle information

When you import ASAM OpenDRIVE® file into a driving scenario by using the roadNetwork function of the drivingScenario object, or by using the Driving Scenario Designer app, you can now import one-way roads with multiple lane specifications. Previously, multiple lane specifications for one-way roads were not imported, and the lane specifications of the first road segment were applied to the entire one-way road.

You can also import road heading angle information specified in an ASAM OpenDRIVE file when you import an ASAM OpenDRIVE file into a driving scenario. This heading angle information enables you to import roads with exact shapes as specified in the source file.

ASAM OpenDRIVE Export Enhancements: Export multiple lane specifications for a road with single-lane road segment

When you export a road network from driving scenario to an ASAM OpenDRIVE file by using the Driving Scenario Designer app or the export function of the drivingScenario object, you can now export multiple lane specifications for a road with single-lane road segment. Previously, multiple lane specifications were not exported for such a road, and the lane specifications of the first road segment were applied to the entire road.

Unreal Engine Scenario Simulation

Simulation 3D Ultrasonic Sensor Block: Generate synthetic range measurements in Unreal Engine scenarios

The Simulation 3D Ultrasonic Sensor block generates synthetic range measurements in a simulation environment rendered using the Unreal Engine® from Epic Games®. The block includes parameters for sensor mounting and field of view.

Simulation 3D Pedestrian Block: Model a pedestrian in Unreal Engine scenarios

The Simulation 3D Pedestrian block models a pedestrian that follows the ground terrain in a simulation environment rendered using the Unreal Engine from Epic Games.The block includes parameters to specify the scale, type, position and orientation of the pedestrian.

Simulation 3D Bicyclist Block: Model a bicyclist in Unreal Engine scenarios

The Simulation 3D Bicyclist block models a bicyclist that follows the ground terrain in a simulation environment rendered using the Unreal Engine from Epic Games.The block includes parameters to specify the scale, position and orientation of the bicyclist.

Simulation 3D Scene Configuration: Use new MATLAB API to download maps locally from the server

Starting in R2022b, you can use the sim3d.maps class and its object functions to download prebuilt Unreal Engine scenes and access them directly from the Simulation 3D Scene Configuration block.

Simulation 3D Scene Configuration Block: Specify ASAM OpenDRIVE file for lane detections

Select the Simulation 3D Scene Configuration block parameter Select ASAM OpenDRIVE file to specify an ASAM OpenDRIVE file. You will need an ASAM OpenDRIVE file if you want to perform any lane detection applications with custom scenes using the Simulation 3D Vision Detection Generator (Automated Driving Toolbox) block.

 Functionality being removed or changed

Updated scenes

Behavior change

Starting from R2022b, these scenes in the Unreal Engine 3D environment are rendered using RoadRunner. As a result, the locations of scene objects, including cones and parked vehicles, are moved from their pre-R2022b locations.

RoadRunner Scenario Simulation

High-Definition Maps: Import map data into RoadRunner using MATLAB functions

Using the roadrunnerHDMap object and its associated functions, you can convert high-definition (HD) map data into a RoadRunner HD Map road data model and import your data into RoadRunner. Using these functions, you can:

  • Create a new map, edit an existing map, and read and write from file

  • Represent lanes, lane boundaries, lane markings, junctions, barriers, and signs

  • Write the map to a RoadRunner HD Map (.rrhd) file.

The functions require a RoadRunner license. For more details, see Programmatic Scene and Scenario Management.

getAction Function Enhancements: Retrieve longitudinal distance action of actor

You can now use the getAction function to return the longitudinal distance action of an actor with respect to a reference actor. The longitudinal distance between two actors is measured either as a space distance or a time distance.

getAttribute Function Enhancements: Retrieve child or parent actors from actor group

You can now use the getAttribute function of an ActorSimulation object to retrieve the immediate child or parent actor of the specified actor.

  • children = getAttribute(actorSim, 'Children') returns the immediate child actors of the specified ActorSimulation object. The child actors are returned in the form of an array of ActorSimulation objects. If the input actor does not have any child actors, then an empty array is returned.

  • parent = getAttribute(actorSim, 'Parent') returns the immediate parent actor of the specified ActorSimulation object. The parent actor is returned in the form of an ActorSimulation object.

You can use these functions within a MATLAB® System object™ to program the behavior of an actor group. For an example of modeling actor group behavior in MATLAB, see Path Following Actor Group Behavior.

RoadRunner Scenario Writer Block: Update all child actors of actor group in RoadRunner Scenario from Simulink

You can now use a RoadRunner Scenario Writer block to update multiple RoadRunner Scenario actors during the same time step in the following ways.

  • By programming one RoadRunner Scenario Writer block to write several messages to a scenario, where each message updates a topic for an actor of a different ActorID.

  • By using more than one RoadRunner Scenario Writer block to write messages to a scenario, where each block handles updates for an actor of a different ActorID.

This capability allows you to control the behavior of each child actor in an actor group. In this way, you can control the behavior of an actor group as a whole from one Simulink behavior model.

User-Defined Actions: Read and process user-defined actions from RoadRunner Scenario using MATLAB functions

You can use a MATLAB actor model to handle user-defined actions from RoadRunner Scenario. These MATLAB functions enable you to write and retrieve user-defined action parameters back to a scenario.

  • uda = getAction(actorSim, 'UserDefinedAction', 'actionName') returns information about the specified user-defined action for the ActorSimulation actor object actorSim, for example, the action name, action ID, and parameters. For more information, see getAction.

  • sendEvent(actorSim, 'ActionComplete', 'actionID') sends a message to a scenario indicating that the action with identifier ActionID is complete. The RoadRunner Scenario simulation can now proceed to the next action phase. For more information, see sendEvent.

For an example of a MATLAB actor model using user-defined actions, see Model Vehicle Behavior Using User-Defined Actions in MATLAB (RoadRunner Scenario).

User-Defined Actions: Read and process user-defined actions from RoadRunner Scenario using Simulink behavior model

You can create a Simulink behavior model to handle user-defined actions from RoadRunner Scenario.

To get started, you must first convert a user-defined action to a Simulink.Bus object using the Type Editor (Simulink). Then, export the Simulink.Bus object to a MAT file and load it into the MATLAB workspace. For more information, see Author RoadRunner Actor Behavior Using User-Defined Actions in Simulink.

These Simulink blocks enable you to retrieve and return user-defined action parameters back to a scenario.

  • RoadRunner Scenario — Associates Action name as entered in RoadRunner Scenario with the name of the MAT file (Bus object name).

  • RoadRunner Scenario Reader — Reads Action name from a simulation at run-time.

  • RoadRunner Scenario Writer — Conveys completion of a user-defined action to a simulation by publishing an Action Complete event.

You can perform required calculations on actor parameters by using standard blocks from the Simulink block library.

For an example of a Simulink actor behavior model using user-defined actions, see Model Vehicle Behavior Using User-Defined Actions in Simulink (RoadRunner Scenario).

Simulink Logging for User-Defined Actions

The ScenarioLog object is extended to log user-defined actions.

Timeout value: Set timeout value for connection between MATLAB and RoadRunner Scenario

Starting in R2022b, you can change the timeout value for the connection between MATLAB and RoadRunner Scenario by using the settings function.

In the previous release, this timeout value was fixed at 300 seconds.

Use the settings function to change the value of the RoadRunner application’s Timeout setting. The unit of measurement for the timeout value is seconds. For example:

s = settings; 
s.roadrunner.application.Timeout.TemporaryValue = 10;

In this case, the temporary value is cleared at the end of the current MATLAB session. For more information, see settings.

The actual timeout value is then the greater of the specified value and the default timeout value for each event type. For more information, see Timeout Values (RoadRunner Scenario).

Application Examples: Simulate autonomous emergency braking and highway lane following applications with RoadRunner Scenario

The Autonomous Emergency Braking with RoadRunner Scenario example shows how to simulate an autonomous emergency braking (AEB) system, designed in Simulink, with RoadRunner Scenario. The example demonstrates how to use vision and radar detection sensors and generate speed variations for both the vehicle under test and the global vehicle target. You can use these processes to test the AEB system per the European New Car Assessment Programme (Euro NCAP) test protocols.

The Highway Lane Following with RoadRunner Scenario example shows how to cosimulate a highway lane-following application, designed in Simulink, with RoadRunner Scenario and Unreal Engine. The highway lane-following application uses an Unreal Engine simulation environment to model detections from camera and radar sensors. The highway lane-following application has controller, sensor fusion, and vision processing components that enable the ego vehicle to follow lanes and avoid collision with other vehicles.

Scenario Generation and Variation

Scenario Builder: Scenario Builder for Automated Driving Toolbox support package

The Scenario Builder for Automated Driving Toolbox™ support package offers functions to create virtual driving scenarios from the vehicle data recorded using various sensors.

For an overview of the Scenario Builder for Automated Driving Toolbox support package capabilities, see Overview of Scenario Generation from Recorded Sensor Data.

You can process GPS data, lane detections, and actor track list to extract road, lane, and actor information by using these functions.

getMapROI

Compute geographic bounding box coordinates from GPS data.

roadprops

Extract road properties from road network file or map data.

selectActorRoads

Extract properties of roads in path of actor.

updateLaneSpec

Update lane specifications using sensor detections.

actorprops

Generate actor properties from track list.

You can create virtual driving scenarios from vehicle data recorded using various sensors, such as a global positioning system (GPS), inertial measurement unit (IMU), camera, or lidar sensor. To create virtual driving scenarios, you can use raw sensor data as well as processed actor track lists or lane detections.

To get started creating virtual scene using sensor data, see these examples:

To get started creating virtual scenario using sensor data, see these examples:

To use these functions and examples, you must download the Scenario Builder for Automated Driving Toolbox from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

Variant Generator: Scenario Variant Generator for Automated Driving Toolbox support package

The Scenario Variant Generator for Automated Driving Toolbox support package offers functions to automatically generate multiple scenarios by varying the parameters of a seed scenario.

For an overview of the Scenario Variant Generator for Automated Driving Toolbox support package capabilities, see Overview of Scenario Variant Generation.

You can extract properties from a seed scenario to use to generate scenario variants by using these functions.

getScenarioDescriptor

Extract properties from input scenario to generate scenario variants.

getScenario

Get scenario object from scenario descriptor object.

You can generate scenario variations to perform safety assessments of various automated driving applications. These applications include autonomous emergency braking (AEB), lane keep assist (LKA), and adaptive cruise control (ACC), which you can assess per European New Car Assessment Programme (Euro NCAP®) test protocols. To get started creating scenario variants for safety assessments, see these examples:

To use these functions and examples, you must download the Scenario Variant Generator for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

Detection and Tracking

Monocamera Parameter Estimation: Estimate monocular camera parameters using the road image and scene geometry

You can now use the estimateMonoCameraFromScene function to estimate the parameters of a monoCamera object from the road image input. You must also specify the scene geometry in the form of a trapezoid in both the pixel coordinates of the road image and the corresponding real-world rectangle dimensions.

3D Cuboid Computation: Compute 3D cuboids from 2D projected cuboids and camera parameters

Use the projectedCuboidTo3D function to compute 3D cuboids in vehicle coordinates, from the 2D projected cuboids in pixel coordinates, and the camera parameters. You can also specify how to align the 3D cuboid with the object by specifying which side of the cuboid aligns with the front of the object.

 Multi-Object Tracker Enhancements: Confirm tracks directly, and obtain position, velocity, and covariance from tracks using motion model name input

You can now directly confirm a track by using the confirmTrack object function of the multiObjectTracker System Objects™.

You can now use the getTrackPositions and getTrackVelocities functions to obtain the positions, velocities, and associated covariances of tracks by specifying the motion model name as an input. For example,

[positions,covariances] = getTrackPositions(tracks,"constvel")
returns the position and position covariances in tracks based on the constant velocity model defined by the constvel (Sensor Fusion and Tracking Toolbox) function.

Obtain position, velocity, and covariance from tracks using motion model name input

By using the getTrackPositions and getTrackVelocities functions, you can now obtain positions, velocities, and associated covariances of tracks by specifying the motion model name as an input. For example,

[positions,covariances] = getTrackPositions(tracks,"constvel")
returns positions and position covariances in tracks based on the constant-velocity model in the constvel function. Previously, you could use only the position selector or velocity selector input to obtain the position and velocity states. For example,
positionSelector = [1 0 0 0 0 0 0 0 0; 
                    0 0 0 1 0 0 0 0 0; 
                    0 0 0 0 0 0 1 0 0];
[positions,covariances] = getTrackPositions(tracks,positionSelector)

Applications

Truck Platooning Example: Design and simulate platooning application using V2V communication

The Truck Platooning Using Vehicle-to-Vehicle Communication example shows how to model vehicle-to-vehicle communication, a platooning controller, and tractor-trailer dynamics to design and simulate platooning of trucks in an Unreal Engine simulation environment.

PIL Testing Example: Automate processor-in-the-loop testing of forward vehicle sensor fusion algorithm

The Automate PIL Testing for Forward Vehicle Sensor Fusion example shows the workflow to generate embedded code from a forward vehicle sensor fusion algorithm and verify it using processor-in-the-loop (PIL) testing. The example also shows how to automate PIL testing of this algorithm on an NVIDIA® Jetson™ hardware board. The generated code of this algorithm requires less than 1 MB of memory during execution, which makes it suitable for testing on any hardware with at least 1 MB of RAM.

Scenario Variants of AEB System Example: Automate testing of AEB system using variants of Euro NCAP test scenario

The Automate Testing for Scenario Variants of AEB System example enables you to test an autonomous emergency braking (AEB) system by generating multiple variants of the European New Car Assessment Programme (Euro NCAP) Car-to-Pedestrian Nearside Child (CPNC) driving scenario. The example shows how to vary ego speed and collision point parameters to generate scenario variants. The example also shows how to perform scripted iterative testing, using Simulink Test™, to automate testing of generated scenario variants.