ROSMonitoring 2.0: Extending ROS Runtime Verification to Services and Ordered Topics

Maryam Ghaffari Saadat, Angelo Ferrando, Louise A. Dennis, Michael FisherarXiv 2024 · DOI

TL;DR

ROSMonitoring 2.0 extends runtime verification for robotic systems by adding support for synchronous services and ensuring messages are processed in their true publication order. This update significantly improves verification accuracy in distributed environments where network delays often cause messages to arrive out of sequence.

What Problem Does This Paper Address?

In the Robot Operating System (ROS), components (nodes) communicate primarily through asynchronous "topics" (publish-subscribe) or synchronous "services" (request-response). While the original ROSMonitoring framework could intercept topic messages to check if a robot was behaving correctly, it had two major gaps:

  1. Service Blindness: It couldn't monitor services, which are critical for direct, blocking interactions between nodes.
  2. The "Out-of-Order" Headache: In distributed systems, a message sent first might arrive at the monitor second due to network jitter. If a safety property depends on the order of events (e.g., "the battery status must be updated after the raw voltage is read"), these delays cause "false negatives"—the monitor flags an error even when the robot did nothing wrong.
Figure 1: High-level overview of ROSMonitoring [15].

Methods

The authors introduced two primary extensions to the framework:

  • Service Interception: The monitor now acts as a "man-in-the-middle." When a client calls a service, the monitor intercepts the request, asks an external "Oracle" if it's valid, and only then forwards it to the server. It repeats this process for the response.
  • Publication-Time Ordering: To fix the ordering issue, the framework now attaches timestamps to every message at the moment of publication.
  • The Reordering Algorithm: The monitor uses a buffering strategy (Algorithm 1). It collects messages from all monitored topics into separate buffers and only releases a message to the Oracle when every buffer has at least one message. It then picks the message with the earliest publication timestamp.
Figure 3: Service verification in ROSMonitoring 2.0 when filtering is enabled.

The algorithm relies on specific global dictionaries to track these messages and timestamps: Inputs required for the message reordering algorithm

Inputs required for the message reordering algorithm

Datasets

The authors evaluated their framework using a custom Battery Supervisor case study for a fire-fighting Uncrewed Aerial Vehicle (UAV).

  • Components: A Battery node (publisher), a Battery Supervisor (subscriber/service client), and an LED Panel (service server).
  • Environment: The system was tested in ROS1 Noetic, with partial service-monitoring support ported to ROS2.
Figure 2: Motivating example with three components: Battery, Battery Supervisor, and LED Panel. Battery publishes on topic /battery_percentage; Battery Supervisor subscribes to /battery_percentage, publishes on topic /battery_status, and invokes service /SetLED; LED Panel publishes on topic /LED_Panel and responds to /SetLED service requests.

Key Insights and Ideas

  • Accuracy vs. Latency Trade-off: The "aha moment" is the quantitative proof that ordering is essential for correctness but expensive for performance. Without ordering, the monitor frequently produced false alarms. With ordering, accuracy was 100%, but service response times increased significantly.
  • Deadlock Risks: Buffering messages to wait for the "correct" order can lead to deadlocks if the system architecture has circular dependencies (e.g., a node waiting for a service response that is blocked by a message still stuck in the monitor's buffer).
  • Formalism Agnostic: Like its predecessor, ROSMonitoring 2.0 remains "formalism agnostic," meaning developers can use various logics (like LTL or MTL) to define their safety properties without changing the underlying monitoring tool.

Key Results

  • Verification Accuracy: Monitoring with ordering yielded zero incorrect assessments. In contrast, monitoring without ordering led to frequent false negatives because status updates often reached the monitor before the raw data that triggered them.
  • Performance Overhead: While basic service monitoring added negligible delay, the ordering mechanism introduced substantial overhead. For example, service request response times jumped from near-zero to over 1.5 seconds in some scenarios because the monitor had to wait for other topic buffers to fill before releasing the service request.

Limitations and Future Work

  • Deadlock Prevention: The authors acknowledge that their current buffering strategy can cause deadlocks. Future work involves formally verifying deadlock-freeness and establishing design principles to avoid it.
  • Timeouts: To handle unreliable networks where a message might never arrive (leaving a buffer empty forever), they plan to introduce timeouts into the ordering algorithm.
  • Expanding Scope: The team aims to support ROS Actions (long-running tasks with feedback) and complete the porting of all features to ROS2.

Summary updated

BibTeX
@misc{saadat2024rosmonitoring,
  author = {Maryam Ghaffari Saadat and Angelo Ferrando and Louise A. Dennis and Michael Fisher},
  title = {{ROSMonitoring 2.0: Extending ROS Runtime Verification to Services and Ordered Topics}},
  year = {2024},
  eprint = {2411.14367},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.14367},
}
Figure