Main Content

RoadRunner Scenario Writer

Write selected topic to RoadRunner scenario

  • Library:
  • Automated Driving Toolbox / RoadRunner Scenario

  • RoadRunner Scenario Writer block

Description

The RoadRunner Scenario Writer block writes the selected topic to the RoadRunner scenario. You can set the Topic Category parameter to Actor, Event or Diagnostics. The data is input as Simulink® messages to the block. When you select the Actor topic, the block writes the data associated with the actor, such as Actor Pose and Actor Pose (Driving Scenario Compatible).

If you are using an actor group in RoadRunner Scenario, you can use the RoadRunner Scenario Writer block to control the behavior of individual child actors in the following ways.

  • Use one RoadRunner Scenario Writer block to send messages to different actors. For example, you can queue messages carrying results of different logic implementations within the model to the RoadRunner Scenario Writer block by using the Message Merge block. Each of these messages can carry a different value of ActorID.

  • Use multiple RoadRunner Scenario Writer blocks. You can point the ActorID value of the Actor Pose, Actor Pose (Driving Scenario compatible), or Vehicle Pose structure of each RoadRunner Scenario Writer block to a different child actor.

Ports

Input

expand all

State information to write to the scenario, specified as a Simulink message.

Parameters

expand all

Topic category, specified as one of these options:

  • Actor — Writes the actor data to the scenario

  • Event — Writes event data to the scenario

  • Diagnostics — Writes custom diagnostic messages to the scenario

This Diagnostics structure contains data about the diagnostic type and the message. The table describes the fields of the Diagnostics structure.

Field NameDescription
DiagnosticTypeType of diagnostic message specified as an Enum.
DiagnosticMessageDiagnostic message specified as a string.

Type of actor in scenario, specified as All Types or Vehicle. The Vehicle type includes additional wheel information of the actor.

Note

The All Types actor type also applies to pedestrians in a scenario.

Actor data, specified as one of these options:

  • Actor Pose — Dynamic data associated with the actor, such as pose, velocity, and angular velocity

  • Actor Pose (Driving Scenario compatible) — Dynamic data associated with the actor, such as actor ID, position, velocity, roll, pitch, yaw, and angular velocity

The table describes the input structure of the type BusActorRuntime when you set Topic Category to Actor, and Topic to ActorPose.

Field NameDescription
ActorIDScenario-defined actor identifier, specified as a uint64.
PosePosition and orientation of the actor specified as a 4-by-4 array.
VelocityActor velocity, in meters per second, in the x-, y-and z- directions, specified as a 1-by-3 vector.
AngularVelocityAngular velocity, in radians per second, of actor in the x-, y-and z- directions, specified as a 1-by-3 vector.

The table describes the input structure of the type BusActorPose when you set Topic Category to Actor, and Topic to Actor Pose (Driving Scenario compatible).

Field NameDescription
ActorIDScenario-defined actor identifier, specified as a double.
PositionPosition of actor, specified as a real-valued vector of the form [x y z]. Units are in meters.
VelocityVelocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second.
RollRoll angle of actor, specified as a real-valued scalar. Units are in degrees.
PitchPitch angle of actor, specified as a real-valued scalar. Units are in degrees.
YawYaw angle of actor, specified as a real-valued scalar. Units are in degrees.
AngularVelocityAngular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second.

Dependencies

To enable this parameter, set Topic Category to Actor and Actor Type to All Types.

Vehicle data, specified as Vehicle Pose which contains the dynamic data associated with the vehicle, such as wheel poses.

The table describes the input structure when you set Topic Category to Actor, and Actor Type to Vehicle

Field NameDescription
ActorRuntimeAttributes of base actor during simulation specified as a structure of the type BusActorRuntime.
NumWheelsNumber of wheels specified as a uint64.
WheelPosesPoses of the wheels specified as a 4-by-4-by-18 array.
MapLocationLocation of the vehicle relative to map and lanes specified as a structure of the type BusVehicleMapLocation

The table describes MapLocation structure which is of the type BusVehicleMapLocation .

Field NameDescription
IsOnLaneA Boolean value indicating if the vehicle is on lane. A vehicle is considered as on a lane when its model origin resides in-between left and right boundaries of a lane.
LocationOnLaneThe lane this vehicle is currently on. If the vehicle is on multiple lanes, it indicates the best aligned lane. This field contains empty values if the vehicle is not on any lane, specified as a structure of the type BusVehicleLocationOnLane.

The table describes the LocationOnLane structure which is of the type BusVehicleLocationOnLane.

Field NameDescription
LaneIDA 16-byte string that identifies the overlapping lane on the HD-map
PositionPosition on the lane-center polyline (in s-value) where the vehicle is closest to specified as a double.
AngleAngle in radians between the direction of travel of the vehicle and the tangent at the lane position following the digitalization direction (s-value 0 to 1) of the lane specified as a double.

Dependencies

To enable this parameter, set Topic Category to Actor and Actor Type to Vehicle.

Type of event written to the scenario. The Action Complete event indicates that a custom action has been processed.

This table describes the Action Complete structure, which is of the type BusActionComplete.

Field NameDescription
ActionIDIdentifier of completed action, specified as a string.
ActorIDIdentifier of actor executing action, specified as a uint64.
FinalStatus

Status of the action, specified as an enumeration variable of the EnumActionStatus enumeration class. The value of EnumActionStatus can be:

  • Unspecified — The action event is not dispatched.

  • Dispatched — The action event has been dispatched.

  • Skipped — The action has been skipped; no action event is to be dispatched.

  • Interrupted — After dispatch, the action is cancelled or interrupted.

  • Done — After dispatch, the action is completed.

Dependencies

To enable this parameter, set Topic Category to Event.

Version History

Introduced in R2022a