Table of Contents
Fetching ...

Bridging the Gap between ROS~2 and Classical Real-Time Scheduling for Periodic Tasks

Harun Teper, Oren Bell, Mario Günzel, Chris Gill, Jian-Jia Chen

TL;DR

This work targets the mismatch between ROS 2's default executor and classical real-time scheduling theory for periodic tasks. By introducing and refining the ROS 2 events executor with Release-Only (RO) and Release-and-Execute (RE) modes, the authors show how priority-based non-preemptive scheduling (RM/EDF) can be realized with minimal backend changes. They derive worst-case response time bounds and end-to-end latency analyses using established non-preemptive scheduling results, and extend the approach to subscription-triggered tasks. The evaluation on synthetic benchmarks and the Autoware reference system demonstrates improved reliability (fewer dropped jobs) and significantly tighter latency bounds compared to the default ROS 2 executor, enabling practical real-time performance in robotic systems.

Abstract

The Robot Operating System 2 (ROS~2) is a widely used middleware that provides software libraries and tools for developing robotic systems. In these systems, tasks are scheduled by ROS~2 executors. Since the scheduling behavior of the default ROS~2 executor is inherently different from classical real-time scheduling theory, dedicated analyses or alternative executors, requiring substantial changes to ROS~2, have been required. In 2023, the events executor, which features an events queue and allows the possibility to make scheduling decisions immediately after a job completes, was introduced into ROS~2. In this paper, we show that, with only minor modifications of the events executor, a large body of research results from classical real-time scheduling theory becomes applicable. Hence, this enables analytical bounds on the worst-case response time and the end-to-end latency, outperforming bounds for the default ROS 2 executor in many scenarios. Our solution is easy to integrate into existing ROS 2 systems since it requires only minor backend modifications of the events executor, which is natively included in ROS 2. The evaluation results show that our ROS~2 events executor with minor modifications can have significant improvement in terms of dropped jobs, worst-case response time, end-to-end latency, and performance compared to the default ROS~2 executor.

Bridging the Gap between ROS~2 and Classical Real-Time Scheduling for Periodic Tasks

TL;DR

This work targets the mismatch between ROS 2's default executor and classical real-time scheduling theory for periodic tasks. By introducing and refining the ROS 2 events executor with Release-Only (RO) and Release-and-Execute (RE) modes, the authors show how priority-based non-preemptive scheduling (RM/EDF) can be realized with minimal backend changes. They derive worst-case response time bounds and end-to-end latency analyses using established non-preemptive scheduling results, and extend the approach to subscription-triggered tasks. The evaluation on synthetic benchmarks and the Autoware reference system demonstrates improved reliability (fewer dropped jobs) and significantly tighter latency bounds compared to the default ROS 2 executor, enabling practical real-time performance in robotic systems.

Abstract

The Robot Operating System 2 (ROS~2) is a widely used middleware that provides software libraries and tools for developing robotic systems. In these systems, tasks are scheduled by ROS~2 executors. Since the scheduling behavior of the default ROS~2 executor is inherently different from classical real-time scheduling theory, dedicated analyses or alternative executors, requiring substantial changes to ROS~2, have been required. In 2023, the events executor, which features an events queue and allows the possibility to make scheduling decisions immediately after a job completes, was introduced into ROS~2. In this paper, we show that, with only minor modifications of the events executor, a large body of research results from classical real-time scheduling theory becomes applicable. Hence, this enables analytical bounds on the worst-case response time and the end-to-end latency, outperforming bounds for the default ROS 2 executor in many scenarios. Our solution is easy to integrate into existing ROS 2 systems since it requires only minor backend modifications of the events executor, which is natively included in ROS 2. The evaluation results show that our ROS~2 events executor with minor modifications can have significant improvement in terms of dropped jobs, worst-case response time, end-to-end latency, and performance compared to the default ROS~2 executor.
Paper Structure (25 sections, 2 theorems, 7 equations, 9 figures, 1 table, 1 algorithm)

This paper contains 25 sections, 2 theorems, 7 equations, 9 figures, 1 table, 1 algorithm.

Key Result

Theorem 1

Assume that the tasks $\mathbb{T} = \{\tau_1, \dots, \tau_n\}$ are ordered by their priority, i.e., $\tau_1$ has the highest priority and $\tau_n$ has the lowest priority. If there exists a $t\geq 0 \in \mathbb{R}$ such that $t \leq D_k$ and then the WCRT $R_k$ of $\tau_k \in \mathbb{T}$ under non-preemptive FP scheduling is upper bounded by $t$.

Figures (9)

  • Figure 1: Release-Only model of the events executor
  • Figure 2: Release-and-Execute model of the events executor
  • Figure 3: Prioritized Release-and-Execute model of the events executor
  • Figure 4: Dropped jobs on timers-only task sets: A checkmark indicates no dropped jobs across all utilization levels.
  • Figure 5: Response Time of Camera Tasks (ms), D=84ms
  • ...and 4 more figures

Theorems & Definitions (2)

  • Theorem 1: Non-preemptive FP, Reformulated from Eq. (6) in DBLP:conf/ecrts/BruggenCH15
  • Theorem 2: Non-preemptive EDF, Reformulated from george1996EDFNP