Main Content

RoadRunner Scenario Writer

Write selected topic to RoadRunner scenario

Since R2022a

  • RoadRunner Scenario Writer block

Libraries:
Automated Driving Toolbox / RoadRunner Scenario

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.

Examples

Ports

Input

expand all

State information to write to the scenario, specified as a Simulink message. To construct a Simulink message from an input signal within your model, use the Send (Simulink) block. Then, connect the output of the Send block to the RoadRunner Scenario Writer block.

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. See What Is a RoadRunner Pose Matrix? for more information.
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 uint32.
WheelPosesPoses of the wheels specified as a 4-by-4-by-18 array.

Dependencies

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

Type of event written to the scenario, specified as one of the following.

  • Action Complete — Indicates that a custom action has been processed.

  • User-Defined — Indicates that a user-defined event has been returned to a scenario.

    The event being written must be mapped to its corresponding bus object in the RoadRunner Scenario block.

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