Lidar sensor model in 3D simulation environment
Automated Driving Toolbox / Simulation 3D
The Simulation 3D Lidar block provides an interface to the lidar sensor in a 3D simulation environment. This environment is rendered using the Unreal Engine® from Epic Games®. The block returns a point cloud with the specified field of view and angular resolution. You can also output the distances from the sensor to object points. In addition, you can output the location and orientation of the sensor in the world coordinate system of the scene.
If you set 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.
Note
The Simulation 3D Scene Configuration block must execute before the Simulation 3D Lidar block. That way, the Unreal Engine 3D visualization environment prepares the data before the Simulation 3D Lidar 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 Lidar — 1
For more information about execution order, see How Unreal Engine Simulation for Automated Driving Works.
To visualize point clouds that are output by the Point cloud port, you can either:
Use a pcplayer
(Computer Vision Toolbox) object in a MATLAB
Function block. For an example of this visualization setup, see Design Lidar SLAM Algorithm Using Unreal Engine Simulation Environment.
Use the Bird's-Eye Scope. For more details, see Visualize Sensor Data from Unreal Engine Simulation Environment.
The Unreal Engine can take a long time to start up between simulations, consider logging the signals that the sensors output. You can then use this data to develop perception algorithms in MATLAB®. See Configure a Signal for Logging (Simulink).