World To Vehicle
Libraries:
Automated Driving Toolbox /
Driving Scenario and Sensor Modeling
Description
The World To Vehicle block converts actor poses from world coordinates to the vehicle coordinates of the input ego vehicle.
Ports
Input
Actors — Actor poses in world coordinates
Simulink® bus containing MATLAB® structure
Actor poses in world coordinates, specified as a Simulink bus containing a MATLAB structure.
The structure must contain these fields.
Field | Description | Type |
---|---|---|
NumActors | Number of actors | Nonnegative integer |
Time | Current simulation time | Real-valued scalar |
Actors | Actor poses | NumActors -length array of actor pose structures |
Each actor pose structure in Actors
must contain these
fields.
Field | Description |
---|---|
ActorID | Scenario-defined actor identifier, specified as a positive integer. |
In R2024b:
| Front-axle position of the vehicle, specified as a three-element row vector in the form [x y z]. Units are in meters. Note If the driving scenario does not contain a
front-axle trajectory for at least one vehicle,
then the
|
Position | Position of actor, specified as a real-valued vector of the form [x y z]. Units are in meters. |
Velocity | Velocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second. |
Roll | Roll angle of actor, specified as a real-valued scalar. Units are in degrees. |
Pitch | Pitch angle of actor, specified as a real-valued scalar. Units are in degrees. |
Yaw | Yaw angle of actor, specified as a real-valued scalar. Units are in degrees. |
AngularVelocity | Angular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second. |
Ego Vehicle — Ego vehicle pose
Simulink bus containing MATLAB structure
Ego vehicle pose, specified as a Simulink bus containing a MATLAB structure.
The structure must contain these fields.
Field | Description |
---|---|
ActorID | Scenario-defined actor identifier, specified as a positive integer. |
In R2024b:
| Front-axle position of the vehicle, specified as a three-element row vector in the form [x y z]. Units are in meters. Note If the driving scenario does not contain a
front-axle trajectory for at least one vehicle,
then the
|
Position | Position of actor, specified as a real-valued vector of the form [x y z]. Units are in meters. |
Velocity | Velocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second. |
Roll | Roll angle of actor, specified as a real-valued scalar. Units are in degrees. |
Pitch | Pitch angle of actor, specified as a real-valued scalar. Units are in degrees. |
Yaw | Yaw angle of actor, specified as a real-valued scalar. Units are in degrees. |
AngularVelocity | Angular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second. |
Output
Actors — Actor poses in vehicle coordinates
Simulink bus containing MATLAB structure
Actor poses in vehicle coordinates, returned as a Simulink bus containing a MATLAB structure.
The structure has these fields.
Field | Description | Type |
---|---|---|
NumActors | Number of actors | Nonnegative integer |
Time | Current simulation time | Real-valued scalar |
Actors | Actor poses | NumActors -length array of actor pose structures |
Each actor pose structure in Actors
has these fields.
Field | Description |
---|---|
ActorID | Scenario-defined actor identifier, specified as a positive integer. |
In R2024b:
| Front-axle position of the vehicle, specified as a three-element row vector in the form [x y z]. Units are in meters. Note If the driving scenario does not contain a
front-axle trajectory for at least one vehicle,
then the
|
Position | Position of actor, specified as a real-valued vector of the form [x y z]. Units are in meters. |
Velocity | Velocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second. |
Roll | Roll angle of actor, specified as a real-valued scalar. Units are in degrees. |
Pitch | Pitch angle of actor, specified as a real-valued scalar. Units are in degrees. |
Yaw | Yaw angle of actor, specified as a real-valued scalar. Units are in degrees. |
AngularVelocity | Angular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second. |
Parameters
Source of actors bus name — Source of name for actor poses bus
Auto
(default) | Property
Source of the name for the actor poses bus returned in the Actors output port, specified as one of these options:
Auto
— The block automatically creates an actor poses bus name.Property
— Specify the actor poses bus name by using the Actors bus name parameter.
Actors bus name — Name of actor poses bus
valid bus name
Name of the actor poses bus returned in the Actors output port, specified as a valid bus name.
Dependencies
To enable this parameter, set Source of actors bus name to Property
.
Simulate using — Type of simulation to run
Interpreted execution
(default) | Code generation
Interpreted execution
— Simulate the model using the MATLAB interpreter. This option shortens startup time. InInterpreted execution
mode, you can debug the source code of the block.Code generation
— Simulate the model using generated C/C++ code. The first time you run a simulation, Simulink generates C/C++ code for the block. The C code is reused for subsequent simulations as long as the model does not change. This option requires additional startup time.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2020a
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 (한국어)