Simulation 3D Camera Get
Camera image
- Library:
Vehicle Dynamics Blockset / Vehicle Scenarios / Sim3D / Sim3D Core
Aerospace Blockset / Animation / Simulation 3D

Description
The Simulation 3D Camera Get block provides an interface to an ideal camera in the 3D visualization environment. The image output is a red, green, and blue (RGB) array.
If you set the sample time to -1
, the block uses the sample time
specified in the Simulation 3D Scene Configuration block. To use this sensor,
ensure that the Simulation 3D Scene Configuration block is in your
model.
Tip
Verify that the Simulation 3D Scene Configuration block executes before the Simulation 3D Camera Get block. That way, the Unreal Engine® 3D visualization environment prepares the data before the Simulation 3D Camera Get block receives it. To check the block execution order, right-click the blocks and select Properties. On the General tab, confirm these Priority settings:
Simulation 3D Scene Configuration —
0
Simulation 3D Camera Get —
1
For more information about execution order, see Control and Display Execution Order.
Ports
Output
Image
— 3D output camera image
m-by-n-by-3 array of RGB triplet values
3D output camera image, returned as an m-by-n-by-3 array of RGB triplet values. m is the vertical resolution of the image, and n is the horizontal resolution of the image.
Data Types: int8
| uint8
Parameters
Sensor identifier
— Number to identify unique sensor
0
(default) | positive integer
Unique sensor identifier, specified as a positive integer. This number is used to identify a specific sensor. The sensor identifier distinguishes between sensors in a multi-sensor system.
Example: 2
Vehicle name
— Name of a vehicle
Scene Origin
(default) | character vector
Vehicle name. Block provides a list of vehicles in the model. If you select
Scene Origin
, the block places a sensor at the scene
origin.
Example: SimulinkVehicle1
Vehicle mounting location
— Sensor mounting location
Origin
(default) | Front bumper
| Rear bumper
| Right mirror
| Left mirror
| Rearview mirror
| Hood center
| Roof center
Sensor mounting location.
When Vehicle name is
Scene Origin
, the block mounts the sensor to the origin of the scene, and Mounting location can be set toOrigin
only. During simulation, the sensor remains stationary.When Vehicle name is the name of a vehicle (for example,
SimulinkVehicle1
) the block mounts the sensor to one of the predefined mounting locations described in the table. During simulation, the sensor travels with the vehicle.
Vehicle Mounting Location | Description | Orientation Relative to Vehicle Origin [Roll, Pitch, Yaw] (deg) |
---|---|---|
Origin | Forward-facing sensor mounted to the vehicle origin, which is on the ground, at the geometric center of the vehicle | [0, 0, 0] |
Front bumper | Forward-facing sensor mounted to the front bumper | [0, 0, 0] |
Rear bumper | Backward-facing sensor mounted to the rear bumper | [0, 0, 180] |
Right mirror | Downward-facing sensor mounted to the right side-view mirror | [0, –90, 0] |
Left mirror | Downward-facing sensor mounted to the left side-view mirror | [0, –90, 0] |
Rearview mirror | Forward-facing sensor mounted to the rearview mirror, inside the vehicle | [0, 0, 0] |
Hood center | Forward-facing sensor mounted to the center of the hood | [0, 0, 0] |
Roof center | Forward-facing sensor mounted to the center of the roof | [0, 0, 0] |
The (X, Y, Z) location of the sensor relative to the vehicle depends on the vehicle type. To specify the vehicle type, use the Type parameter of the Simulation 3D Scene Configuration block to which you are mounting. The tables show the X, Y, and Z locations of sensors in the vehicle coordinate system. In this coordinate system:
The X-axis points forward from the vehicle.
The Y-axis points to the left of the vehicle, as viewed when facing forward.
The Z-axis points up from the ground.
Roll, pitch, and yaw are clockwise-positive when looking in the positive direction of the X-axis, Y-axis, and Z-axis, respectively. When looking at a vehicle from the top down, then the yaw angle (that is, the orientation angle) is counterclockwise-positive, because you are looking in the negative direction of the axis.
Box Truck — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 5.10 | 0 | 0.60 |
Rear bumper | –5 | 0 | 0.60 |
| 2.90 | 1.60 | 2.10 |
| 2.90 | –1.60 | 2.10 |
| 2.60 | 0.20 | 2.60 |
| 3.80 | 0 | 2.10 |
| 1.30 | 0 | 4.20 |
Hatchback — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 1.93 | 0 | 0.51 |
Rear bumper | –1.93 | 0 | 0.51 |
| 0.43 | –0.84 | 1.01 |
| 0.43 | 0.84 | 1.01 |
| 0.32 | 0 | 1.27 |
| 1.44 | 0 | 1.01 |
| 0 | 0 | 1.57 |
Muscle Car — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 2.47 | 0 | 0.45 |
Rear bumper | –2.47 | 0 | 0.45 |
| 0.43 | –1.08 | 1.01 |
| 0.43 | 1.08 | 1.01 |
| 0.32 | 0 | 1.20 |
| 1.28 | 0 | 1.14 |
| –0.25 | 0 | 1.58 |
Sedan — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 2.42 | 0 | 0.51 |
Rear bumper | –2.42 | 0 | 0.51 |
| 0.59 | –0.94 | 1.09 |
| 0.59 | 0.94 | 1.09 |
| 0.43 | 0 | 1.31 |
| 1.46 | 0 | 1.11 |
| –0.45 | 0 | 1.69 |
Small Pickup Truck — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 3.07 | 0 | 0.51 |
Rear bumper | –3.07 | 0 | 0.51 |
| 1.10 | –1.13 | 1.52 |
| 1.10 | 1.13 | 1.52 |
| 0.85 | 0 | 1.77 |
| 2.22 | 0 | 1.59 |
| 0 | 0 | 2.27 |
Sport Utility Vehicle — Sensor Locations Relative to Vehicle Origin
Mounting Location | X (m) | Y (m) | Z (m) |
---|---|---|---|
Front bumper | 2.42 | 0 | 0.51 |
Rear bumper | –2.42 | 0 | 0.51 |
| 0.60 | –1 | 1.35 |
| 0.60 | 1 | 1.35 |
| 0.39 | 0 | 1.55 |
| 1.58 | 0 | 1.39 |
| –0.56 | 0 | 2 |
Example: Origin
Specify offset
— Specify offset from mounting location
off
(default) | on
Select this parameter to specify an offset from the mounting location.
Relative translation [X, Y, Z]
— Translation offset from mounting location
[0,0,0]
(default) | real-valued 1-by-3 vector
Specify a translation offset from the mount location, about the vehicle coordinate system X, Y, and Z axes. Units are in meters.
The X-axis points forward from the vehicle.
The Y-axis points to the left of the vehicle, as viewed when facing forward.
The Z-axis points up.
Example: [0,0,0.01]
Dependencies
To enable this parameter, select Specify offset.
Relative rotation [Roll, Pitch, Yaw]
— Rotational offset from mounting location
[0,0,0]
(default) | real-valued 1-by-3 vector
Specify a rotational offset from the mounting location, about the vehicle coordinate system X, Y, and Z axes. Units are in degrees.
Roll angle is the angle of rotation about the X-axis of the vehicle coordinate system. A positive roll angle corresponds to a clockwise rotation when looking in the positive direction of the X-axis.
Pitch angle is the angle of rotation about the Y-axis of the vehicle coordinate system. A positive pitch angle corresponds to a clockwise rotation when looking in the positive direction of the Y-axis.
Yaw angle is the angle of rotation about the Z of the vehicle coordinate system. A positive yaw angle corresponds to a clockwise rotation when looking in the positive direction of the Z-axis.
Example: [0,0,10]
Dependencies
To enable this parameter, select Specify offset.
Sample time
— Sample time
-1
(default) | positive scalar
Sample time of the block in seconds. The 3D simulation environment frame rate is the inverse of the sample time.
If you set the sample time to -1
, the block uses the sample time
specified in the Simulation 3D Scene Configuration block.
Horizontal resolution
— Pixels
uint32(1280)
(default) | scalar
Horizontal image resolution, in pixels.
Vertical resolution
— Pixels
uint32(720)
(default) | scalar
Vertical image resolution, in pixels.
Horizontal field of view
— Field of view
single(60)
(default) | scalar
Horizontal field of view (FOV), in deg.
Version History
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)