getAttribute
Description
Examples
Get Specified Attributes of Actor
Create ss
, a ScenarioSimulation
object.
rrApp = roadrunner('C:\Project\TestHighwayRoute'); openScenario(rrApp,'myScenario1'); ss = createSimulation(rrApp);
Start the simulation.
set(ss, 'SimulationCommand','Start')
Pause the simulation.
set(ss, 'SimulationCommand','Pause')
Get all actors in the simulation.
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: pc = getAttribute(actor, 'BoundingBox')
attribute
— Static attribute of actor
ID
| Name
| PaintColor
| BoundingBox
| WheelSpec
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 |
Example: pc = getAttribute(actormodel,
'PaintColor')
Output Arguments
a
— Value of static attribute of actor
uint64 | character vector | string | struct
Value of static attribute of actor, returned as one of these data types.
Parameter | Output Data Type |
---|---|
ID | uint64 |
Name | char |
PaintColor | struct |
BoundingBox | struct |
WheelSpec | struct |
This table describes the fields of the PaintColor
struct.
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
struct.
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
struct.
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. |
Version History
Introduced in R2022a
See Also
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)