getAttribute
Description
returns the value of the specified static attribute for the staticAttr = getAttribute(actor,attribute)ActorModel
object actor.
Examples
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 from which to return static attribute, specified as an ActorModel
object.
Example: actor
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
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
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. |
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. |
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. |
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. |
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 R2022aGet 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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)