Cosys-AirSim icon indicating copy to clipboard operation
Cosys-AirSim copied to clipboard

LiDAR issues with the Multirotor vehicle

Open bucknercsamuel opened this issue 1 year ago • 5 comments

I wanted to report/get help on multiple issues I am experiencing when using the LiDAR functionalities with a multirotor vehicle.

(1) When I attempt to use GPULiDAR, I get an error saying this is incompatable with the multirotor model. Is this a bug, or a missing feature currently?

(2) I have a need to obtain a detailed pointcloud, and with this LiDAR design, this amounts to ~33k points for one full scan, which takes a non-negligible amount of time, and I also have my vehicle flying at a non-negligble speed. Consequently, the data from the scan does not appear to be position-adjusted for different sub-scans, so when flying the vehicle, I end up with a staggered pointcloud even when flying straight down and scanning a perpendicular plane. Is there any way to adjust for this without having to resort to hacky heuristics?

Note: this is the settings.json configuration I am currently using:

{
  "SimMode": "Multirotor",
  "RecordUIVisible": true,
  "MoveWorldOrigin": false,
  "LogMessagesVisible": true,
  "ShowLosDebugLines": false,
  "Vehicles": {
    "my_quad": {
      "VehicleType": "SimpleFlight",
      "AutoCreate": true,
      "Sensors": {
        "LiDAR": {
          "SensorType": 6,
          "Enabled" : true,
          "Range" : 500,
          "NumberOfChannels": 64,
          "RotationsPerSecond": 1,
          "MeasurementsPerCycle": 512,
          "X": 0, "Y": 0, "Z": 0,
          "Roll": 0, "Pitch": 0, "Yaw" : 0,
          "VerticalFOVUpper": -60,
          "VerticalFOVLower": -90,
          "DrawDebugPoints": true,
          "GenerateNoise": true
        }
      } 
    }
  }
}

bucknercsamuel avatar Dec 05 '24 02:12 bucknercsamuel

the GPULiDAR indeed does not work in its current implementation due to crashes related to the synchronization between game and render threads. An issue that has not been fixed or heavily investigated. Would likely require a rewrite to how the GPULiDAR works.

As for the scanning, not entirely understanding the question. 33k points should be doable in real-time on most systems, but with the rotation speed of 1Hz it will have the realistic outcome of having subscans taken at different positions as the lidar rotates around during the motion. Is this what you mean?

WouterJansen avatar Dec 05 '24 08:12 WouterJansen

Hey Wouter, thank you for the quick response. Regarding the second question, the scan rate for those 33k points, in terms of time it takes to to call client.getLidarData, is ~0.5 hz on my current computing hardware (aside: is this reasonable to expect from a modern gaming laptop?) -- this manifests as a large error in my resulting map construction due to the speed my vehicle is traveling at. I have also tested higher rotation/second values, however the scan rate still saturates in terms of performance at the aforementioned value of 0.5 hz, and the vertically-staggered pointcloud artifact is still observed. If there is still any confusion, let me know and I can try to clarify further.

bucknercsamuel avatar Dec 05 '24 08:12 bucknercsamuel

Apologies, mistakenly closed the issue, it has been re-opened.

bucknercsamuel avatar Dec 05 '24 08:12 bucknercsamuel

0.5 hz seems rather slow.

I am still not sure I fully grap the problem. You have set the RotationsPerSecond parameter to 1hz, so if you are traveling rather fast it will end up being indeed a staggered pointcloud as the simulation model realistically rotates the lidar around during that 1s period before the pointcloud gets updated.

WouterJansen avatar Dec 20 '24 14:12 WouterJansen

@WouterJansen

I have a similar problem with Lidar point cloud. I am getting Lidar data with the following setting in the settings.json:

          "LidarSensor1": { 
            "SensorType": 6,
            "Enabled": true,
            "External": false,
            "ExternalLocal": true,
            "NumberOfChannels": 32,
            "Range": 120,
            "RotationsPerSecond": 10,
            "MeasurementsPerCycle": 1024,
            "X": 0,
            "Y": 0,
            "Z": -0.55,
            "Roll": 0,
            "Pitch": 0,
            "Yaw": 0,
            "VerticalFOVUpper": 26.8,
            "VerticalFOVLower": -24.8,
            "HorizontalFOVStart": 0,
            "HorizontalFOVEnd": 360,
            "DrawDebugPoints": false,
            "IgnoreMarked": true,
            "GenerateNoise": true,
            "DrawSensor": false
          }

I am also pausing the simulation while acquiring Lidar data client_sim.call('simPause', True). However I get a point cloud with several gaps as in the following image. There is a difference between the gaps in terms of altitude (Z) because my drone is moving upwards and the difference between the highest and the lowest gap is of 2.7m with a drone speed of 5 m/s. Since I have set "RotationsPerSecond": 10 I should not have those gaps. Do you know what could be the problem?

Image

I also have a difference in terms of height (always because the drone is moving upwards) between the Lidar point cloud and the point cloud obtained from depth

Image

DanieleMarchisotti avatar Mar 20 '25 17:03 DanieleMarchisotti