How to Use Lidar in AirSim¶
AirSim supports Lidar for multirotors and cars.
The enablement of lidar and the other lidar settings can be configured via AirSimSettings json. Please see general sensors for information on configruation of general/shared sensor settings.
Enabling lidar on a vehicle¶
- By default, lidars are not enabled. To enable lidar, set the SensorType and Enabled attributes in settings json.
- Multiple lidars can be enabled on a vehicle.
Ignoring glass and other material types¶
One can set an object that should be invisible to LIDAR sensors (such as glass) to have no collision for Unreal Traces in order to have it be 'invisible' for lidar sensors.
Lidar configuration¶
The following parameters can be configured right now via settings json.
Server side visualization for debugging¶
By default, the lidar points are not drawn on the viewport. To enable the drawing of hit laser points on the viewport, please enable setting DrawDebugPoints via settings json.
Client API¶
Use getLidarData(sensor name, vehicle name) API to retrieve the Lidar data. The API returns a full scan Point-Cloud as a flat array of floats along with the timestamp of the capture and lidar pose.
- Point-Cloud: The floats represent [x,y,z] coordinate for each point hit within the range in the last scan in NED format. It will be [0,0,0] for a laser that didn't get any reflection (out of range).
- Pose: Default: Sensor pose in the vehicle frame / External: If set to
External(see table) the coordinates will be in either Unreal NED whenExternalLocalisfalseor Local NED (from starting position from vehicle) whenExternalLocalistrue. - Groundtruth: For each point of the Point-Cloud a label string is kept that has the name of the object that the point belongs to a laser that didn't reflect anything will have label out_of_range.