JuliaCon 2025

Julia in Flight: Real-Time Control of a Quadcopter with Julia
2025-07-23 , Main Room 5

Julia can run fast on a desktop, but can it run fast --- and more importantly, reliably --- on an embedded platform such as a small application-class processor or even a microcontroller? Yes! We use Julia, integrated with PX4, to perform translational and attitude control of a quadcopter in a 1kHz closed loop. We show the compilation and deployment pipeline for running Julia on a CM4 companion computer, connected to PX4 via ROS.


Julia's performance lends itself well to hard-real-time control applications where good performance is critical to the vehicle's operation. There's only several problems:

  • Julia's compilation and model and runtime can induce pauses that break the real time guarantee,
  • Julia's runtime is too large for many embedded systems that implement said controllers, and
  • Julia needs to be able to integrate with an overarching system architecture or RTOS.

We show that all three challenges can be met by using Julia to control a quadcopter in real time. The quadcopter, developed by the Autonomous Control Laboratory at the University of Washington, runs PX4 on a STM32H7 connected to a Raspberry Pi CM4. We control it with 1kHz translational and attitude control loops implemented using Julia on the CM4, connected to PX4 on the STM32 via ROS2 and the Micro-XRCE DDS bridge.

We measured the latency and jitter of the Julia controller in flight on both platforms and demonstrate the physical performance of the flight controller in agile flight.

Benjamin Chung is a modeling & simulation consultant with JuliaHub. Previously, he was a postdoc at the University of Washington with Behcet Acikmese working on aerospace trajectory optimization after finishing his PhD with Jan Vitek on type systems for Julia.

This speaker also appears in: