ardupilot_gz icon indicating copy to clipboard operation
ardupilot_gz copied to clipboard

Add 3D Lidar to iris for usage with Bonxai mapping example

Open Ryanf55 opened this issue 1 year ago • 5 comments

Background

As explained in this Bonxai demo, the ardupilot_gz iris_lidar.launch.py assumes a 2D lidar and it must be modified. https://github.com/tejalbarnwal/3D-planning-with-bonxai

We'd like to add 3D lidar support that works out of the box without having to modify code here.

Approaches considered

  • rename the iris launch file to iris_lidar.launch.py to iris_2d_lidar.launch.py and duplicate the code for 3D lidar
  • Add a launch argument for 2d/3d in the launch file, rename iris_with_lidar to iris_with_2d_lidar and duplicate to iris_with_3d_lidar
  • Remove the lidar from iris_with_lidar and call it iris_ardupilot, and then add two new models iris_with_2d_lidar and iris_with_3d_lidar that only add the lidar link and the lidar sensor, then have the iris_with_lidar.launch.py pick which model based on an argument

How to select 2d/3d lidar in launch file?

DeclareLaunchArgument(
    "lidar_dimensions", default_value="2", description="Whether to use a 2D or 3D lidar"
),

Ryanf55 avatar Nov 20 '24 16:11 Ryanf55

FYI @tejalbarnwal

Ryanf55 avatar Nov 20 '24 16:11 Ryanf55

Hi, I prefer the third approach, where we use a base SDF file (e.g., iris_ardupilot) and build on it to add specific sensors like 2D/3D LiDAR, depth cameras, or RGB camera to create different models like iris_with_2D_lidar, iris_with_depth_camera, etc

My only concern is ensuring consistency between the model passed via the launch argument and the model included in the world files (e.g., iris_maze.sdf, iris_runway.sdf). The developer must manually ensure they match. or example, iris_maze.sdf references the iris_with_lidar model and defines its pose in the environment

A potential improvement would be to enable the independent spawning of the iris model in the world, separate from other Gazebo components, to simplify integration. However, I am unsure how this could be implemented.

tejalbarnwal avatar Nov 20 '24 17:11 tejalbarnwal

Hi, I prefer the third approach, where we use a base SDF file (e.g., iris_ardupilot) and build on it to add specific sensors like 2D/3D LiDAR, depth cameras, or RGB camera to create different models like iris_with_2D_lidar, iris_with_depth_camera, etc

My only concern is ensuring consistency between the model passed via the launch argument and the model included in the world files (e.g., iris_maze.sdf, iris_runway.sdf). The developer must manually ensure they match. or example, iris_maze.sdf references the iris_with_lidar model and defines its pose in the environment

A potential improvement would be to enable the independent spawning of the iris model in the world, separate from other Gazebo components, to simplify integration. However, I am unsure how this could be implemented.

Why don't we start with just the simple option 3 with manually ensured consistency. Did you want to take this on, or have me do it?

Ryanf55 avatar Nov 21 '24 04:11 Ryanf55

I will implement it tonight after my job and submit a PR.

tejalbarnwal avatar Nov 21 '24 08:11 tejalbarnwal

Hi @Ryanf55 , I have created a pull request and am still making a few minor changes, as described in the PR description. One difference from what was discussed in point 3 is that I did not create an iris_ardupilot model. The basic models already exist in the ardupilot_gazebo repository. This repo includes models like iris_with_ardupilot and iris_with_standoffs, which do not have any perception sensors. These models are already used internally by the iris_with_lidar model.

Let me know your reviews for the PR.

tejalbarnwal avatar Nov 27 '24 19:11 tejalbarnwal