Fixed-Priority and EDF Schedules for ROS2 Graphs on Uniprocessor
Oren Bell, Harun Teper, Mario Günzel, Chris Gill, Jian-Jia Chen
TL;DR
The paper tackles the unpredictability of ROS 2 scheduling for general graphs by mapping ROS 2 callbacks to DAG tasks and unfolding them into a forest of trees. It introduces a specialized two-queue events executor design that enables fixed-job-level-priority scheduling on uniprocessor systems, requiring LIFO-ordered DDS messaging to preserve correctness. The authors provide a formal equivalence proof to LP-FJP scheduling on the unfolded graph and validate it with synthetic task sets and the Autoware benchmark, demonstrating improved worst-case and end-to-end latencies. A key practical requirement is LIFO messaging support, and future work includes middleware integration and extensions to mixed-criticality systems.
Abstract
This paper addresses limitations of current scheduling methods in the Robot Operating System (ROS)2, focusing on scheduling tasks beyond simple chains and analyzing arbitrary Directed Acyclic Graphs (DAGs). While previous research has focused mostly on chain-based scheduling with ad-hoc response time analyses, we propose a novel approach using the events executor to implement fixed-job-level-priority schedulers for arbitrary ROS2 graphs on uniprocessor systems. We demonstrate that ROS 2 applications can be abstracted as forests of trees, enabling the mapping of ROS 2 applications to traditional real-time DAG task models. Our usage of the events executor requires a special implementation of the events queue and a communication middleware that supports LIFO-ordered message delivery, features not yet standard in ROS2. We show that our implementation generates the same schedules as a conventional fixed-priority DAG task scheduler, in spite of lacking access to the precedence information that usually is required. This further closes the gap between established real-time systems theory and ROS2 scheduling analyses.
