Main Content

getAttribute

Return static attribute of actor

Since R2022a

    Description

    staticAttr = getAttribute(actor,attribute) returns the value of the specified static attribute for the ActorModel object actor.

    example

    Examples

    collapse all

    Create a roadrunner object to launch the RoadRunner application, and open the project at the specified project location.

    rrApp = roadrunner("C:\Project\TestRoute")

    Open the scenario file TrajectoryCutIn.rrscenario that is included with the RoadRunner Scenario application.

    openScenario(rrApp,"TrajectoryCutIn");

    Create a ScenarioSimulation object ScenarioSim.

    ScenarioSim = createSimulation(rrApp);
    

    Start the simulation.

    set(ScenarioSim,"SimulationCommand","Start")
    

    Pause the simulation.

    set(ScenarioSim,"SimulationCommand","Pause")
    

    Get the ActorSimulation objects corresponding to all actors in the scenario.

    actorsAll = get(ss,"ActorSimulation")

    Get the static specifications of the first actor.

    actormodel = get(actorsAll{1},"ActorModel")

    Get the paint color of the first actor.

    pc = getAttribute(actormodel,"PaintColor")

    Input Arguments

    collapse all

    Actor from which to return static attribute, specified as an ActorModel object.

    Example: actor

    Static attribute of actor, specified as one of these values.

    ParameterDescription
    "ID"Actor identifier, returned as a positive integer
    "Name"Actor name, returned as a string
    "PaintColor"Color of the actor
    "BoundingBox"Bounding box of the actor
    "WheelSpec"Wheel specifications of vehicle-type actor
    "TrafficSignalSpec"Static specifications of traffic signal actor
    "TrafficSignalControllerSpec"Static specifications of traffic signal controller

    Example: "PaintColor"

    Data Types: char | string

    Output Arguments

    collapse all

    Value of static attribute of actor, returned as one of these data types:

    ParameterOutput Data Type
    "ID"uint64
    "Name"char
    "PaintColor"PaintColor structure
    "BoundingBox"BoundingBox structure
    "WheelSpec"WheelSpec structure
    "TrafficSignalSpec"TrafficSignalSpec structure
    "TrafficSignalControllerSpec"TrafficSignalControllerSpec structure

    More About

    collapse all

    Version History

    Introduced in R2022a

    expand all