A MAVLink-to-ROS 2 bridge for drones.
MAVROS turns a MAVLink autopilot (PX4, ArduPilot, …) into a set of familiar ROS 2 topics, services and parameters, so you can program a drone in ROS the same way you would program any other robot — no need to speak MAVLink.
MAVLink is the wire protocol most flight controllers speak. ROS 2 is a robotics framework for building software. MAVROS is the glue between them:
flowchart LR
subgraph FCU["Flight controller"]
AP[PX4 / ArduPilot]
end
subgraph MAV["MAVROS node"]
BR[bridge / plugins]
end
subgraph APP["Your ROS 2 app"]
N1[telemetry nodes]
N2[command nodes]
N3[mission / GCS nodes]
end
AP -- MAVLink (UDP/TCP/serial) --> BR
BR -- ROS 2 topics / services / params --> N1
BR --> N2
BR --> N3
It does the boring, low-level work for you:
- Telemetry out — autopilot state, IMU, GPS, attitude, battery, and more
arrive as standard ROS 2
sensor_msgs/mavros_msgstopics. - Commanding in — arm/disarm, takeoff, land, set mode, upload missions and geofences through familiar ROS 2 services.
- Routing — MAVROS can proxy between a ground station, the FCU and multiple ROS processes over a single link.
- Tested against PX4 and ArduPilot, including SITL simulation.
- Extensible — a plugin architecture translates each MAVLink message; add behaviour without touching the core.
- ROS 2 native — supports Humble and newer ROS 2 releases.
- Flexible transport — USB/serial, UDP, TCP, or a shared UAS bus.
Install the package and its mandatory GeographicLib datasets:
sudo apt install ros-${ROS_DISTRO}-mavros
sudo ros2 run mavros install_geographiclib_datasets.shLaunch the bridge against a flight controller (or a simulated one):
ros2 launch mavros node.launch \
fcu_url:=udp://127.0.0.1:14550@127.0.0.1:14557Then inspect the sensor stream:
ros2 topic echo /mavros/imu/dataSee the installation guide for binary, source and container installs, and the examples for task control and waypoint missions.
| Package | Purpose |
|---|---|
mavros |
Core nodes (Router, UAS) and standard plugins |
mavros_extras |
Optional plugins (cameras, gimbals, terrain, …) |
mavros_msgs |
ROS 2 message and service interfaces |
libmavconn |
MAVLink transport library (usable outside ROS) |
test_mavros |
Hand-tests and SITL manual for PX4/ArduPilot |
mavros_examples |
Beginner-friendly ROS 2 example scripts (task control, waypoint missions, offboard) |
- Full documentation
- Plugin reference — every topic/service/parameter
- Per-package C++/Python API
- Changelog
Ask questions (not bug reports) on: