MAVROS Quadcopter

I built and tested a quadcopter running the PX4 open-source flight stack, extending beyond my earlier Ardupilot project by integrating a Raspberry Pi as an onboard companion computer. This enabled communication between the flight controller and a ROS (Robot Operating System) master using MAVROS, allowing for advanced autonomy and custom mission logic.

Key Features & Implementation:

  • Flight Stack: PX4 autopilot firmware for low-level stabilization, waypoint navigation, and failsafe mechanisms.

  • Companion Computer Integration: Raspberry Pi 4 running Ubuntu + ROS Noetic, connected via serial to the Pixhawk flight controller.

  • MAVROS Middleware: Used MAVROS to bridge ROS topics and services with the PX4 autopilot, enabling:

    • Publishing setpoints for position and velocity control.

    • Subscribing to telemetry (IMU, GPS, battery, attitude).

    • Running custom ROS nodes for mission logic and state estimation.

  • Autonomy Pipeline:

    • Mission-level commands issued from a ROS master node.

    • MAVROS translates these into MAVLink messages for PX4.

    • PX4 executes low-level stabilization while Raspberry Pi handles higher-level tasks.

  • Hardware Stack:

    • Quadcopter frame with BLDC motors, ESCs, and Pixhawk flight controller.

    • Raspberry Pi (companion computer) mounted on airframe, with Wi-Fi for remote SSH and ROS network connectivity.

    • Telemetry link (433 MHz) and GPS + magnetometer module.

    • LiPo power system with DC-DC converter for Raspberry Pi.

Challenges & Lessons Learned:

  • Learned how MAVROS exposes flight control through ROS topics/services, and how to structure ROS nodes to publish trajectories or control commands.

  • Understood the role of companion computers in UAVs — offloading high-level autonomy, computer vision, or AI tasks while letting PX4 handle flight-critical stabilization.

  • Experienced the importance of real-time communication latency between ROS and PX4 for stable control.

  • Set up a multi-machine ROS network where the Pi acted as a local flight computer while a laptop could remotely monitor/control via Wi-Fi.

  • Encountered practical issues: power distribution for the Raspberry Pi, vibration isolation for the flight controller, and the need for reliable telemetry beyond Wi-Fi.

Why Did I Build This?
This project gave me first-hand experience in building UAVs capable of complex autonomous applications, bridging low-level flight control (PX4) with robotics frameworks (ROS). It was my first step toward ROS-based aerial robotics, preparing me to explore advanced domains like vision-based navigation, swarm robotics, and onboard AI-driven decision-making.

Next Steps Would Be To:

  • Integrate computer vision (OpenCV/ROS perception stack) for tasks like object detection, tracking, or obstacle avoidance.

  • Implement offboard control for real-time trajectory generation instead of pre-programmed missions.

  • Experiment with sensor fusion (e.g., VIO, LiDAR) to improve navigation in GPS-denied environments.

  • Expand to multi-agent coordination, where multiple UAVs share state and operate collaboratively.