Main Content

get

Get logged scenario simulation data

Since R2022a

    Description

    loggeddata = get(log,Parameter) returns simulation log data specified by Parameter from the ScenarioLog object log.

    example

    loggeddata = get(log,Parameter,"ActorID",ID) returns simulation log data specified by Parameter for actor with identifier ID from the ScenarioLog object log.

    example

    Examples

    collapse all

    Set logging on for rrSim, a ScenarioSimulation object.

    set(rrSim,"Logging","on")

    Get the simulation log after it stops playing.

    simLog = get(rrSim,"SimulationLog")

    Get the list of participating actors from the simulation.

    actors = get(simLog,"ActorIDs")
    actors =
    
         0     1     2

    Get the velocity of actor with actor ID 1.

    vel = get(simLog,"Velocity","ActorID",1)

    Input Arguments

    collapse all

    Scenario simulation log from which to return data, specified as a ScenarioLog object.

    Example: actors = get(simLog,"ActorIDs")

    Information required from simulation log, specified as one of these parameters.

    • ActorIDs

    • Time

    • MaxSimulationTime

    • StepSize

    • Diagnostics

    • Actions

    • Events

    • Pose

    • Velocity

    • AngularVelocity

    • WheelPose

    • ScenarioFile

    • InitialState

    • TrafficSignal

    • TrafficSignalController

    Note

    You can retrieve the Actions, Events, Pose, Velocity, AngularVelocity, InitialState,WheelPose,TrafficSignal, and TrafficSignalController parameters for a specific ActorID, only.

    Actor identifier, specified as a positive integer.

    Example: pose = get(simLog,"Pose","ActorID",5)

    Output Arguments

    collapse all

    Specific simulation log data, returned as an array or structure array.

    This table describes the output returned for each Parameter input argument.

    Input ArgumentOutput
    ActorIDsList of unique IDs of actors that participated in the simulation, returned as an array. Actor ID 0, representing the world, is always included in the list.
    TimeEach time step of the simulation, returned as an array.
    MaxSimulationTimeMaximum simulation time, returned as a double.
    StepSizeStep size of a simulation, returned as a double.
    Diagnostics

    Diagnostics reported during the simulation, if any, returned as a Diagnostics structure array.

    During simulation, diagnostic messages may originate from one of these sources:

    • MATLAB®

      or Simulink® cosimulation clients

    • The reportDiagnostic function in MATLAB or Simulink actor behaviors

    • RoadRunner Scenario

    Actions

    Actions of specified actor, if any, for each time step of the simulation, returned as an Actions structure array.

    Events

    Events being sent by the specified actor, if any, for each time step of the simulation, returned as an Events structure array.

    Pose

    Pose of specified actor for each time step of the simulation, returned as a Pose structure array.

    Velocity

    Velocity of specified actor for each time step of the simulation, returned as a Velocity structure array.

    AngularVelocity

    Angular velocity of specified actor for each time step of the simulation, returned as a AngularVelocity structure array.

    WheelPose

    Wheel pose of specified actor for each time step of the simulation, returned as a WheelPose structure array.

    ScenarioFileScenario file used to generate log.
    InitialState

    Actor state before the start of a simulation, returned as a InitialState Structure structure.

    The returned structure fields vary based on the actor type.

    TrafficSignal

    Traffic signal run-time information, returned as a TrafficSignal structure array.

    TrafficSignalController

    Traffic signal controller run-time information, returned as a TrafficSignalController structure array.

    More About

    collapse all

    Version History

    Introduced in R2022a

    expand all