Skip to content

Multibeam Sonar Migration Template #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 144 commits into
base: ros2
Choose a base branch
from
Open

Conversation

woensug-choi
Copy link

@woensug-choi woensug-choi commented Aug 19, 2024

This is to fastforward the effort the migration of the Muiltibeam Sonar plugin.

Notion note related to this is at https://yeongdocat.notion.site/Multibeam-Sonar-Plugin-Migration-Memo-3a98b778e87a419b9adf32a88d78814c?pvs=4

Example Launch Command with ros_gz_bridge to translate gz msg to ROS msg

  • This doesn't work as expected since the ros_gz_bridge is not updated for new sensors in new ros-gazebo pair yet
ros2 launch dave_multibeam_sonar_demo multibeam_sonar_demo.launch.py

Example Launch Command with dave_sensor.launch.py

ros2 launch dave_demos dave_sensor.launch.py namespace:=blueview_p900 world_name:=dave_multibeam_sonar paused:=false x:=4 z:=0.5 yaw:=3.14

Progress (Check date of the update, I am updating this as I progress)

  • Copy and rename the generic dvl plugin of gazebo offical https://github.com/gazebosim/gz-sim/tree/gz-sim8/src/systems/dvl
  • Sample world file including system plugin and the sensor plugin
    ros2 launch dave_demos dave_world.launch.py world_name:=dave_multibeam_sonar verbose:=true
  • Launch system with sensor sample in empty world with objects
    ros2 launch dave_demos multibeam_sonar_standalone.launch.py x:=4.0 z:=0.5 Y:=3.14
  • Insert codes of GPU Lidar to publish point cloud
  • Rebase to recent DVL plugin PR
  • Blueview model description sdf
  • Add plugin to translate gz point cloud msg to ROS
    - RosGzPointCloud Not Loading gazebosim/ros_gz#549 (comment)
    - Something is very wrong when trying to view point cloud at current state
    - So many tutorials in ros_gz_sim_demo just doesn't work, but ros2 launch ros_gz_sim_demos gpu_lidar_bridge.launch.py works!
    - This uses GPULidar sensor. I would try remove all Acoustic Beam parts and hard insert GPU Lidar Code as it is to visualize point cloud correctly
  • Add tag handles to read multibeam sonar parameters from SDF
  • Construct a dataset to pipeline into CUDA code
  • Insert CUDA code wrapper function
  • Conditional CMAKE to check wether the machine has CUDA building and runtime library
  • Add plugin to translate sonar image msg to ROS

Leftover

Copy link
Collaborator

@rakeshv24 rakeshv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested a few more changes.

Additionally, please include the config script for ROS2 topic bridges when spawning the sensor model as discussed. Let me know if you need help with that!

@rakeshv24 rakeshv24 self-requested a review July 11, 2025 21:30
Copy link
Collaborator

@rakeshv24 rakeshv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmoyen thanks for making the changes! I have a few more suggestions.

I'm not sure why but the point cloud does not show up for me. Any idea why?

Can you also include the sonar plugin to the BlueROV (to the front bottom of the vehicle) for demo purposes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is correct, please follow the same format as in upload_robot.py for consistency.

Make use of PathJoinSubstitution rather than the os.path.join . Also, launch_setup function is not required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the changes now. I used launch_setup because most sensor models don’t have a config file, only the multibeam sonar models do. I couldn’t find a clean way to handle the missing file during launch.

Copy link
Collaborator

@hmoyen hmoyen Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the point cloud, it's a difference between the topic names in the launch file and SDF model that is causing the error. I will correct it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, makes sense! I have made some changes as well - pushing now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve added the BlueROV2 example, let me know if that's what you had in mind. I copied the bluerov2_heavy model and attached the plugin into the robot. I also created a new demo world with some cylinders to help test and visualize the results. The documentation has also been updated : Wiki.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmoyen Rather than creating a new robot model for this example, it would be better to attach the sensor plugin to the existing bluerov, rexrov, and bluerov2_heavy as how the other sensors are attached. The purpose is to showcase the robots being spawned with full capability that includes all the important sensors on board.

Let me know if you need help with this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! I will add to the bluerov2_heavy model then

Copy link
Collaborator

@rakeshv24 rakeshv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmoyen Can you include an example of the sonar plugin added to BlueROV2 for demo purposes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, makes sense! I have made some changes as well - pushing now.

Copy link
Collaborator

@rakeshv24 rakeshv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmoyen Looks good to me!

One last thing we need to look at is:
"What happens if the machine doesn’t have CUDA installed? would it prevent from compiling with colcon build?"

@hmoyen
Copy link
Collaborator

hmoyen commented Jul 17, 2025

@hmoyen Looks good to me!

One last thing we need to look at is: "What happens if the machine doesn’t have CUDA installed? would it prevent from compiling with colcon build?"

In the multibeam_sonar package CMake we have:

find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
...
else()
  message(STATUS "CUDA Toolkit not found: Skipping CUDA-specific targets")
endif()

Is it failing to build on non CUDA platforms?

@rakeshv24
Copy link
Collaborator

rakeshv24 commented Jul 17, 2025

@hmoyen Looks good to me!
One last thing we need to look at is: "What happens if the machine doesn’t have CUDA installed? would it prevent from compiling with colcon build?"

In the multibeam_sonar package CMake we have:

find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
...
else()
  message(STATUS "CUDA Toolkit not found: Skipping CUDA-specific targets")
endif()

Is it failing to build on non CUDA platforms?

Yes, the build is still failing on non CUDA platforms.

But I found a fix. Currently, only multibeam_sonar package has the if flag on its CMakeLists. You would have to do the same for multibeam_sonar_demo and multibeam_sonar_system.

@rakeshv24
Copy link
Collaborator

@hmoyen Ready to merge! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants