-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfb8e05
commit cf62a7b
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.. _ros2-gazebo: | ||
|
||
================= | ||
ROS 2 with Gazebo | ||
================= | ||
|
||
Once ROS2 is correctly :ref:`installed <ros2>` and running :ref:`sitl <ros2-sitl>`, we can integrate Ardupilot with Gazebo. For that, we will need some ROS 2 packages. | ||
|
||
We will install the required packages using `vcs` and a `ros2.repos` files: | ||
|
||
.. code-block:: bash | ||
cd ~/ros2_ws/src | ||
wget https://raw.githubusercontent.com/ArduPilot/ardupilot_gz/main/ros2_gz.repos | ||
vcs import --recursive < ros2_gz.repos | ||
Set the gazebo version | ||
|
||
.. code-block:: bash | ||
export GZ_VERSION=garden | ||
Update ROS dependencies: | ||
|
||
.. code-block:: bash | ||
cd ~/ros2_ws | ||
source /opt/ros/humble/setup.bash | ||
sudo apt update | ||
rosdep update | ||
rosdep install --rosdistro $ROS_DISTRO --from-paths src -i -r -y | ||
Build: | ||
|
||
.. code-block:: bash | ||
cd ~/ros2_ws | ||
colcon build --cmake-args -DBUILD_TESTING=ON | ||
If you'd like to test your installation, run: | ||
|
||
.. code-block:: bash | ||
cd ~/ros2_ws | ||
source ./install/setup.bash | ||
colcon test --packages-select ardupilot_sitl ardupilot_dds_tests ardupilot_gazebo ardupilot_gz_applications ardupilot_gz_description ardupilot_gz_gazebo ardupilot_gz_bringup | ||
colcon test-result --all --verbose | ||
Finally, you can source the workspace and launch one of the example Gazebo simulations: | ||
|
||
.. code-block:: bash | ||
source ~/ros2_ws/install/setup.sh | ||
ros2 launch ardupilot_gz_bringup iris_runway.launch.py | ||
To see all the exemples available, as well as more information regarding the package in general, refer to `ardupilot_gz/README.md <https://github.com/ArduPilot/ardupilot_gz#ardupilot_gz>`__. |