Skip to content

Commit 0bcfaad

Browse files
committed
ROS Jazzy support
1 parent 57865ea commit 0bcfaad

File tree

3 files changed

+70
-34
lines changed

3 files changed

+70
-34
lines changed

dev/source/docs/ros2-gazebo.rst

+18-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,28 @@ Ensure you have the prerequisites complete and working before beginning this Gaz
1717
Install Gazebo
1818
==============
1919

20-
First, install `Gazebo Harmonic (recommended) <https://gazebosim.org/docs/harmonic/install>`__ or `Gazebo Garden <https://gazebosim.org/docs/garden/install>`__.
20+
First, install `Gazebo Harmonic (recommended) <https://gazebosim.org/docs/harmonic/install>`__ or `Gazebo Garden <https://gazebosim.org/docs/garden/install>`__. Please check the `Compatibility Matrix between ROS and Gazebo versions <https://gazebosim.org/docs/latest/ros_installation/#summary-of-compatible-ros-and-gazebo-combinations>`__.
2121

2222
Next, set up all the necessary ROS 2 packages in the workspace.
2323

24-
We will clone the required repositories using `vcstool <https://github.com/dirk-thomas/vcstool>`__ and a `ros2.repos` files:
24+
We will clone the required repositories using `vcstool <https://github.com/dirk-thomas/vcstool>`__ and a `.repos` files:
2525

26-
.. code-block:: bash
26+
.. tabs::
27+
28+
.. tab:: Jazzy
29+
30+
.. code-block:: bash
31+
32+
cd ~/ardu_ws
33+
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/jazzy_gz.repos --recursive src
34+
35+
.. tab:: Humble
36+
37+
.. code-block:: bash
38+
39+
cd ~/ardu_ws
40+
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/humble_gz.repos --recursive src
2741
28-
cd ~/ardu_ws
29-
vcs import --input https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/ros2_gz.repos --recursive src
3042
3143
Set the Gazebo version to either ``harmonic`` (recommended) or ``garden``.
3244
It's recommended to set this in your `~/.bashrc` file.
@@ -40,7 +52,7 @@ Update ROS dependencies:
4052
.. code-block:: bash
4153
4254
cd ~/ardu_ws
43-
source /opt/ros/humble/setup.bash
55+
source /opt/ros/$ROS_DISTRO/setup.bash
4456
sudo apt update
4557
rosdep update
4658
rosdep install --from-paths src --ignore-src -r

dev/source/docs/ros2-sitl.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,27 @@ You will need to run this command on every new shell you open to have access to
1010

1111
.. tabs::
1212

13-
.. group-tab:: ArduPilot 4.5
13+
.. group-tab:: ArduPilot 4.6 and later
1414

1515
.. code-block:: bash
1616
17-
source /opt/ros/humble/setup.bash
17+
source /opt/ros/$ROS_DISTRO/setup.bash
1818
cd ~/ardu_ws/
1919
colcon build --packages-up-to ardupilot_sitl
2020
source install/setup.bash
21-
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
22-
21+
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
2322
24-
.. group-tab:: ArduPilot 4.6 and later
23+
.. group-tab:: ArduPilot 4.5
2524

2625
.. code-block:: bash
2726
28-
source /opt/ros/humble/setup.bash
27+
source /opt/ros/$ROS_DISTRO/setup.bash
2928
cd ~/ardu_ws/
3029
colcon build --packages-up-to ardupilot_sitl
3130
source install/setup.bash
32-
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
31+
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
32+
33+
3334
3435
3536

dev/source/docs/ros2.rst

+44-21
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,59 @@ Prerequisites
1717

1818
- 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>`__.
1919
- In particular, make sure the vehicle works well in Manual and Autonomous modes like Guided and Auto before trying to use ROS.
20-
- 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).
20+
- 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).
2121

2222
We are keen to improve ArduPilot's support of ROS 2 so if you find issues (such as commands that do not seem to be supported), please report them in the `ArduPilot issues list <https://github.com/ArduPilot/ardupilot/issues>`__. A maintainer can add the `ROS` tag.
2323

24-
First, make sure that you have successfully installed `ROS 2 Humble <https://docs.ros.org/en/humble/Installation.html>`__ .
25-
Currently, ROS 2 Humble is the only version supported.
24+
First, make sure that you have successfully installed and configured your ROS 2 environment. ArduPilot supports ROS 2 `Humble <https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html>`__ and `Jazzy <https://docs.ros.org/en/jazzy/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html>`__.
2625

27-
You are about to create a new `ROS 2 workspace <https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html#id4>`__.
28-
This page assumes that your workspace is named `ardu_ws` in your home directory, but feel free to adjust to your preferred location.
29-
30-
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>`__
31-
and check if it is `configured correctly <https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#check-environment-variables>`__.
32-
33-
Finally, ensure you have `set up your ArduPilot build environment <https://ardupilot.org/dev/docs/building-the-code.html#setting-up-the-build-environment>`__.
26+
This document suggests creating a new ROS 2 workspace from scratch, named `ardu_ws`, located in your home folder. If you already have a working ROS 2 workspace, feel free to adapt the instructions to your needs.
3427

3528
Installation (Ubuntu)
3629
=====================
3730

38-
To make installation easy, we will clone the required repositories using `vcs` and a `ros2.repos` files:
31+
To make installation easy, we will clone the required repositories using `vcs` and a `.repos` files:
3932

40-
.. code-block:: bash
33+
.. tabs::
4134

42-
mkdir -p ~/ardu_ws/src
43-
cd ~/ardu_ws
44-
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2.repos src
35+
.. tab:: Jazzy
36+
37+
.. code-block:: bash
38+
39+
mkdir -p ~/ardu_ws/src
40+
cd ~/ardu_ws
41+
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/jazzy.repos src
42+
43+
.. tab:: Humble
44+
45+
.. code-block:: bash
46+
47+
mkdir -p ~/ardu_ws/src
48+
cd ~/ardu_ws
49+
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/humble.repos src
4550
4651
This will take a few minutes to clone all the repositories your first time.
4752

48-
Now update all dependencies:
53+
.. warning::
54+
The `ardupilot` repository will be cloned in the `~/ardu_ws/src` folder during this process. Before proceeding, `set up your ArduPilot build environment <https://ardupilot.org/dev/docs/building-the-code.html#setting-up-the-build-environment>`__ inside the ROS 2 workspace.
55+
If you already have a working ArduPilot build environment, you may move it inside the workspace instead, but be sure to change all script references too. It might be a good idea to check your `.bashrc`.
56+
57+
Now update all dependencies using `rosdep`:
4958

5059
.. code-block:: bash
5160
5261
cd ~/ardu_ws
5362
sudo apt update
5463
rosdep update
55-
source /opt/ros/humble/setup.bash
5664
rosdep install --from-paths src --ignore-src -r -y
5765
5866
Installing the `MicroXRCEDDSGen` build dependency:
5967

6068
.. code-block:: bash
6169
62-
sudo apt install default-jre
70+
# Gradle 7.6 is not supported by java versions >= 20
71+
# https://docs.gradle.org/current/userguide/compatibility.html
72+
sudo apt install openjdk-17-jre
6373
cd ~/ardu_ws
6474
git clone --recurse-submodules https://github.com/ardupilot/Micro-XRCE-DDS-Gen.git
6575
cd Micro-XRCE-DDS-Gen
@@ -133,10 +143,23 @@ Installation (MacOS)
133143

134144
To make installation easy, we will install the required packages using `vcs` and a `ros2_macos.repos` files:
135145

136-
.. code-block:: bash
146+
.. tabs::
137147

138-
cd ~/ardu_ws
139-
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/ros2_macos.repos src
148+
.. tab:: Jazzy
149+
150+
.. code-block:: bash
151+
152+
mkdir -p ~/ardu_ws/src
153+
cd ~/ardu_ws
154+
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/jazzy_macos.repos src
155+
156+
.. tab:: Humble
157+
158+
.. code-block:: bash
159+
160+
mkdir -p ~/ardu_ws/src
161+
cd ~/ardu_ws
162+
vcs import --recursive --input https://raw.githubusercontent.com/ArduPilot/ardupilot/master/Tools/ros2/humble_macos.repos src
140163
141164
Now update all dependencies:
142165

0 commit comments

Comments
 (0)