Skip to content
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

Migration to ROS 2 and new Gazebo #283

Open
7 tasks
mabelzhang opened this issue Dec 8, 2023 · 7 comments
Open
7 tasks

Migration to ROS 2 and new Gazebo #283

mabelzhang opened this issue Dec 8, 2023 · 7 comments

Comments

@mabelzhang
Copy link
Contributor

mabelzhang commented Dec 8, 2023

Original discussion in #276

DAVE is no longer being actively developed. It is being maintained on a volunteer basis by the community, largely dependent on individuals' availability. This migration effort is also expected to be carried out by the community, whoever interested. (At the time of writing, you can find those people in ROS Maritime Working Group meetings.)

This ticket outlines the items suggested to be done for a migration. The list is not exhaustive, and the ticket is expected to be edited as more things arise. We may turn some bullet items into tickets to track a task in detail.

Note that there are multiple parts to the migration - ROS, Gazebo, and the bridge between them. They should be tackled in pieces.

Suggested workflow

I would suggest people pick small items one at a time, and comment here which part you are working on, so that others have visibility and do not duplicate your work. We can add names to bullet items to make that organized and clear.

I would suggest creating a branch (named by the ROS 2 and Gazebo distro) in this repo. People can open PRs from their forks to target. You can fork the repository to work on your task. Each task should be in a separate PR.

Selecting the version of ROS 2 and new Gazebo

The official recommendation is in the table here.

What's not yet on the page is that Gazebo Harmonic will be paired with ROS 2 Jazzy, when Jazzy is released in May 2024. What is currently ROS 2 Rolling will become Jazzy.

If considering selecting a pairing that's not officially supported (very likely, because we should upstream contributions to Gazebo), make sure to read "Using a specific and unsupported Gazebo version with ROS 2" section on this page.

Migrating to New Gazebo

See migration tutorials from Gazebo-classic to new Gazebo.

  • SDF model files
  • Gazebo plugins

Upstreaming DAVE SDF models to Fuel

Gazebo Fuel is a free online dataset with Gazebo models that are ready to plug and play. It has a web interface that allows users to browse, preview, and download SDF models.

This is the lowest hanging fruit in this migration. We had already upstreaming newly created models to the DAVE collection on Fuel. It remains to upstream existing models to the same collection. As models are upstreamed, they can be deleted in this repo.

Example PRs that upstreamed new models to Fuel:

Related issue:

Upstreaming DAVE Gazebo plugins to new Gazebo

To ensure future maintenance of DAVE, it is very important that models and Gazebo plugins being ported to new Gazebo are upstreamed to Gazebo as much as possible, as opposed to just remaining in this repo, which is likely to go out of maintenance again, like many other marine simulators. Once they become built-in to Gazebo, they will be maintained in the future by Gazebo developers and can be used by everybody, beyond DAVE users.

Upstreaming things adds some overhead, because code needs to be formatted following Gazebo styling, and code takes longer to review upstream and get merged. However, the plus side is, they WILL get reviewed by the Gazebo team. PRs in DAVE are not guaranteed to be reviewed, since maintenance availability is very low in DAVE right now.

To write code intended for upstreaming, see Gazebo contributing guide, which contains the style guide. You can also see general styling in gz-sim and other gz-* libraries. DAVE GitHub workflow may need to be updated to check the style.

Some things in this repo have already been upstreamed to new Gazebo, including but not limited to the list below. You don't need to repeat the effort. There might be others. Check all existing systems (plugins) in gz-sim/src/systems and the Feature Comparison page before porting a plugin.

Migrating to ROS 2

Migration tutorials from ROS 1 to ROS 2: https://docs.ros.org/en/iron/How-To-Guides/Migrating-from-ROS1.html

I think these are the main files in DAVE that need migrating, there may be more:

Migrating bridge and integration between ROS and Gazebo

See integration tutorials for integrating new Gazebo with ROS.

  • URDF/SDFs. Theoretically, SDF format can now be used for both ROS and Gazebo. You may not need to convert URDF to SDF, but that needs to be tested for all the robots in this repo. See sdformat_urdf.
  • Bridge. Unfortunately, we don't have a tutorial for migrating from gazebo_ros_pkgs to ros_gz, which is the bridge to talk between ROS and Gazebo. But you can look at reference examples below to see how it is done.

Reference examples

  • VRX is a good example to look at, which has been ported from ROS 1 + Gazebo 11 to ROS 2 + new Gazebo. It uses hydrodynamics, buoyancy, and other marine-specific features that OSRF had already ported to new Gazebo for other projects. DAVE should use those upstream instead of repeating those porting efforts. https://github.com/osrf/vrx/tree/main/vrx_gz
    It uses the ROS 2 <-> gz bridge.
    Note that they use Python launch files. I think you should be able to keep XML.

  • MBZIRC does similar in ROS 2 + new Gazebo https://github.com/osrf/mbzirc

Implementation suggestion

I might suggest this order of operation:

  1. The simplest things to start with would be the Gazebo SDF models - upstreaming the SDF models to Fuel https://app.gazebosim.org/dashboard , updating the files to the new URL on Fuel. As you upstream, you'd delete them from the repo (in a new branch of course). Make sure that still works.
  2. Then maybe the URDF models, to make sure robots still load.
  3. Then try the hydrodynamics and buoyancy plugins in new Gazebo, see if things still behave correctly.
  4. I would save the plugins for the very last, because they're likely the most complicated to migrate. Maybe Gazebo plugins are more isolated (I haven't looked at them). ROS plugins probably have more dependency as it would require the ros_gz bridge.
@mabelzhang
Copy link
Contributor Author

@caguero Thanks for the input! Does anything jump out to you, or anything to add? (Not to ask you to read the whole thing 😅)

@woensug-choi
Copy link
Collaborator

Google Summer of Codes program is on for this subject!
Kanban board for this summer project is at
https://yeongdocat.notion.site/GSoC-2024-Open-Robotics-Dave-Multibeam-Sonar-371f9005851e4682a0128b800ec08542?pvs=4

@mabelzhang
Copy link
Contributor Author

For visibility, GSoC ongoing work is in a fork: https://github.com/IOES-Lab/dave

@samiamlabs
Copy link

Hi!

We had a lunch meetup for maritime robotics on roscon today, and I got a tip that someone was working on porting the simulated sonar to the new gazebo. We have really been missing it here in Gazebo Garden land...

It looks like that tip was correct based on the previous comments here!

Any updates on the status of the migration? @woensug-choi @mabelzhang

@woensug-choi
Copy link
Collaborator

@samiamlabs We are on final packaging process! expexted to be merged before christmas! but multibeam sonar will take some more time!

@samiamlabs
Copy link

Ok, thanks for the info and the good work @woensug-choi !

Is it possible to access working code for multibeam sonar already on the fork?

@woensug-choi
Copy link
Collaborator

@samiamlabs unfortunately not. still on the migration of dave to ros jazzy gazebo harmonic(verson 1.0) sonar and ardupilot will come as version 1.1

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

No branches or pull requests

3 participants