Table of Contents
Fetching ...

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.

Fixed-Priority and EDF Schedules for ROS2 Graphs on Uniprocessor

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.

Paper Structure

This paper contains 18 sections, 9 theorems, 7 equations, 5 figures, 1 table, 2 algorithms.

Key Result

lemma 1

When idle, the only subtasks that may be eligible for release are the root subtasks of each tree.

Figures (5)

  • Figure 1: Sample ROS2 Application. Subscription Callbacks illustrated in orange, Timer Callbacks illustrated in purple. Topics are pipes between nodes.
  • Figure 2: Example schedules contrasting default ROS 2 executor with events executor
  • Figure 3: Unfolding of a ROS 2 Graph into a Forest. Timers in purple, subscriptions in blue
  • Figure 4: Response times for the synthetic task set compared against the WCRT bounds from analysis nasri2019response. Task A, B, and C correspond to the root tasks with periods 25ms, 41ms, and 51ms, respectively. Red lines indicate the analytical WCRT.
  • Figure 5: Autoware Reference Benchmark Executor Comparison

Theorems & Definitions (18)

  • lemma 1
  • proof
  • lemma 2
  • proof
  • lemma 3
  • proof
  • lemma 4
  • proof
  • lemma 5
  • proof
  • ...and 8 more