This project showcases my work integrating MAVLink with ROS2 to control a drone in a simulated environment using SITL (Software-In-The-Loop). It demonstrates how to interact with a drone using two custom ROS2 nodes and the pymavlink library.
I developed two ROS2 nodes from scratch:
-
battery_gps_node.py
📡 Publishes the current battery percentage on thebattery_statustopic.
🌍 Subscribes to thetarget_gpstopic to receive GPS coordinates and send them to the drone. -
mission_control_node.py
🧭 Accepts a GPS coordinate as a command-line argument.
🚀 Publishes the coordinate to thetarget_gpstopic.
🛬 Monitors battery status and commands the drone to land if the battery drops below 20%.
- ROS2 Humble (or newer)
pymavlinkandmavlink- A drone simulator (e.g., ArduPilot SITL)
- Set up SITL simulation with ArduPilot.
- Launch
battery_gps_node.py. - Run
mission_control_node.pywith a target GPS position. - Watch the drone move to the target and land when battery is low.
You can find a video demonstration of the full system inside this repository 👉 Click here to find the video — feel free to check it out and see the project in action!