Skip to content

About

ArduPilot ROS integration

Topics

Resources

Stars

31 stars

Watchers

1 watching

Forks

 
 

Repository files navigation

ardupilot_ros: ROS 2 use cases with Ardupilot

pre-commit

Requirements

System Requirements

Workspace Requirements

Installation

Clone this repository into your ros2 workspace alongside ardupilot_gz:

cd ~/ros2_ws/src
git clone git@github.com:ardupilot/ardupilot_ros.git

If using a non-default Gazebo version for your ROS distro (e.g. Gazebo Harmonic with ROS 2 Humble), add Gazebo's rosdep sources so package.xml dependencies such as ros_gz_sim resolve correctly. See the Gazebo rosdep guide for details:

sudo 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

Install dependencies using rosdep:

cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r --skip-keys gazebo-ros-pkgs

Build

Build it with colcon build:

cd ~/ros2_ws
source /opt/ros/humble/setup.bash
colcon build --packages-up-to ardupilot_ros ardupilot_gz_bringup

Usage

Refer to individual package READMEs for detailed usage instructions:

ArduPilot GUI

The ardupilot_gui contains a simple ROS2 GUI for viewing and controlling the vehicle. It can be launched via:

cd ~/ros2_ws
source /opt/ros/humble/setup.bash
source ./install/setup.sh
ros2 launch ardupilot_gui ardupilot_gui.launch.py

By default the GUI will connect to the vehicle with a System ID of 1 (Ardupilot default when using DDS_USE_NS=1)

If using a different System ID, use arguments to specify:

# Connect to vehicle with System ID 2
ros2 launch ardupilot_gui ardupilot_gui.launch.py sysid:=2

For usage with older versions of ArduPilot that do not have the DDS_USE_NS parameter, use a sysid of 0:

# Connect to vehicle that doesn't use the DDS_USE_NS parameter
ros2 launch ardupilot_gui ardupilot_gui.launch.py sysid:=0

Contribution Guideline

About

ArduPilot ROS integration

Topics

Resources

Stars

31 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages