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

Added instructions to use Gazebo sources with rosdep #6656

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions dev/source/docs/ros2-gazebo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Prerequisites

Ensure you have the prerequisites complete and working before beginning this Gazebo tutorial.

#. :ref:`Install ROS 2 <ros2>`
#. :ref:`Install ROS 2 <ros2>`
#. :ref:`Install and Run ROS 2 with ArduPilot SITL <ros2-sitl>`

Install Gazebo
Expand All @@ -35,15 +35,31 @@ It's recommended to set this in your `~/.bashrc` file.

export GZ_VERSION=harmonic

Update ROS dependencies:
Add Gazebo APT sources.

.. code-block:: bash

sudo apt install wget
wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt update

Add Gazebo sources to `rosdep` for the non-default pairing of ROS 2 Humble and Gazebo Harmonic.

.. code-block:: bash

wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list
rosdep update

Update ROS and Gazebo dependencies:

.. code-block:: bash

cd ~/ardu_ws
source /opt/ros/humble/setup.bash
sudo apt update
rosdep update
rosdep install --from-paths src --ignore-src -r
rosdep install --from-paths src --ignore-src -y
Copy link
Contributor

Choose a reason for hiding this comment

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

You should leave in sudo apt update and rosdep update. It's necessary. Please only remove the -r flag.


Build and Run Tests
===================
Expand All @@ -67,7 +83,7 @@ If you'd like to test your installation, run:
Run the Simulation
==================

Finally, you can source the workspace and launch one of the example Gazebo simulations:
Finally, you can source the workspace and launch one of the example Gazebo simulations:

.. code-block:: bash

Expand Down