ROSMonitoring in Action: Runtime Monitoring and Enforcement for ROS 2 Actions

Giacomo Paltrinieri, Angelo FerrandoarXiv 2026 · DOI · arXiv

In the world of robotics, long-running tasks like navigating across a room or picking up a delicate object are usually handled by Actions. Unlike simple messages (topics) or quick requests (services), Actions have a complex lifecycle: they can be accepted, provide feedback, be canceled, or eventually succeed or fail.

A new paper, "ROSMonitoring in Action," introduces a significant upgrade to the ROSMonitoring framework, allowing it to finally "understand" and enforce safety rules on these complex ROS 2 Actions.

TL;DR

The authors extend the ROSMonitoring framework to support the full lifecycle of ROS 2 Actions, enabling runtime verification and enforcement. By reconstructing action states from multiple underlying communication channels, the system can reject unsafe goals or cancel active ones to maintain system-wide safety without modifying the robot's original code.

What Problem Does This Paper Address?

Runtime Verification (RV) is like having a digital safety officer watching a robot's internal communications. If the robot tries to do something "illegal" (like moving its arm while driving through a narrow doorway), the monitor detects the violation and reacts.

However, ROS 2 Actions are notoriously difficult to monitor. While they look like a single mechanism to a developer, under the hood, they are implemented using five separate endpoints (two topics and three services). Previous versions of ROSMonitoring treated these as unrelated streams of data. This meant the monitor couldn't tell which feedback message belonged to which goal, nor could it properly "intervene" without breaking the ROS 2 protocol and causing the robot's software to hang.

Methods

The authors developed an extension that treats an Action as a first-class citizen. Key technical features include:

  • Automatic Expansion: A user defines one action in a YAML config, and the generator automatically creates proxies for all five underlying ROS 2 endpoints.
  • Lifecycle Reconstruction: The monitor uses Goal UUIDs to correlate requests, feedback, and results. It maintains an internal state machine for every active goal.
  • Protocol-Aware Enforcement: This is the "secret sauce." If a monitor decides a goal is unsafe, it doesn't just drop the packet. It generates a synthetic, protocol-compliant response (e.g., accepted=false) so the client knows the goal was rejected and doesn't wait forever.
Figure 1: Overview of action generation and lifecycle-aware monitoring.

As shown in the sequence diagram below, the monitor acts as a sophisticated "man-in-the-middle," checking both the initial request and the server's response before allowing the action to proceed.

Figure 2: Checking a send_goal interaction in filter mode. Both the request and the server response are checked. A server-accepted goal is cancelled if the response event violates the monitored property.

Datasets

The researchers evaluated their system using two distinct setups:

  1. Qualitative Case Study: A simulated mobile manipulator (a Husky robot with a Kinova arm) running in Gazebo. They used standard ROS 2 stacks: Nav2 for navigation and MoveIt 2 for arm planning.
  2. Quantitative Benchmark: A synthetic "Fibonacci" action server. This allowed them to precisely control the workload (number of goals, size of data returned) to measure the performance "tax" the monitor imposes.

Key Insights and Ideas

  • Cross-Framework Coordination: One of the biggest "aha" moments is using the monitor as an external coordination layer. Nav2 and MoveIt 2 are often independent; they don't know what the other is doing. The monitor can enforce a rule like "Only navigate if the arm is stowed" by looking at the state of both frameworks simultaneously.
  • The Necessity of "Lying": To enforce safety in a request-response system like Actions, the monitor must be able to generate its own valid ROS messages. Simply blocking a message is not enough; you must provide a "protocol-compliant" rejection to keep the system stable.
  • State Matters: Monitoring Actions requires memory. You cannot judge a "Result" message in isolation; you have to know if the "Goal" it belongs to was ever valid in the first place.

Key Results

  • Safety Enforcement: In the manipulator simulation, the monitor successfully rejected arm-movement goals while the robot was navigating, preventing potential collisions or instability without changing a single line of code in Nav2 or MoveIt 2.
  • Linear Scaling: The scalability tests showed that the time added by the monitor grows linearly with the number of action calls.
  • Performance Overhead: For very short, high-frequency actions (like the Fibonacci test), the monitor caused a median slowdown of about 6.5x. While this sounds high, the authors note that for real-world robotic actions (which take seconds or minutes), this millisecond-scale overhead is negligible.
  • Topology Impact: Interestingly, having many different client-server pairs introduces more overhead than sending many goals through a single pair, likely due to the overhead of managing more ROS 2 endpoints.

Limitations and Future Work

The current implementation is synchronous. The monitor stops and waits for the "oracle" (the logic engine) to give a verdict before forwarding any message. This creates a bottleneck, especially for robots handling many concurrent tasks.

Future directions include: * C++ Implementation: Moving from Python (rclpy) to C++ (rclcpp) to reduce latency. * Predictive Monitoring: Instead of just reacting to a violation, the authors want to predict if an action will lead to a violation in the future. * Asynchronous Optimization: Improving the way the monitor handles concurrent goals to avoid the "shared lock" bottleneck.

Summary updated

Abstract

Robotic applications often rely on long-running operations, such as navigation, manipulation, and inspection, which in ROS~2 are commonly implemented as actions. Unlike topics and services, actions involve a structured lifecycle comprising goal submission and acceptance, feedback, status updates, result retrieval, and cancellation. Existing versions of ROSMonitoring support topics and services, but do not reconstruct this lifecycle or expose action-level events to a runtime-verification oracle. In this paper, we extend ROSMonitoring with runtime monitoring and enforcement for ROS~2 actions. Actions are declared directly in the monitoring configuration and automatically instrumented through the underlying ROS~2 communication endpoints. The generated monitor reconstructs action-level events, correlates them through goal identifiers, maintains the state of active goals, and translates violations into protocol-aware enforcement operations. These include goal rejection, cancellation, message suppression, and protocol-compliant responses generated directly by the monitor when the original communication cannot be forwarded. We evaluate the implementation through controlled stress tests that vary the number of action invocations, workload size, and client–server topology. The results show approximately linear growth in monitoring cost with repeated action invocations under a fixed workload, while larger action workloads and a greater number of configured client–server pairs introduce additional overhead. These results characterise the scaling behaviour of the current implementation under the tested sequential workloads while highlighting the main performance limitations of the current synchronous implementation.
BibTeX
@misc{paltrinieri2026rosmonitoring,
  author = {Giacomo Paltrinieri and Angelo Ferrando},
  title = {{ROSMonitoring in Action: Runtime Monitoring and Enforcement for ROS 2 Actions}},
  year = {2026},
  eprint = {2611.22407},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.22407},
}
Figure