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 ss, a ScenarioSimulation object.

    set(ss,"Logging","on")

    Get the simulation log after it stops playing.

    log = get(ss,"SimulationLog")

    Get the list of participating actors from the simulation.

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

    Get the velocity of actor with actor ID 1.

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

    Input Arguments

    collapse all

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

    Example: actors = get(log,"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(log,"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.

    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

    Diagnostics Structure Array

    This table describes the fields of each structure within the Diagnostics structure array:

    Field NameDescription
    TimeSimulation time step at which diagnostic message is reported.
    MessageType

    Type of reported message, returned as an enumeration variable of the EnumDiagnosticType enumeration class.

    The value of EnumDiagnosticType variable can be:

    • Unspecified — The diagnostic type of reported message is unknown.

    • Information — The reported message is at the information level.

    • Warning — The reported message is at the warning level.

    • Error — The reported message is at the error level.

    MessageDiagnostic message text, returned as a string or character vector.

    Actions Structure Array

    This table describes the fields of each structure within the Actions structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    ActionActions of the specified actor, if any, at each simulation time step.

    Events Structure Array

    This table describes the fields of each structure within the Events structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    EventsEvents being sent by the specified actor, if any, at each simulation time step.

    Pose Structure Array

    This table describes the fields of each structure within the Pose structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    PosePose of the specified actor at each simulation time step.

    Velocity Structure Array

    This table describes the fields of each structure within the Velocity structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    VelocityVelocity of the specified actor at each simulation time step.

    AngularVelocity Structure Array

    This table describes the fields of each structure within the AngularVelocity structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    AngularVelocityAngular velocity of the specified actor at each simulation time step.

    WheelPose Structure Array

    This table describes the fields of a structure within the WheelPose structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    WheelPose

    The wheel pose of the specified actor at each simulation time step.

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

    InitialState Structure

    This table describes the InitialState structure:

    Field NameDescription
    TimeTime step at which actor was created, returned as a double.
    ActorIDActor identifier, returned as a string.
    PoseInitial actor pose, returned as a 4-by-4 matrix.
    VelocityInitial actor velocity, returned as a 1-by-3 matrix.
    AngularVelocityInitial angular velocity of actor, returned as a 1-by-3 matrix.
    WheelPoseInitial wheel pose of vehicle actor, returned as a 4-by-4-by-4 array.
    TrafficSignalStateInitial state of the specified traffic signal actor, returned as a structure of type TrafficSignalRuntime.
    TrafficSignalControllerStateInitial state of the specified traffic signal controller actor, returned as a structure of type TrafficSignalControllerRuntime.

    TrafficSignal Structure Array

    This table describes the TrafficSignal structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    TrafficSignal

    Traffic signal run-time information for the specified actor ID, returned as a TrafficSignalRuntime structure.

    TrafficSignalController Structure Array

    This table describes the TrafficSignalController structure array:

    Field NameDescription
    TimeEach simulation time step, from start to end.
    TrafficSignalController

    Traffic signal controller run-time information for the specified actor ID, returned as a TrafficSignalControllerRuntime structure.

    Version History

    Introduced in R2022a

    expand all