Offline

Flying in Formation - with Python Threading and ROS2 Parallelism

Track:
~ None of these topics
Type:
Talk
Level:
intermediate
Duration:
30 minutes
View in the schedule

Abstract

Coordinating a swarm of drones to autonomously allocate tasks, bid on them in real time, and execute multi-robot formations sounds like science fiction — but it is entirely possible with Python, a handful of threading primitives, and ROS2's MultiThreadedExecutor.

This talk walks through the concrete implementation challenges of building a decentralised auction-based task allocation system for a swarm of four Crazyflie UAVs. The focus is on a problem that trips up almost every robotics engineer who graduates from tutorials to real deployments: what happens when your system has to wait for external, asynchronous events — bids from four robots, assignment confirmations, formation completion signals — without blocking the entire node and without introducing race conditions or deadlocks?

We will explore how Python's threading.Event and Lock primitives were used alongside ROS2's MultiThreadedExecutor and ReentrantCallbackGroup to implement a synchronized bid-collation protocol, a global assignment barrier, and a concurrent multi-goal formation controller — all running in parallel on a single laptop while communicating with physical drones over radio.

You will leave with a clear, transferable mental model for combining Python threading with ROS2 callback groups, practical patterns for synchronizing distributed asynchronous events in real-time systems, and an honest account of what breaks in the real world (and why).