メインコンテンツ

Simulation 3D Camera Get

Camera image

Since R2021b

  • 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

Note

Simulating models with the Simulation 3D Camera Get block requires Simulink® 3D Animation™.

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 then click the Properties button . 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.

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.

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

Specify the name of the parent to which the sensor is mounted. The block provides a list of parent actors in the model. The names that you can select correspond to the values of the Name parameters of the Simulation 3D blocks in your model. If you select Scene Origin, the block places a sensor at the scene origin. The Custom option allows you to specify the name of any actor, including child actors in the environment, as the parent actor.

Example: SimulinkVehicle1

Specify the name of custom parent. This parameter allows you to set any actor in the environment, including child actors as the parent actor to which the sensor is mounted. The name corresponds to the Name parameter of the Simulation 3D block.

Example: SimulinkVehicle1

Dependencies

To enable this parameter, set Parent name to Custom.

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

  • MATLAB – MATLAB® coordinate system. Units are in m and rad.

  • ISO8855 – ISO 8855 standard coordinate system. Units are in m and deg.

  • AERO – SAE coordinate system. Units are in m and rad.

  • VRML – X3D ISO standard coordinate system. Units are in m and rad.

  • SAE – SAE coordinate system. Units are in m and rad.

For more details on the different coordinate systems, see Unreal Engine Coordinates.

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 sim3d actor name, the block mounts the sensor to the origin of the actor, which is the center of the shape. You can set the Mounting location to Origin only. During simulation, the sensor travels with the actor.

  • 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.

The Mounting Location is one of Nose, Cockpit, CockpitRight, CockpitLeft,FuselageTop, Tail, or Down when the vehicle is one of Airliner, Air Transport, General Aviation, Helicopter, Light Helicopter, Multirotor, or Sky Hogg.

The Mounting Location is one of Front, Back, Right, Left, Top, Bottom, or Down when the vehicle is one of CubeSat or SmallSat.

Example: Origin

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

Translation offset from mounting location of the sensor, specified as a real-valued 1-by-3 vector of the form [X, Y, Z], in meters. The X, Y, and Z coordinates are defined in the coordinate system specified by the Coordinate system parameter.

Example: [0,0,0.01]

Dependencies

To enable this parameter, select Specify offset.

Rotational offset from mounting location of the sensor, specified as a real-valued 1-by-3 vector of the form [Roll, Pitch, Yaw]. Roll, pitch, and yaw are the angles of rotation about the X-, Y-, and Z-axes, respectively. The X, Y, and Z coordinates are defined in the coordinate system specified by the Coordinate system parameter. The rotation order is Roll, then Pitch, then Yaw. When you update any of the three rotation values and leave others unchanged, the software reapplies all three rotations in the same order.

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 R2021b

expand all