Talk to me · Julian Reder · Resume · GitHub

aerpawlib

AERPAW · 2025 - Present

The official vehicle control library for AERPAW, NC State's research testbed for advanced wireless communications and autonomous aircraft.

2025 - Present View Project ↗
PythonMAVSDK / MAVLinkArduPilotasyncio / gRPCZeroMQpytestSITL
Experiment script Runner / StateMachine aerpawlib v1 / v2 Vehicle, can_*, ZMQ MAVSDK + gRPC mavsdk_server MAVLink filter takeoff land goto yaw Cube Orange ArduPilot, LAM6/SAM4 Safety checker KML geofence, C-VM SITL tests Copter + Rover ZMQ proxy 5570 / 5571 JSON control plane, wait_for_peers
Architecture diagram showing how researcher scripts interact with aerpawlib, MAVSDK, and the testbed safety filter before reaching the vehicle autopilot.

Built

I maintain the official AERPAW/aerpawlib repository, which provides the Python programming interface that visiting researchers use to fly autonomous drones and drive ground rovers during experiments. I transitioned the project from its original DroneKit foundation over to MAVSDK, preserved backward compatibility for existing scripts, and added a modern asynchronous API for newer experiments.

Hard parts

  • The testbed safety filter strictly restricts vehicle commands to takeoff, landing, waypoints, and yaw, requiring all takeoff altitudes to stay between 20 and 100 meters and landings to finish within 5 meters of home.
  • Direct flight mode changes are blocked by the safety layer, so guided mode has to be maintained using explicit command messages without dropping communication links.
  • Safety validation logic has to coordinate directly with the companion virtual machine rather than running locally or through operator consoles.
  • Velocity commands and geodesic navigation calculations needed updates to handle latitude scaling properly and prevent newer movement requests from being prematurely cancelled.
  • Coordinating multiple vehicles over ZeroMQ required switching to an acknowledged messaging handshake so state transitions would not be dropped under load.

Learned

  • Working within a hardware testbed means the physical safety filter dictates software requirements just as much as the autopilot library itself.
  • Software-in-the-loop simulations are essential for catching basic logic errors, but real flight testing is still needed to uncover edge cases in testbed infrastructure.
  • Providing a backward-compatible wrapper alongside a redesigned API made it possible to modernize the library without breaking existing researcher experiments.

Also

  • Primary maintainer of the official vehicle control library across both legacy and asynchronous MAVSDK interfaces.
  • Built-in safety checking with boundary geofences, command validation, and safe return-to-launch handling.
  • ZeroMQ messaging proxy that coordinates multi-vehicle experiments across shared wireless channels.
  • Comprehensive automated test suite featuring ArduPilot software-in-the-loop simulation.
  • Complete developer documentation and tutorial guides published on GitHub Pages.

The AERPAW platform

AERPAW (Aerial Experimentation and Research Platform for Advanced Wireless) is a National Science Foundation research testbed located at NC State that lets researchers experiment with wireless communications and autonomous vehicle control. Visiting experimenters write software to control custom multi-rotor drones like the LAM6 and SAM4 as well as ground rovers, all of which use Cube Orange flight controllers running ArduPilot. Because these vehicles carry sensitive custom radio payloads like software-defined radios and operate in active airspace, safety is enforced strictly at every step of execution.

Every vehicle command sent from an experiment script passes through an automated safety filter before it reaches the flight controller. This filter only allows a handful of safe operations such as taking off between 20 and 100 meters, returning to land within 5 meters of home, and flying to coordinates that remain inside a predefined field geofence. Telemetry flows back to experimenters freely, but any command that violates boundaries or safety rules gets dropped immediately, which means library code has to conform strictly to these constraints.

Maintaining and modernizing aerpawlib

The original version of aerpawlib was created by John Kesler using DroneKit and pymavlink, providing simple runner classes and state machines that experimenters could script alongside flight plans exported from ground control software. As DroneKit became unmaintained and vehicle firmware moved forward, I stepped in as the primary maintainer of the official AERPAW/aerpawlib repository to modernize the codebase and migrate the backend to MAVSDK so researchers could run updated firmware without issues.

To keep existing research scripts working without requiring everyone to rewrite their experiments overnight, I kept the original class structure and telemetry helpers in place using a compatibility layer. Alongside that legacy surface, I built an asynchronous v2 API that lets developers write cleaner event-driven flight routines using native Python async syntax, while also maintaining the simulation harnesses, command line utilities, and documentation site.

Adapting to the safety filter

Writing a flight control library for a testbed is different from building standard drone software because the security filter constantly shapes how commands must be formulated. For instance, standard flight mode switch commands are filtered out, so the library has to issue low-level guided mode commands directly to prevent the drone from entering an unsupported holding state that would sever the virtual machine connection. Similarly, emergency return procedures had to be adjusted so aborted missions would not attempt to navigate home at zero altitude and trigger an immediate filter rejection.

I also resolved several subtle navigation and networking issues while supporting active experiments in the field. Velocity command loops were rewritten so that newer movement updates would not be overridden by older timers, heading calculations were corrected to account for latitude changes across the testing facility, and the inter-vehicle ZeroMQ communications layer was upgraded from basic message publishing to an acknowledged handshake that ensures multi-drone formations do not lose state during coordinated maneuvers.

E-VM script aerpawlib commands MAVLink filter (allow-list) takeoff 20-100 m, land <=5 m of home takeoff / land goto, yaw status out unrestricted blocked: SET_MODE, LOITER GUIDED via MAV_CMD_DO_SET_MODE Cube Orange ArduPilot, MAVLink v2 C-VM safety checker KML geofence on this node
Diagram illustrating how commands are validated by the testbed filter while telemetry streams freely back to the experiment script.

Testing and reliability

To ensure that changes do not break active flight routines, the library includes a suite of unit tests and integration tests that run through continuous integration on modern Python versions. The integration test suite automatically starts simulated ArduCopter and Rover instances using software-in-the-loop simulation, connects them to a local MAVSDK server instance, and verifies flight sequences before resetting the vehicles between test runs. While simulation makes it easy to catch regression bugs early, field testing with real vehicle hardware remains the definitive test for how software behaves under live testbed conditions.