ROS/MAVROS Installation Guide
Last updated
Last updated
is a ROS 1 package that enables MAVLink extendable communication between computers running ROS 1 for any MAVLink enabled autopilot, ground station, or peripheral. MAVROS is the "official" supported bridge between ROS 1 and the MAVLink protocol.
While MAVROS can be used to communicate with any MAVLink-enabled autopilot, this documentation explains how to set up communication between the PX4 Autopilot and a ROS 1 enabled companion computer.
:::warning The PX4 development team recommend that all users . This documentation reflects the "old approach". :::
:::note First install ROS and PX4 following the instructions in . :::
:::tip These instructions are a simplified version of the . They cover the ROS Melodic and Noetic releases. :::
MAVROS can be installed either from source or binary. We recommend that developers use the source installation.
The ROS repository has binary packages for Ubuntu x86, amd64 (x86_64) and armhf (ARMv7). Kinetic also supports Debian Jessie amd64 and arm64 (ARMv8).
Use apt-get
for installation, where ${ROS_DISTRO}
below should resolve to kinetic
or noetic
, depending on your version of ROS:
Then install datasets by running the install_geographiclib_datasets.sh
script:
This installation assumes you have a catkin workspace located at ~/catkin_ws
If you don't create one with:
You will be using the ROS Python tools: wstool (for retrieving sources), rosinstall, and catkin_tools (building) for this installation. While they may have been installed during your installation of ROS you can also install them with:
:::tip While the package can be built using catkin_make the preferred method is using catkin_tools as it is a more versatile and "friendly" build tool. :::
If this is your first time using wstool you will need to initialize your source space with:
Now you are ready to do the build:
Install MAVLink:
Install MAVROS from source using either released or latest version:
Released/stable
Latest source
Create workspace & deps
Build source
Make sure that you use setup.bash or setup.zsh from workspace.
:::note If you have an example app using the PX4 Autopilot and MAVROS, we can help you get it on our docs. :::
Install datasets:
In the case of error, there are addition installation and troubleshooting notes in the .
The , will show you the basics of MAVROS, from reading telemetry, checking the drone state, changing flight modes and controlling the drone.