Main Content

RoadRunner Scenario Reader

Reads selected topic from RoadRunner scenario

  • Library:
  • Automated Driving Toolbox / RoadRunner Scenario

  • RoadRunner Scenario Reader block

Description

The RoadRunner Scenario Reader block reads the selected topic from the RoadRunner scenario. You can set the Topic Category parameter to Actor or Action. The block outputs data as messages. When you select the Actor topic, the block outputs the data associated with the actor, such as Actor Specifications and Actor Pose. When you select the Action topic, the block outputs data such as Speed Change and Lane Change. The block returns the simulation states from the previous time step. You can filter data based on the actor associated with the Simulink® actor model.

Ports

Output

expand all

State information from scenario, returned as a Simulink message.

Parameters

expand all

Topic category, specified as one of these values:

  • Actor — Reads the actor data from the scenario

  • Action — Reads the action data from the scenario

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

Dependencies

To enable this parameter, set Topic Category to Actor.

Type of action that can be read from the scenario, specified as one of these values:

  • Change Parameter — Reads the user-created parameter from the scenario

  • Lateral Offset — Reads the lateral offset action data from the scenario

  • Path Following — Reads the path following action data from the scenario

  • Speed Change — Reads the speed change action data from the scenario

  • Lane Change — Reads the lane change action data from the scenario

  • Longitudinal Distance — Reads the longitudinal distance action data from the scenario

  • User-Defined — Reads the custom parameters of a user-defined action from the scenario

This table describes the output bus structure when you set Topic Category to Action and Action Type to Change Behavior Parameter.

Field NameDescription
Actor Action

Information about the current action of specified actor, returned as a struct.

Parameter

Information about the changed user-specified behavior parameter, returned as a struct.

This table describes the Actor Action structure of the above output bus structure.

Field NameDescription
ActionID

Action ID returned as a string.

ActorID

Identifier of actor performing the action, returned as a uint64.

PhaseInterval

Phase interval to which the action is applied.

  • Unspecified — Unknown phase interval for the action.

  • AtStart — Specified action is completed at the start of the current phase.

  • AtEnd — Specified action is completed by the end of the current phase.

  • Invariant — Specified action objective is maintained during the current phase.

ActionTypes

Action type.

  • Unspecified — Unknown action type.

  • LaneChange — Lane change action.

  • Path — Path action.

  • Speed — Speed action.

  • LateralOffset — Lateral offset action.

  • ChangeBehaviorParameter — Change behavior parameter action.

  • User-Defined — Change user-defined parameters.

Note

The Actor Action structure is the same for all action types.

This table describes the Parameter structure of the above output bus structure.

Field NameDescription
Name

Name of the changed user-specified behavior parameter, returned as a string.

Value

New value of the user-specified behavior parameter, returned as a string.

ParameterTypeType of parameter.

This table describes the output bus structure when you set Topic Category to Action and Action Type to Lane Change.

Field NameDescription
ActorAction

Information about the current action of specified actor, returned as a struct.

LaneChangeTarget

Target lane after lane change, returned as a struct.

TransitionDynamics

Dynamics of the transition to the lane change, returned as a struct.

The ActorAction structure is the same for all action types and is described above.

This table describes the LaneChangeTarget structure of the above output bus structure.

Field NameDescription
LaneValueNumber of lanes to change before reaching the target lane, returned as an int32 value.
LaneComparison

Direction of the lane change.

  • Unspecified — Unknown lane change direction.

  • SameAs — Actor moves to the same lane as the reference actor.

  • LeftOf — Actor moves to the lane left of the reference actor.

  • RightOf — Actor moves to the lane right of the reference actor.

RefActorIDIdentifier of reference actor, returned as a uint64.

This table describes the TransitionDynamics structure of the above output bus structure.

Field NameDescription
Dimension

Transition metric measuring the action change.

  • Unspecified — Unknown transition metric to measure specified action.

  • Rate — The action occurs within specified rate value.

  • Time — The action occurs within specified time value (seconds).

  • Distance — The action occurs within specified distance value (meters).

Shape

Shape of the transition curve.

  • Unspecified — The shape of the transition curve is unknown.

  • Linear — The transition curve is linear.

  • Cubic — The transition curve is cubic.

  • Step — The transition curve is step-shaped.

ValueValue of the chosen transition metric, returned as a double.

Note

The TransitionDynamics structure is the same for all action types that employ its use.

This table describes the output bus structure when you set Topic Category to Action and Action Type to Lateral Offset.

Field NameDescription
ActorActionInformation about the current action of specified actor, returned as a struct.
LateralOffsetTargetLateral offset relative to the current path of specified actor, returned as a struct.
TransitionDynamicsTransition dynamics for the lateral offset change, specified as a struct.

The ActorAction structure is the same for all action types and is described above.

This table describes the LateralOffsetTarget structure of the above output bus structure.

Field NameDescription
OffsetValueTarget lateral offset relative to the current path, returned as a double.
  • A positive value indicates an offset to the right of the current path

  • A negative value indicates an offset to the left of the current path

The TransitionDynamics structure is the same for all action types that employ its use and is described above.

This table describes the output bus structure when you set Topic Category to Action and Action Type to Longitudinal Distance.

Field NameDescription
ActorActionInformation about the current action of the specified actor, returned as a struct.
DistanceTargetInformation about the longitudinal distance to the reference actor, returned as a struct.
ReferenceSamplingMode

Phase interval at which the target longitudinal distance is achieved.

  • Unspecified — Target longitudinal distance gap to reference actor is unknown.

  • AtActionStart — Target longitudinal distance gap to reference actor is achieved at the start of the current phase.

  • Continuous — Target longitudinal distance gap to reference actor is achieved and maintained until another action controlling longitudinal distance is activated.

DynamicConstraintsDynamic constraints for the longitudinal distance change, returned as a struct.

The ActorAction structure is the same for all action types and is described above.

This table describes the DistanceTarget structure of the above output bus structure.

Field NameDescription
RefActorIDIdentifier of reference actor, returned as a uint64.
DistanceDimensionType

Type of distance to reference actor.

  • Unspecified — Type of distance to reference actor is unknown.

  • Longitudinal —Type of distance to the reference actor is longitudinal.

  • Lateral — Type of distance to the reference actor is lateral.

  • Euclidean — Type of distance to the reference actor is Euclidean.

DistanceType

Specification of longitudinal distance as either time distance or space distance.

  • Unspecified — Unknown longitudinal distance specification

  • Space — Space distance

  • Time — Time distance

ActorCoordinateSystemType

Coordinate system in which to measure required longitudinal distance.

  • Unspecified — Unknown coordinate system

  • Lane — Lane-based st coordinate system (s-axis is the lane center line of the lane on which the entity is located)

  • Pose — Cartesian coordinate system

ValueLongitudinal distance, returned as a double.
PositionComparison

Relative position to reference actor.

  • Unspecified — Unknown relative position to reference actor

  • SameAs — Parallel to reference actor

  • AheadOf — Ahead of reference actor

  • Behind — Behind reference actor

  • Either — Ahead of or behind reference actor

MeasureFrom

Longitudinal distance is either measured between the closest points on two actors' bounding boxes or between the origin point of both actors.

  • Unspecified — Unknown distance measurement type.

  • BoundingBoxes — Distance is measured as the gap between the rear end of the leading vehicle and the front end of the trailing vehicle.

  • Origins — Distance is measured as the gap between the origin of the leading vehicle and the origin of the trailing vehicle.

This table describes the DynamicConstraints structure of the above output bus structure.

Field NameDescription
UnlimitedDynamicsPresence of dynamic constraints, returned as a Boolean value.
MaxSpeedMaximum speed that an actor can attain while approaching target longitudinal distance to reference actor, returned as a double.
MaxAccelerationMaximum acceleration that an actor can attain while approaching target longitudinal distance to reference actor, returned as a double.
MaxDecelerationMaximum deceleration that an actor can attain while approaching target longitudinal distance to reference actor, returned as a double.

This table describes the output bus structure when you set Topic Category to Action and Action Type to Path Following.

Field NameDescription
ActorActionInformation about the current action of specified actor, returned as a struct.
PathTargetActor target path, returned as a struct.

The ActorAction structure is the same for all action types and is described above.

This table describes the PathTarget structure of the above output bus structure.

Field NameDescription
Path

Set of 3-D coordinates representing the target path, returned as an N-by-3 array where N = NumPoints.

Each column value in the first row is the x-, y- and z- coordinate, respectively, of the first point in the target path, and so on.

NumPointsTotal number of points in the target path, returned as a positive integer.
HasTimingsIndication of target path containing timing information, returned as a Boolean value.
TimingsTiming information for each point of the path, returned as an N-by-1 structure array where N = NumPoints.

This table describes the Timings structure of the above PathTarget structure.

Field NameDescription
TimeTime of arrival of the actor at this point, relative to the time at the starting point of the path. Returned in seconds.
SpeedSpeed of actor at the time of arrival, returned in meters per second.
WaitTimeWaiting time period of actor at arrival, returned in seconds. If this value is non-zero, then the actor is at rest.

This table describes the output bus structure when you set Topic Category to Action and Action Type to Speed Change.

Field NameDescription
ActorActionInformation about the current action of specified actor, returned as a struct.
SpeedTargetTarget speed after speed change, returned as a struct.
TransitionDynamicsTransition dynamics for the speed change, specified as a struct.

The ActorAction structure is the same for all action types and is described above.

This table describes the SpeedTarget structure of the above output bus structure.

Field NameDescription
SpeedValueTarget speed value, returned as a double.
SpeedComparison

Comparison type of current speed with the target speed.

  • Unspecified — Unknown speed comparison type.

  • Absolute — The target speed is absolute.

  • SameAs — The speed difference is zero relative to the speed of the reference actor.

  • FasterThan — The target speed must be higher than the speed of the reference actor.

  • SlowerThan — The target speed must be lower than the speed of the reference actor.

  • FromPath — The target speed must match the speeds specified in the PathPointTiming structure of the PathTarget structure (within PathAction structure) of the actor reference path.

RefActorIDIdentifier of reference actor, if any, returned as a uint64.
RefSamplingMode

Speed sampling mode of reference actor, if any.

  • Unspecified — Target speed comparison to reference actor speed is unknown.

  • AtActionStart — Indicates that the target speed compares with point speed of reference actor at start of the phase.

  • Continuous — Indicates that the target speed compares with point speed of reference actor continuously through entire phase or until another action controlling target speed is activated.

The TransitionDynamics structure is the same for all action types that employ its use and is described above.

This table describes the output bus structure when you set Topic Category to Action and Action Type to User-Defined.

Field NameDescription
ActorAction

Information about the current action of specified actor, returned as a struct.

Name

Action name, returned as a string.

ParametersCustom parameters of the user-defined action, returned as a struct. This struct contains the name and value for each custom parameter.

The ActorAction structure is the same for all action types and is described above.

Dependencies

To enable this parameter, set Topic Category to Action.

Actor data for all types, specified as one of these options:

  • Actor Specifications — Static attributes associated with the actor, such as actor ID, actor name, and bounding box

  • 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

This table describes the output bus structure when you set Topic Category to Actor, Actor Type to All Types and Topic to Actor Specifications.

Field NameDescription
ActorID

Actor identifier, returned as a uint64.

ActorName

Actor name, returned as a string.

BoundingBoxBounding box of the actor, returned as a struct.

This table describes the BoundingBox structure of the above output bus structure.

Field NameDescription
Min

The bounding box corner with minimal x-, y- and z- values, returned as a 1-by-3 array.

Max

The bounding box corner with maximal x-, y- and z- values, returned as a 1-by-3 array.

This table describes the output bus structure when you set Topic Category to Actor, Actor Type to All Types and Topic to Actor Pose.

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

This table describes the output bus structure when you set Topic Category to Actor, Actor Type to All Types and Topic to Actor Pose(Driving Scenario compatible).

Field NameDescription
ActorIDScenario-defined actor identifier, returned as a uint64.
PositionPosition of actor, returned 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, returned as a real-valued vector of the form [vx vy vz]. Units are in meters per second.
RollRoll angle of actor, returned as a real-valued scalar. Units are in degrees.
PitchPitch angle of actor, returned as a real-valued scalar. Units are in degrees.
YawYaw angle of actor, returned as a real-valued scalar. Units are in degrees.
AngularVelocityAngular velocity (ω) of actor in the x-, y-, and z-directions, returned as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second.

Dependencies

To enable these options for this parameter, set Actor Type to All Types.

Actor data for vehicle type, specified as one of these options:

  • Vehicle Specifications — Static attributes associated with the vehicle, such as paint color, and wheel specifications.

  • Vehicle Pose — Dynamic data associated with the actor, such as wheel poses

This table describes the output bus structure when you set Topic Category to Actor, Actor Type to Vehicle and Topic to Vehicle Specifications.

Field NameDescription
ActorSpecActor specifications, returned as a struct.
PaintColorColor of the actor, returned as a struct.
NumWheels

Number of wheels, returned as a uint64 value.

WheelsWheel specifications of vehicle-type actor, returned as a struct.

This table describes the ActorSpec structure of the above output bus structure.

Field NameDescription
ActorID

Actor identifier, returned as a uint64.

ActorName

Actor name, returned as a string.

BoundingBoxBounding box of the actor, returned as a struct.

Note

The ActorSpec structure is also returned when you set Topic Category to Actor, Actor Type to All Types and Topic to Actor Specifications.

This table describes the PaintColor structure of the above output bus structure.

Field NameDescription
rRed color, returned as a uint32 value.
gGreen color, returned as a uint32 value.
bBlue color, returned as a uint32 value.
aTransparency of the color (alpha), returned as a uint32 value.

This table describes the Wheels structure of the above output bus structure.

Field NameDescription
AxleIndexAxle index of a wheel. The front-most axle has the starting index value of zero, with index values increasing towards the vehicle rear. Returned as a uint32 value.
WheelOffsetx-, y- and z- coordinates of the wheel center, in the vehicle coordinate system. Returned as a 1-by-3 vector.
WheelRadiusRadius of the wheel in meters. Returned as a double.

This table describes the output bus structure when you set Topic Category to Actor, Actor Type to Vehicle and Topic to Vehicle Pose.

Field NameDescription
ActorRuntimeActor runtime values, returned as a struct.
NumWheelsNumber of wheels specified as a uint64.
WheelPoses

Runtime pose of each wheel of vehicle-type actor, returned as a multidimensional 4-by-4-by-N array. N is the number of wheels of the vehicle-type actor.

WheelPoses is returned for wheels starting on the leftmost side of the front axle, and moving to the right. After the first axle is complete, the leftmost wheel on the second axle is taken into consideration before moving to the right, and so on.

MapLocation

Location of vehicle-type actor with respect to its closest lane, returned as a struct.

This table describes the ActorRuntime structure of the above output bus structure.

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

Note

The ActorRuntime structure is also returned when you set Topic Category to Actor, Actor Type to All Types and Topic to Actor Pose.

This table describes the MapLocation structure of the above output bus structure.

Field NameDescription
IsOnLaneBoolean value indicating if the vehicle is located on a lane. A vehicle is considered to be on a certain lane if its model origin lies in between the left and right boundaries of this lane.
LocationOnLaneCurrent lane of vehicle, returned as a struct. If a vehicle straddles several lanes, the most aligned lane is returned.

This table describes the LocationOnLane structure of the MapLocation structure.

Field NameDescription
LaneIDUUID identifier of the most aligned lane, returned as a string.
PositionPosition of the vehicle on the lane-center polyline (in s-value). The s-value is a double value within [0, 1] that indicates a position on a 3-D polyline with 0 at the start and 1 at the end of the polyline.
AngleAngle between the vehicle travel direction and tangent at the lane position. Units are in radians.

Dependencies

To enable these options for this parameter, set Actor Type to Vehicle.

Filter criteria for relevant topic data, specified as None or Self. None outputs data for all actors in the scenario.Self outputs data for the Simulink model actor.

Sample time of simulation in seconds, specified as a positive real scalar.

Version History

Introduced in R2022a