LiDAR
AirGen contains support for Lidar sensors which capture 3D point clouds.
Configuration
The configuration for the Lidar sensor can be set up in the Sensors section of the configuration tab (accessible through the custom session panel). The following parameters are available:
Parameter |
Description |
---|---|
NumberOfChannels |
Number of lasers arranged vertically |
X, Y, Z |
Position of the lidar relative to the vehicle |
Roll, Pitch, Yaw |
Orientation of the lidar relative to the vehicle |
VerticalFOVUpper |
Topmost orientation in degrees |
VerticalFOVLower |
Bottommost orientation in degrees |
HorizontalFOVStart |
Leftmost orientation in degrees |
HorizontalFOVEnd |
Rightmost orientation in degrees |
Accessing LiDAR data
Assuming a LiDAR has been set up for a vehicle, the point cloud data can be accessed as follows, and optionally visualized through Rerun.
client = airgen.MultirotorClient()
# Get LiDAR data
lidar_data = client.getLidarData()
# Extract point cloud
points = numpy.array(data.point_cloud, dtype=numpy.dtype('f4'))
points = numpy.reshape(points, (int(points.shape[0]/3), 3))
# Visualize point cloud
import rerun as rr
rr.log('lidar/points', rr.Points3D(points))
The structure of the output of client.getLidarData() can be seen at <airgen.types.LidarData>()