Skip to content

ROS2 Humble + MAVROS + ArduPilot integration framework. Test in SITL simulation, deploy to real hardware (Cube Orange, Pixhawk). Flight-tested on Raspberry Pi 4.

License

Notifications You must be signed in to change notification settings

sidharthmohannair/ros2-ardupilot-sitl-hardware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2-ArduPilot SITL & Hardware Integration

Cover Image

ROS2 License ArduPilot

Open-source framework to control ArduPilot drones with ROS2. Test missions in SITL simulation, then deploy to real hardware.

Validated on real flights with Cube Orange flight controller and Raspberry Pi 4.


Getting Started

Step Description Guide
1 Install - ROS2, MAVROS, ArduPilot SITL Installation Guide
2 Use - Test in simulation, deploy to hardware Workflow Guide

Already have ROS2 + MAVROS + ArduPilot installed? Skip to Quick Start below.


Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        Your Mission Script                          │
│                      (Python / ROS2 Node)                           │
└─────────────────────────────────────────────────────────────────────┘
                                  │
                                  ▼
┌─────────────────────────────────────────────────────────────────────┐
│                        MAVROS (ROS2)                                │
│              Translates ROS2 ↔ MAVLink Protocol                     │
└─────────────────────────────────────────────────────────────────────┘
                                  │
                    ┌─────────────┴─────────────┐
                    ▼                           ▼
        ┌───────────────────┐       ┌───────────────────┐
        │   SITL Simulator  │       │   Real Hardware   │
        │   (UDP:14550)     │       │   (/dev/ttyACM0)  │
        │                   │       │                   │
        │   ArduPilot       │       │  Cube Orange      │
        │   Virtual Drone   │       │  Flight Controller│
        └───────────────────┘       └───────────────────┘
                                            │
                                            ▼
                                    ┌───────────────┐
                                    │    Drone      │
                                    └───────────────┘

Same mission code works for both paths - only the MAVROS connection changes.


Key Features

  • Companion Computer Control - Command drone autonomously from Raspberry Pi in GUIDED mode
  • SITL & Hardware Testing - Test missions in simulation, then deploy same code to real drone
  • Flight Validated - Tested on FuryVision AAV in autonomous flight
  • Safety First - Comprehensive pre-flight checks and emergency procedures
  • Ground Station Optional - Mission Planner/QGroundControl for monitoring
  • Complete Workflow - SITL testing → Bench testing → Flight testing documented
  • Open Hardware Reference - Test platform fully documented (CAD, assembly, wiring)

Quick Start

Prerequisites

  • ROS2 Humble on Ubuntu 22.04
  • ArduPilot SITL (for simulation)
  • MAVROS installed

Don't have these? See Installation Guide


Test in Simulation

# 1. Clone this repository
git clone https://github.com/sidharthmohannair/ros2-ardupilot-sitl-hardware.git
cd ros2-ardupilot-sitl-hardware

# 2. Build packages
colcon build
source install/setup.bash

# 3. Make scripts executable (first time only)
chmod +x launch/*.sh

# 4. Start SITL (Terminal 1)
./launch/start_sitl.sh

# 5. Start MAVROS (Terminal 2)
./launch/start_mavros.sh

# 6. Run autonomous mission (Terminal 3)
source install/setup.bash
python3 scripts/missions/mission_simple.py

# 7. Stop cleanly when done
./launch/stop_all.sh

Watch your drone takeoff in the SITL map!


Deploy to Real Hardware

After SITL testing succeeds:

# 1. Stop SITL completely
./launch/stop_all.sh

# 2. Connect Cube Orange via USB to Raspberry Pi

# 3. Start MAVROS for hardware (Terminal 1)
./launch/start_mavros_real.sh
# Answer safety prompts

# 4. Run SAME mission (Terminal 2)
source install/setup.bash
python3 scripts/missions/mission_simple.py

⚠️ CRITICAL: Remove propellers for bench testing!


Complete Workflow Guide

See WORKFLOW.md for:

  • Detailed SITL testing procedure
  • Hardware transition steps
  • Helper script reference
  • Troubleshooting common issues
  • Best practices

Repository Structure

├── src/                          # ROS2 packages
│   ├── simtofly_mavros_sitl/    # SITL simulation configuration
│   └── simtofly_mavros_real/    # Real hardware configuration
├── scripts/missions/             # Autonomous mission examples
├── launch/                       # Helper scripts (start/stop)
├── docs/                         # Complete documentation
└── README.md                     # You are here

Documentation

Getting Started

Hardware Deployment

Reference


Tested Hardware

This framework has been validated on the following configuration:

Primary Test Platform: FuryVision AAV

Flight Controller: Cube Orange+ (Pixhawk)
Companion Computer: Raspberry Pi 4 (8GB)
Firmware: ArduCopter v4.5.7
ROS2 Version: Humble Hawksbill
OS: Ubuntu 22.04 LTS

FuryVision AAV in Flight

FuryVision AAV hovering - Hardware platform used for framework testing

Complete Hardware Details: FuryVision AAV - Open Source Drone

Why This Platform:

  • Fully open source - CAD files, assembly guide, wiring diagrams available
  • Flight tested - 8+ minutes flight time, stable autonomous performance
  • Well documented - Complete build and test procedures

Compatible Hardware

Component Validated Notes
Flight Controllers
Cube Orange+ ✅ Tested Primary platform
Cube Orange ⚠️ Compatible Should work with same setup
Pixhawk 4 ⚠️ Compatible Should work with same setup
Pixhawk 6C ⚠️ Compatible Should work with same setup
Companion Computers
Raspberry Pi 4 (4GB+) ✅ Tested Ubuntu 22.04 native
Raspberry Pi 5 ⚠️ Compatible May require Docker (Ubuntu 22.04 support)
Jetson Nano ⚠️ Compatible Different architecture, may need adjustments

Note: "Compatible" means theoretically supported but not tested by maintainer. Some hardware may work without changes, others may require minor modifications such as serial port names, baud rates, or Docker setup for OS compatibility. Community testing and feedback welcome!

For complete hardware specifications: Hardware Reference


Safety Notice

Before testing on real hardware:

  • ✅ Remove all propellers during bench testing
  • ✅ Secure drone on stable surface
  • ✅ Have RC transmitter ready for manual override
  • ✅ Read the Real Hardware Setup Guide
  • ✅ Follow local drone regulations

Motors WILL spin when armed - propellers off = safe testing!


Contributing

This project is actively maintained and welcomes contributions!

We're building this based on community feedback and real-world usage. Your input helps make this better for everyone.

Ways to contribute:

  • Report bugs or hardware compatibility issues
  • Suggest features or improvements
  • Improve documentation
  • Test on different hardware configurations
  • Share your mission examples

See CONTRIBUTING.md for guidelines.

Roadmap (Community-Driven)

Planned improvements based on feedback:

  • More mission examples (waypoint patterns, search patterns)
  • Additional hardware configurations (Jetson, RPi5)
  • Computer vision integration examples
  • Multi-drone coordination examples
  • Video tutorials

Your suggestions welcome in Discussions!


License

This project is licensed under the Apache License 2.0 - see LICENSE file.

When using this work, please credit:

Based on work by Sidharth Mohan Nair
https://github.com/sidharthmohannair/ros2-ardupilot-sitl-hardware

Acknowledgments

  • ROS2 community
  • ArduPilot developers
  • MAVROS maintainers

Support


If this project helps you, consider giving it a ⭐ on GitHub.