Skip to content

Commit

Permalink
Improve ROS2 docs
Browse files Browse the repository at this point in the history
* Consistent rosdep instructions
* Add next steps to make order clearer
* Put MavProxy in the SITL tutorial

Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 authored and Hwurzburg committed Dec 7, 2023
1 parent 72b5005 commit eca755f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
7 changes: 0 additions & 7 deletions dev/source/docs/ros2-cartographer-slam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ In another terminal, run:
source ~/ros2_ws/install/setup.sh
ros2 launch ardupilot_ros cartographer.launch.py
To test and fly around, you can launch a `mavproxy <https://ardupilot.org/dev/docs/copter-sitl-mavproxy-tutorial.html>`__ instance in yet another terminal:

.. code-block:: bash
mavproxy.py --console --map --aircraft test --master=:14550
Configure ArduPilot
===================

Expand Down
12 changes: 9 additions & 3 deletions dev/source/docs/ros2-gazebo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ Update ROS dependencies:
source /opt/ros/humble/setup.bash
sudo apt update
rosdep update
rosdep install --rosdistro $ROS_DISTRO --from-paths src -i -r -y
rosdep install --from-paths src --ignore-src -r
Build:

.. code-block:: bash
cd ~/ros2_ws
colcon build --packages-up-to ardupilot_gz_bringup --cmake-args -DBUILD_TESTING=ON
colcon build --packages-up-to ardupilot_gz_bringup
If you'd like to test your installation, run:

Expand Down Expand Up @@ -77,4 +77,10 @@ Examples available
Here is a demo video of Ardupilot working with ROS 2 and Gazebo:

.. youtube:: HZKXrSAE-ac
:width: 100%
:width: 100%


Next up
=======

Run Cartographer SLAM in :ref:`Cartographer SLAM with ROS 2 in SITL <ros2-cartographer-slam>`
20 changes: 19 additions & 1 deletion dev/source/docs/ros2-sitl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ If the ROS 2 topics aren't being published, set the ardupilot parameter DDS_ENAB
For more information refer to `ardupilot/Tools/ros2/README.md <https://github.com/ArduPilot/ardupilot/tree/master/Tools/ros2#readme>`__. There you can find examples of launches using serial connection instead of udp, as well as a step-by-step breakdown of what the launch files are doing.

Once everything is running, you can now interract with ArduPilot through the ROS 2 CLI.
ROS 2 CLI
=========

Once everything is running, you can now interact with ArduPilot through the ROS 2 CLI.

.. code-block:: bash
Expand All @@ -36,3 +39,18 @@ Once everything is running, you can now interract with ArduPilot through the ROS
ros2 node info /ardupilot_dds
# Echo a topic published from ArduPilot
ros2 topic echo /ap/geopose/filtered
MAVProxy
========

To test and fly around, you can launch a `mavproxy <https://ardupilot.org/dev/docs/copter-sitl-mavproxy-tutorial.html>`__ instance in yet another terminal:

.. code-block:: bash
mavproxy.py --console --map --aircraft test --master=:14550
Next up
=======

Add Gazebo in :ref:`ROS 2 with Gazebo <ros2-gazebo>`
2 changes: 1 addition & 1 deletion dev/source/docs/ros2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ And finally, build your workspace:
.. code-block:: bash
cd ~/ros2_ws
colcon build --packages-up-to ardupilot_dds_tests --cmake-args -DBUILD_TESTING=ON
colcon build --packages-up-to ardupilot_dds_tests
If you'd like to test your installation, run:

Expand Down

0 comments on commit eca755f

Please sign in to comment.