ROSflight 2.0: Lean ROS 2-Based Autopilot for Unmanned Aerial Vehicles

This paper introduces ROSflight 2.0, a modular, open-source ROS 2-based autopilot ecosystem designed to lower barriers for UAV research and accelerate the transition from simulation to hardware, featuring a lean architecture that successfully controls multirotors at 400 Hz with all loops running on a companion computer.

Jacob Moore, Phil Tokumaru, Ian Reid, Brandon Sutherland, Joseph Ritchie, Gabe Snow, Tim McLain

Published Mon, 09 Ma
📖 5 min read🧠 Deep dive

Imagine you want to build a custom robot drone. In the past, doing this was like trying to build a car engine while the car was already driving down the highway. You had to dig through massive, complex instruction manuals (the "autopilot" software) that were written in a language only experts understood. If you wanted to change how the drone turned or flew, you often had to rewrite huge chunks of code, risking a crash.

ROSflight 2.0 is a new, streamlined "driving school" for drone researchers. It's designed to be simple, transparent, and easy to modify, so scientists can focus on inventing new ways to fly rather than fixing broken code.

Here is a breakdown of what makes this new version special, using some everyday analogies:

1. The "Two-Brain" System (The Companion Computer)

Most drones have a tiny, simple brain (the Flight Controller) that handles basic things like keeping the drone level. ROSflight adds a second, much smarter brain called a Companion Computer (like a laptop or a powerful Raspberry Pi attached to the drone).

  • The Analogy: Think of the tiny brain as the autopilot in a car that just keeps the car in the lane. The Companion Computer is the passenger who decides where to go, how fast to drive, and what music to play.
  • The Upgrade: In ROSflight 2.0, the "passenger" (the smart computer) can take full control. It can send direct commands to the wheels (motors) without asking the autopilot for permission first. This is called "Pass-Through Mode." It's like the passenger reaching over and grabbing the steering wheel to make a sharp turn instantly, rather than waiting for the car's computer to process the turn.

2. The "Universal Translator" (Actuator Mixing)

Drones come in all shapes: some have four propellers (quadcopters), some have six, some have wings, and some have flaps. The software needs to translate a command like "Turn Left" into specific instructions for each motor or flap. This translation process is called Mixing.

  • The Analogy: Imagine you are a conductor leading an orchestra. You say "Play louder," but you need to tell the violins to play very loud, the drums moderately loud, and the flutes softly.
  • The Upgrade: In the old version, the conductor had a fixed script. If you wanted to change the orchestra, you had to rewrite the whole script. In ROSflight 2.0, the conductor has a digital tablet. You can instantly swap the script for a "Jazz Band" (a different drone shape) or a "Rock Band" (a custom drone) just by loading a new file. You don't need to rebuild the whole orchestra; you just change the sheet music.

3. The "Simulation Sandbox" (Software-in-the-Loop)

Before flying a real drone, researchers test it in a computer simulation. Usually, the code that works in the simulation is different from the code that works on the real drone. You have to rewrite the code every time you switch from "Virtual World" to "Real World."

  • The Analogy: It's like practicing a piano piece on a keyboard app on your phone, but then having to relearn the entire song when you sit down at a real Steinway piano because the keys work differently.
  • The Upgrade: ROSflight 2.0 uses Software-in-the-Loop (SIL). This means the exact same code runs in the simulation and on the real drone. It's like practicing on a digital piano that sounds and feels exactly like the real one. When you switch to the real drone, you don't have to relearn anything; you just hit "Play."

4. The "Lego" Architecture (Modularity)

Old autopilot systems were like a giant, solid block of concrete. If you wanted to change one small part, you had to chip away at the whole thing.

  • The Analogy: ROSflight is built like Lego bricks. Each part of the system (sensors, motors, GPS, camera) is a separate brick.
  • The Upgrade: If a researcher wants to test a new type of camera or a weird new wing shape, they just swap out one Lego brick. They don't have to rebuild the whole castle. This makes it incredibly fast to test new ideas.

5. The "Rosetta Stone" (ROS 2)

The software is built on ROS 2 (Robot Operating System 2), which is the new standard language for robots.

  • The Analogy: Previous versions used an old language (ROS 1) that is no longer supported by the community, like trying to speak Latin in a modern office.
  • The Upgrade: ROSflight 2.0 speaks the modern language (ROS 2). This means it talks easily to other modern robots, ground stations, and AI tools. It's like upgrading from a flip phone to a smartphone; everything connects better and faster.

The Result: Speed and Safety

The paper proves that this new system works by flying a drone at 400 times per second (400 Hz).

  • The Analogy: Imagine a human blinking once every second. ROSflight is making decisions 400 times in that same second. It's so fast that the "passenger" (the smart computer) can control the drone's motors directly, reacting to wind gusts or obstacles almost instantly.

In summary: ROSflight 2.0 takes the heavy lifting out of drone research. It gives scientists a simple, modular toolkit that lets them move from a computer simulation to a real flying drone without rewriting their code, allowing them to focus on inventing the future of flight (like delivery drones or flying taxis) rather than fighting with software bugs.