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

ROS Jazzy support #6378

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pedro-fuoco
Copy link
Contributor

@pedro-fuoco pedro-fuoco commented Nov 7, 2024

Purpose

The migraton from ROS humble to ROS Jazzy is pretty trivial in our current setup. Simply checking out to the respective Jazzy branches is enough in linux.

We should support it and provide installation guides to encourage more ROS 2 users to contribute.

PR dependency

Comment on lines +28 to +40
.. tab:: Jazzy

.. code-block:: bash

cd ~/ardu_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/jazzy_gz.repos --recursive src

.. tab:: Humble

.. code-block:: bash

cd ~/ardu_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/humble_gz.repos --recursive src
Copy link
Contributor Author

Choose a reason for hiding this comment

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

for ardupilot_gz, we could separate branches Jazzy and Humble, but since most of the development team is still on Humble that might cause headaches syncing the two branches. Simply having two .repos files is proposed instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am happy with either approach. In a few other repos in Github, I started using mergify.io, so the work to maintain multiple branches is very low.

Comment on lines +13 to +33
.. group-tab:: ArduPilot 4.6 and later

.. code-block:: bash

source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ardu_ws/
colcon build --packages-up-to ardupilot_sitl
source install/setup.bash
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 refs:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/dds_xrce_profile.xml synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501

ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501

.. group-tab:: ArduPilot 4.6 and later
.. group-tab:: ArduPilot 4.5

.. code-block:: bash

source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ardu_ws/
colcon build --packages-up-to ardupilot_sitl
source install/setup.bash
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 refs:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/dds_xrce_profile.xml synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501


Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes the tab order so that ArduPilot's newest version appears first. Seems intuitive

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree on that change! Now that 4.6 is in beta.

@@ -17,49 +17,59 @@ Prerequisites

- Learn to use ArduPilot first by following the relevant wiki for `Rover <https://ardupilot.org/rover/index.html>`__, `Copter <https://ardupilot.org/copter/index.html>`__ or `Plane <https://ardupilot.org/plane/index.html>`__.
- In particular, make sure the vehicle works well in Manual and Autonomous modes like Guided and Auto before trying to use ROS.
- Learn how to use ROS 2 by reading the `beginner tutorials <https://docs.ros.org/en/humble/Tutorials.html>`__. In the case of a problem with ROS, it is best to ask on ROS community forums first (or google your error).
- Learn how to use ROS 2 by reading the `beginner tutorials <https://docs.ros.org/en/rolling/Tutorials.html>`__. In the case of a problem with ROS, it is best to ask on ROS community forums first (or google your error).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prefer to use ROS Rolling when linking to generic documentation. Since we now support multiple ROS 2 versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, can you add a note to select the right version in the dropdown?

Before anything else, make sure that you have `sourced your ROS 2 environment <https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files>`__
and check if it is `configured correctly <https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#check-environment-variables>`__.

Finally, ensure you have `set up your ArduPilot build environment <https://ardupilot.org/dev/docs/building-the-code.html#setting-up-the-build-environment>`__.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a pain point in the current installation instructions. The ArduPilot build environment should be built inside the ROS 2 workspace. If we tell the user to set it up here it might be confusing. So I moved this instruction further down.


.. code-block:: bash

cd ~/ardu_ws
sudo apt update
rosdep update
source /opt/ros/humble/setup.bash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be unnecessary, the instructions assume that the ROS environment is setup and this is explicitly stated at the start

Copy link
Contributor

Choose a reason for hiding this comment

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

It is not required for people to add this to your ~/.bashrc. I have tried to make the commands as foolproof as possible, and becuase of that, our support load has decreased a lot.

@pedro-fuoco
Copy link
Contributor Author

pedro-fuoco commented Nov 7, 2024

@Ryanf55 @srmainwaring let me know what you think

Copy link
Contributor

@Ryanf55 Ryanf55 left a comment

Choose a reason for hiding this comment

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

Nice! A good mix of unrelated improvements and direct instructions for Jazzy. It would be really cool if there was a way in rst to have a dropdown at the top to select your ROS version and Gazebo version, then the rest of the content just updates automatically. Can you take a look to see if there's anything better for this than the tab method?

.. code-block:: bash
.. tabs::

.. tab:: Jazzy
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
.. tab:: Jazzy
.. tab:: ROS 2 Jazzy

cd ~/ardu_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/jazzy_gz.repos --recursive src

.. tab:: Humble
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
.. tab:: Humble
.. tab:: ROS 2 Humble

Comment on lines +28 to +40
.. tab:: Jazzy

.. code-block:: bash

cd ~/ardu_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/jazzy_gz.repos --recursive src

.. tab:: Humble

.. code-block:: bash

cd ~/ardu_ws
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/humble_gz.repos --recursive src
Copy link
Contributor

Choose a reason for hiding this comment

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

I am happy with either approach. In a few other repos in Github, I started using mergify.io, so the work to maintain multiple branches is very low.

@@ -40,7 +52,7 @@ Update ROS dependencies:
.. code-block:: bash

cd ~/ardu_ws
source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert. ROS_DISTRO is not set until AFTER you run this.
Consider doing it like source /opt/ros/<your_ros_distro>/setup.bash

Comment on lines +13 to +33
.. group-tab:: ArduPilot 4.6 and later

.. code-block:: bash

source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ardu_ws/
colcon build --packages-up-to ardupilot_sitl
source install/setup.bash
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 refs:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/dds_xrce_profile.xml synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501

ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501

.. group-tab:: ArduPilot 4.6 and later
.. group-tab:: ArduPilot 4.5

.. code-block:: bash

source /opt/ros/humble/setup.bash
source /opt/ros/$ROS_DISTRO/setup.bash
cd ~/ardu_ws/
colcon build --packages-up-to ardupilot_sitl
source install/setup.bash
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py transport:=udp4 refs:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/dds_xrce_profile.xml synthetic_clock:=True wipe:=False model:=quad speedup:=1 slave:=0 instance:=0 defaults:=$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/copter.parm,$(ros2 pkg prefix ardupilot_sitl)/share/ardupilot_sitl/config/default_params/dds_udp.parm sim_address:=127.0.0.1 master:=tcp:127.0.0.1:5760 sitl:=127.0.0.1:5501


Copy link
Contributor

Choose a reason for hiding this comment

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

Agree on that change! Now that 4.6 is in beta.

@@ -17,49 +17,59 @@ Prerequisites

- Learn to use ArduPilot first by following the relevant wiki for `Rover <https://ardupilot.org/rover/index.html>`__, `Copter <https://ardupilot.org/copter/index.html>`__ or `Plane <https://ardupilot.org/plane/index.html>`__.
- In particular, make sure the vehicle works well in Manual and Autonomous modes like Guided and Auto before trying to use ROS.
- Learn how to use ROS 2 by reading the `beginner tutorials <https://docs.ros.org/en/humble/Tutorials.html>`__. In the case of a problem with ROS, it is best to ask on ROS community forums first (or google your error).
- Learn how to use ROS 2 by reading the `beginner tutorials <https://docs.ros.org/en/rolling/Tutorials.html>`__. In the case of a problem with ROS, it is best to ask on ROS community forums first (or google your error).
Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, can you add a note to select the right version in the dropdown?


.. code-block:: bash

cd ~/ardu_ws
sudo apt update
rosdep update
source /opt/ros/humble/setup.bash
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not required for people to add this to your ~/.bashrc. I have tried to make the commands as foolproof as possible, and becuase of that, our support load has decreased a lot.

sudo apt install default-jre
# Gradle 7.6 is not supported by java versions >= 20
# https://docs.gradle.org/current/userguide/compatibility.html
sudo apt install openjdk-17-jre
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this available on Ubuntu 22?

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.

2 participants