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.
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.
Datasets
The researchers evaluated their system using two distinct setups:
- 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.
- 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