getAttribute
Description
returns the value of the specified static attribute for the staticAttr
= getAttribute(actor
,attribute
)ActorModel
object actor
.
Examples
Get Specified Attributes of Actor
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
actor
— Actor
ActorModel
object
Actor from which to return static attribute, specified as an ActorModel
object.
Example: actor
attribute
— Static attribute of actor
"ID"
| "Name"
| "PaintColor"
| "BoundingBox"
| "WheelSpec"
| "TrafficSignalSpec"
| "TrafficSignalControllerSpec"
Static attribute of actor, specified as one of these values.
Parameter | Description |
---|---|
"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
staticAttr
— Value of static attribute of actor
uint64 | character vector | string | structure
Value of static attribute of actor, returned as one of these data types:
Parameter | Output Data Type |
---|---|
"ID" | uint64 |
"Name" | char |
"PaintColor" | PaintColor structure |
"BoundingBox" | BoundingBox structure |
"WheelSpec" | WheelSpec structure |
"TrafficSignalSpec" | TrafficSignalSpec structure |
"TrafficSignalControllerSpec" | TrafficSignalControllerSpec structure |
More About
PaintColor
Structure
This table describes the fields of the
PaintColor
structure:
Field Name | Description |
---|---|
r | Red color, returned as a uint32 value. |
g | Green color, returned as a uint32 value. |
b | Blue color, returned as a uint32 value. |
a | Transparency of the color (alpha), returned as a uint32
value. |
BoundingBox
Structure
This table describes the fields of the
BoundingBox
structure:
Field Name | Description |
---|---|
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. |
WheelSpec
Structure
This table describes the fields of the
WheelSpec
structure:
Field Name | Description |
---|---|
AxleIndex | Axle 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. |
WheelOffset | x-, y- and z- coordinates of the wheel center, in the vehicle coordinate system. Returned as a 1-by-3 vector. |
WheelRadius | Radius of the wheel in meters. Returned as a
double . |
TrafficSignalSpec
Structure
This table describes the fields of the
TrafficSignalSpec
structure:
Field Name | Description |
---|---|
SignalHead | Signal head specifications, returned as a structure of type
|
SignalPosition | World coordinates of the point of attachment of a signal head to a traffic signal pole, returned as a 1-by-3 double array. |
SignalStatus | Status of a traffic signal, returned as an enumeration variable. The value of the variable can be:
|
NumSignalPhaseState | Number of signal phases for a traffic signal, returned as a
|
SignalPhaseState | Information about each signal phase, returned as a structure array of
type For more information about signal phases, see the Signal Tool (RoadRunner). |
NumSupportedTurnTypes | Number of turn types supported by a traffic signal, returned as a
|
SupportedTurnTypes | Supported turn types, returned as an enumeration array, with the following possible values:
|
NumBulbConfigurations | Number of signal bulb configurations for the specified traffic signal,
returned as a |
BulbConfigurations | Configuration information about signal bulbs, returned as a structure
array of type |
NumTurnConfigurations | Number of turn configurations for the specified traffic signal,
returned as a |
TurnConfigurations | Turn configuration information for a traffic signal, returned as a
structure array of type |
This table describes the fields of the
SignalHead
structure:
Field Name | Description |
---|---|
SignalID | Universal unique identifier (UUID) of traffic signal, returned first as
a To convert the row vector into its alphanumeric form, use the char function, which returns the UUID as a character array. |
ControllerID | UUID of traffic signal controller, returned first as a
To convert the row vector into its alphanumeric form, use the char function, which returns the UUID as a character array. |
This table describes the fields of the
SignalPhaseState
structure array:
Field Name | Description |
---|---|
NumConfigurationIndex | Number of intervals in a phase, returned as a |
ConfigurationIndex | Configuration index of traffic signal in each interval of a signal
phase, returned as a The configuration index indicates the configuration of a traffic signal. For example, if the red bulb of a traffic signal is in the "On" state, and the green and yellow bulbs are "Off", then the traffic signal is red. A certain configuration index is assigned to every such possible configuration. |
This table describes the fields of the BulbConfigurations
structure array:
Field Name | Description |
---|---|
ConfigurationNumber | Configuration number of traffic signal, returned as a
This field corresponds to the
|
NumBulbConfiguration | Number of bulb configurations for the specified signal, returned as a
|
BulbConfiguration | Bulb name and state, returned as a structure array of type
|
This table describes the fields of the BulbConfiguration
structure array:
Field Name | Description |
---|---|
BulbName | Name of the bulb, returned first as a This field corresponds to the Node Name of the bulb as seen in the RoadRunner application. To obtain a readable word, you must
convert the |
BulbState | State of signal bulb, returned as an enumeration variable. Possible values of the variable are:
|
This table describes the fields of the
TurnCofigurations
structure array:
Field Name | Description |
---|---|
ConfigurationNumber | Configuration number of traffic signal, returned as a
This field corresponds to the
|
NumTurnState | Total number of turn states, returned as a |
TurnState | Turn type in combination with configuration type (maneuver
signalization), returned as a structure array of type
For more information about maneuver signalization, see the Maneuver Tool (RoadRunner). |
This table describes the fields of the
TurnState
structure array:
Field Name | Description |
---|---|
TurnType | Turn types, returned as an enumeration variable. Possible values of the variable are:
Every turn type has a corresponding configuration type (maneuver signalization). The turn type and configuration type together comprise a turn state, which determines the allowed turns at a traffic signal. |
ConfigurationType | Maneuver signalization, returned as an enumeration variable. The value of the variable can be:
A configuration type (maneuver signalization) is assigned to every turn type. The configuration type and turn type together comprise a turn state, which determines the allowed turns at a traffic signal. |
TrafficSignalControllerSpec
Structure
This table describes the fields of the
TrafficSignalControllerSpec
structure:
Field Name | Description |
---|---|
ControllerID | UUID of traffic signal controller, returned first as a
To convert the row vector into its alphanumeric form, use the char function, which returns the UUID as a character array. |
NumTrafficSignalControllerPhases | Number of phases, returned as a |
TrafficSignalControllerPhases | Information about the phases of a traffic signal controller, returned
as a structure array of type |
This table describes the fields of the
TrafficSignalControllerPhase
structure array:
Field Name | Description |
---|---|
PhaseName | Name of the phase, returned first as a To obtain a readable word, you must convert the
|
NumPhaseInterval | Number of intervals in the phase, returned as a
|
PhaseInterval | Information about the phase interval, returned as a
1-by-n structure array of type
|
This table describes the fields of the
PhaseInterval
structure array:
Field Name | Description |
---|---|
IntervalName | Name of the interval, returned first as a To obtain a readable word, you must convert the
|
IntervalType | Interval type, informing about allowed turn types at a junction, returned as an enumeration variable. The value of the variable can be:
This field corresponds to the Interval Type of a phase interval, as seen in the RoadRunner application. |
IntervalTime | Time duration of an interval, returned as a
|
Version History
Introduced in R2022aR2024b: Retrieve static attributes of traffic signal and traffic signal controller
Get static attributes of traffic signals and the parent traffic signal controller at a junction during cosimulation with RoadRunner Scenario.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)