Main Content

Simulation 3D Camera Get

Camera image

Since R2022b

  • Simulation 3D Camera Get block

Libraries:
Vehicle Dynamics Blockset / Vehicle Scenarios / Sim3D / Sim3D Core
Aerospace Blockset / Animation / Simulation 3D
Simulink 3D Animation / Simulation 3D / Utilities

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 Configuration0

  • Simulation 3D Camera Get1

For more information about execution order, see Control and Display Execution Order (Simulink).

The Coordinate system parameter of the block specifies how the actor transformations are applied in the 3D environment. The output of the block also follows the specified coordinate system.

Examples

Ports

Output

expand all

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

expand all

Mounting

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

Parent name. Block provides a list of parent actors in the model. If you select Scene Origin, the block places a sensor at the scene origin.

Example: SimulinkVehicle1

Since R2025a

Specify the coordinate system that the actor uses for translation and rotation in the 3D environment.

  • Default – World coordinate system

  • MATLAB – MATLAB® coordinate system

  • ISO8855 – ISO 8855 standard coordinate system

  • AERO – SAE coordinate system

  • VRML – X3D ISO standard coordinate system

  • SAE – SAE coordinate system

For more details on the different coordinate systems, see Coordinate Systems in Simulink 3D Animation.

Example: MATLAB

Sensor mounting location.

  • When Parent name is Scene Origin, the block mounts the sensor to the origin of the scene, and Mounting location can be set to Origin only. During simulation, the sensor remains stationary.

  • When Parent 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. For example, the table provides the mounting locations in the ISO 8855 standard coordinate system.

Mounting LocationDescriptionOrientation Relative to Vehicle Origin [Roll, Pitch, Yaw] (deg)
Origin

Forward-facing sensor mounted to the vehicle origin, which is on the ground and at the geometric center of the vehicle (see Coordinate Systems in Simulink 3D Animation)

Vehicle with sensor mounted at origin

[0, 0, 0]

Front bumper

Front center

Forward-facing sensor mounted to the front bumper

Vehicle with sensor mounted at front bumper

[0, 0, 0]

Rear bumper

Rear center

Backward-facing sensor mounted to the rear bumper

Vehicle with sensor mounted at rear bumper

[0, 0, 180]
Right mirror

Downward-facing sensor mounted to the right side-view mirror

Vehicle with sensor mounted at right side-view mirror

[0, –90, 0]
Left mirror

Downward-facing sensor mounted to the left side-view mirror

Vehicle with sensor mounted at left side-view mirror

[0, –90, 0]
Rearview mirror

Forward-facing sensor mounted to the rearview mirror, inside the vehicle

Vehicle with sensor mounted at rearview mirror

[0, 0, 0]
Hood center

Forward-facing sensor mounted to the center of the hood

Vehicle with sensor mounted at hood center

[0, 0, 0]
Roof center

Forward-facing sensor mounted to the center of the roof

Vehicle with sensor mounted at roof center

[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 Vehicle with Ground Following block to which you are mounting.

For example, the tables show the X, Y, and Z locations of sensors in the ISO 8855 standard coordinate system.

Box Truck — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper5.1000.60
Rear bumper–500.60

Right mirror

2.901.602.10

Left mirror

2.90–1.602.10

Rearview mirror

2.600.202.60

Hood center

3.8002.10

Roof center

1.3004.20

Hatchback — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper1.9300.51
Rear bumper–1.9300.51

Right mirror

0.43–0.841.01

Left mirror

0.430.841.01

Rearview mirror

0.3201.27

Hood center

1.4401.01

Roof center

001.57

Muscle Car — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper2.4700.45
Rear bumper–2.4700.45

Right mirror

0.43–1.081.01

Left mirror

0.431.081.01

Rearview mirror

0.3201.20

Hood center

1.2801.14

Roof center

–0.2501.58

Sedan — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper2.4200.51
Rear bumper–2.4200.51

Right mirror

0.59–0.941.09

Left mirror

0.590.941.09

Rearview mirror

0.4301.31

Hood center

1.4601.11

Roof center

–0.4501.69

Small Pickup Truck — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper3.0700.51
Rear bumper–3.0700.51

Right mirror

1.10–1.131.52

Left mirror

1.101.131.52

Rearview mirror

0.8501.77

Hood center

2.2201.59

Roof center

002.27

Sport Utility Vehicle — Sensor Locations Relative to Vehicle Origin

Mounting LocationX (m)Y (m)Z (m)
Front bumper2.4200.51
Rear bumper–2.4200.51

Right mirror

0.60–11.35

Left mirror

0.6011.35

Rearview mirror

0.3901.55

Hood center

1.5801.39

Roof center

–0.5602

Example: Origin

Select this parameter to specify an offset from the mounting location.

Specify a translation offset from the mount location, about the X, Y, and Z axes.

Example: [0,0,0.01]

Dependencies

To enable this parameter, select Specify offset.

Specify a rotational offset from the mounting location, about the X, Y, and Z axes.

Example: [0,0,10]

Dependencies

To enable this parameter, select Specify offset.

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.

Parameter

Horizontal image resolution, in pixels.

Vertical image resolution, in pixels.

Horizontal field of view (FOV), in deg.

Tips

Version History

Introduced in R2022b

expand all