docs/lidar.md
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.
"Lidar1": {
"SensorType": 6,
"Enabled" : true,
}
The following parameters can be configured right now via settings json.
| Parameter | Description |
|---|---|
| NumberOfChannels | Number of channels/lasers of the lidar |
| Range | Range, in meters |
| PointsPerSecond | Number of points captured per second |
| RotationsPerSecond | Rotations per second |
| HorizontalFOVStart | Horizontal FOV start for the lidar, in degrees |
| HorizontalFOVEnd | Horizontal FOV end for the lidar, in degrees |
| VerticalFOVUpper | Vertical FOV upper limit for the lidar, in degrees |
| VerticalFOVLower | Vertical FOV lower limit for the lidar, in degrees |
| X Y Z | Position of the lidar relative to the vehicle (in NED, in meters) |
| Roll Pitch Yaw | Orientation of the lidar relative to the vehicle (in degrees, yaw-pitch-roll order to front vector +X) |
| DataFrame | Frame for the points in output ("VehicleInertialFrame" or "SensorLocalFrame") |
| ExternalController | Whether data is to be sent to external controller such as ArduPilot or PX4 if being used (default true) (PX4 doesn't send Lidar data currently) |
e.g.
{
"SeeDocsAt": "https://microsoft.github.io/AirSim/settings/",
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"Vehicles": {
"Drone1": {
"VehicleType": "simpleflight",
"AutoCreate": true,
"Sensors": {
"LidarSensor1": {
"SensorType": 6,
"Enabled" : true,
"NumberOfChannels": 16,
"RotationsPerSecond": 10,
"PointsPerSecond": 100000,
"X": 0, "Y": 0, "Z": -1,
"Roll": 0, "Pitch": 0, "Yaw" : 0,
"VerticalFOVUpper": -15,
"VerticalFOVLower": -25,
"HorizontalFOVStart": -20,
"HorizontalFOVEnd": 20,
"DrawDebugPoints": true,
"DataFrame": "SensorLocalFrame"
},
"LidarSensor2": {
"SensorType": 6,
"Enabled" : true,
"NumberOfChannels": 4,
"RotationsPerSecond": 10,
"PointsPerSecond": 10000,
"X": 0, "Y": 0, "Z": -1,
"Roll": 0, "Pitch": 0, "Yaw" : 0,
"VerticalFOVUpper": -15,
"VerticalFOVLower": -25,
"DrawDebugPoints": true,
"DataFrame": "SensorLocalFrame"
}
}
}
}
}
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.
"Lidar1": {
...
"DrawDebugPoints": true
},
Note: Enabling DrawDebugPoints can cause excessive memory usage and crash in releases v1.3.1, v1.3.0. This has been fixed in the main branch and should work in later releases
Use getLidarData() API to retrieve the Lidar data.
VehicleInertialFrame -- default; returned points are in vehicle inertial frame (in NED, in meters)SensorLocalFrame -- returned points are in lidar local frame (in NED, in meters)