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

Add tutorial on how to a migrate ROS 2 package that uses Gazebo Classic #425

Merged
merged 16 commits into from
Feb 14, 2024

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Feb 3, 2024

🎉 New feature

Summary

Walks the user through migrating the turtlebot3_simulations package (humble-devel branch).

TODO:

  • Add pictures
  • Fill in the camera section.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested a review from mabelzhang as a code owner February 3, 2024 00:16
@azeey azeey requested a review from kscottz February 3, 2024 00:16
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Feb 3, 2024
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
limit on the whole vehicle's linear acceleration. We can approximate the value
by multiplying the wheel acceleration limit by the radius of the wheel. Refer to
the
[DiffDrive class reference](https://gazebosim.org/api/gazebo/6/classignition_1_1gazebo_1_1systems_1_1DiffDrive.html)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tutorial is in the harmonic folder

Suggested change
[DiffDrive class reference](https://gazebosim.org/api/gazebo/6/classignition_1_1gazebo_1_1systems_1_1DiffDrive.html)
[DiffDrive class reference](https://gazebosim.org/api/sim/8/classgz_1_1sim_1_1systems_1_1DiffDrive.html)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tutorial is actually not in the harmonic folder. I started it there, but moved it before I pushed. I forgot to remove it from the harmonic/index.yaml though.

Since this tutorial is targeting humble, I thought it would be best to link to Fortress documentation, but maybe I should link to both?

### libgazebo_ros_joint_state_publisher.so

We will replace this plugin as well with
[`JointStatePublisher`](https://gazebosim.org/api/gazebo/6/classignition_1_1gazebo_1_1systems_1_1JointStatePublisher.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[`JointStatePublisher`](https://gazebosim.org/api/gazebo/6/classignition_1_1gazebo_1_1systems_1_1JointStatePublisher.html).
[`JointStatePublisher`](https://gazebosim.org/api/sim/8/classgz_1_1sim_1_1systems_1_1JointStatePublisher.html).

migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
azeey added 2 commits February 5, 2024 16:51
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Copy link
Collaborator

@kscottz kscottz left a comment

Choose a reason for hiding this comment

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

This is a fantastic start and a ton of work! I think everyone is going to love it.

I tried to make most of my comments as suggestions to make things easier on you.

I have a couple of document-level comments to make:

  • I don't think many readers are actually going to physically work through the tutorial process, they're primarily going to read through the document and look at the steps involved. For this reason I think it is really important for us to have links to each file before and after modification so they can see the results side by side. I tried to add as many links as I could, but I may have missed some things.
  • The "Modify the Model" section could use a little bit more work. I didn't quite understand why the sections were titled by the library file used (e.g. libgazebo_ros_ray_sensor.so etc). I think we might want a longer explanation at the top of the file. We should probably write a stand alone document that explains the SDF upgrade process in greater detail. In particular, it is unclear to me how you know what plugin to use for each section of the SDF. Do we have a list or table somewhere that outlines all of the plugins and their mappings? I feel like that would be a great resource for people upgrading complex SDF files.

migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
Comment on lines 7 to 10
Another major difference is that `gazebo_ros_pkgs` provided a set of plugins
that directly get loaded by Gazebo Classic and run as part of the simulation to
provide an interface between ROS and Gazebo Classic. On the other hand, the
primary mode `ros_gz` is used as bridge between ROS and gz-transport topics.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Another major difference is that `gazebo_ros_pkgs` provided a set of plugins
that directly get loaded by Gazebo Classic and run as part of the simulation to
provide an interface between ROS and Gazebo Classic. On the other hand, the
primary mode `ros_gz` is used as bridge between ROS and gz-transport topics.
Another major difference is that while [gazebo_ros_pkgs](https://github.com/ros-simulation/gazebo_ros_pkgs) provided a set of plugins
that directly get loaded by Gazebo Classic and run as part of the simulation to
provide an interface between ROS and Gazebo Classic,
[ros_gz](https://github.com/gazebosim/ros_gz) does not provide plugins but is used as bridge between ROS and gz-transport topics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In light of gazebosim/ros_gz#490, I want to avoid saying ros_gz doesn't provide plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded in 5547582. What do you think?

azeey and others added 11 commits February 6, 2024 18:53
Co-authored-by: Katherine Scott <katherineAScott@gmail.com>
Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
Co-authored-by: Steve Peters <computersthatmove@gmail.com>
Co-authored-by: Katherine Scott <katherineAScott@gmail.com>
Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
Co-authored-by: Katherine Scott <katherineAScott@gmail.com>
Signed-off-by: Addisu Z. Taddese <addisuzt@intrinsic.ai>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Copy link
Contributor Author

@azeey azeey left a comment

Choose a reason for hiding this comment

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

I think I've addressed all the feedback. I've also added the camera section and a couple of screenshots. Please take a look.

migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Show resolved Hide resolved
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
`turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf`. The changes we need to
make are mostly related to plugins and their parameters.

### libgazebo_ros_imu_sensor.so
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a few sentences to explain the steps: 298fa22

</link>
```

### libgazebo_ros_ray_sensor.so
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Responded in previous comment.

so will not add any default plugins. Therefore, we have to add the additional
plugins for IMU and Lidar sensors as well as the ones that would have been added
by default. We will once again edit `turtlebot3_gazebo/worlds/empty_world.world`
add the following right after `<world name="default">`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about this:

image


## Bridge ROS topics

The plugins in `gazebo_ros_pkgs` are Gazebo plugins that are also ROS nodes. In
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworded in e39cabe

migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
@azeey azeey requested review from ahcorde and kscottz February 13, 2024 18:34
migrating_gazebo_classic_ros2_packages.md Outdated Show resolved Hide resolved
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit f5f9946 into gazebosim:master Feb 14, 2024
1 check passed
@azeey azeey deleted the classic_migration branch February 14, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants