betaFeedback

WorksComputer Science

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

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.

Introduction

There are many techniques for checking the reliability of software systems. Some analyse a model before the system is deployed. Others observe the system while it is running. Runtime verification (RV) belongs to the second group [11]. An RV monitor receives events from one execution and checks whether they satisfy a formal property. The property can be checked online, as events are produced, or offline, over a recorded trace.

Runtime verification is useful for robotic applications because robots interact with changing environments. Not every execution can be predicted at design time. It is therefore useful to observe the actual execution and to react when a required property is violated.

The Robot Operating System (ROS) provides a common software platform for robotics. ROS 2 is used in many research and industrial systems and supports topics, services, and actions [12]. Topics carry streams of messages, while services implement request–response communication. Actions are used for operations that may take time to complete. A client sends a goal to an action server and receives an acceptance decision. While the goal is running, the server can publish feedback and status updates. The client can later request the result or ask the server to cancel the goal.

Although an action is presented to the developer as one communication mechanism, ROS 2 implements it using two topics and three services. These endpoints carry different parts of the same goal. lifecycle and relate to one another through goal identifiers. Monitoring them as unrelated topics and services loses this action-level information.

ROSMonitoring was introduced as a formalism-agnostic RV framework for ROS [7]. Its main idea is to separate the instrumentation of the robotic application from the oracle that implements the chosen specification language. Previous versions of ROSMonitoring support topic and service monitoring [7, 15], but do not reconstruct the lifecycle of ROS 2 actions.

An action monitor needs to know which lifecycle event is being observed and which goal it belongs to. It must remember accepted goals so that later feedback, status, result, and cancellation events can be correlated with the correct request. Enforcement must preserve the ROS 2 action protocol. When a goal request violates a property, the monitor cannot simply discard it, because the client would remain waiting for a response. Instead, the monitor must return a valid SendGoal.Response with accepted=false. Similarly, if a violation is detected while processing a feedback event, suppressing that feedback only prevents the client from observing it; it does not stop the goal already being executed by the server. In this paper, we extend ROSMonitoring with monitoring and enforcement support for ROS 2 actions. The extension keeps the existing topic and service monitoring infrastructure, but generates it from a single action declaration and adds the missing action semantics. In particular, the extension provides:

  • action-level instrumentation that expands one configured action into the two topics and three services used by the ROS 2 action protocol;

  • action events enriched with the lifecycle kind, action name, and goal identifier, together with state for accepted goals;

  • correlation of requests, responses, feedback, status updates, results, and cancellations belonging to the same action goal;

  • protocol-aware enforcement that can reject a new goal, cancel an accepted goal, suppress violating feedback or status updates, and construct valid rejection or aborted-result responses; and

  • an evaluation combining a robotic case study with a controlled scalability benchmark.

The action state maintained by the extension allows ROSMonitoring to operate as an external coordination layer in systems composed of multiple independent ROS 2 frameworks. By mediating action communication, it can enforce system-level properties that depend on the combined state of those frameworks. We demonstrate this through a simulated mobile manipulator that combines Nav2, MoveIt 2, and ros2_control. The monitor enforces an external safety contract that allows navigation only when the arm is in a safe configuration and rejects new arm-trajectory or gripper-opening goals while navigation is active. The case study shows that compliant goals are forwarded normally, while conflicting goals are rejected without modifying Nav2, MoveIt 2, or the robot controllers.

We complement this functional evaluation with a synthetic scalability benchmark. The benchmark varies the number of configured client–server pairs, the number of goals sent by each pair, and the amount of data returned by each action. Every configuration is executed five times in both baseline and monitored conditions, and the complete experimental configuration is recorded for every repetition.

The quantitative results show that, for one fixed client–server pair and a fixed result length, the added time is close to proportional to the number of action calls. However, the cost cannot be described by one universal per-action value. Longer results increase the number or size of monitored events, and configurations with more client–server pairs introduce an additional topology effect. The evaluation therefore demonstrates the functional usefulness of action-aware enforcement and characterises the overhead of the current synchronous implementation.

The rest of the paper is organised as follows. § 2 recalls the ROS 2 action protocol and the architecture of ROSMonitoring. § 3 presents the action declaration, generated endpoints, event correlation, goal state, and protocol-aware enforcement. § 4 presents the qualitative case study and the quantitative scalability experiments. § 5 discusses related work on runtime verification for robotic systems and ROS. Finally, § 6 concludes the paper.

Background

This section recalls the parts of ROS 2 and ROSMonitoring needed to present the extension. We first describe how actions are implemented in ROS 2. We then summarise the monitoring architecture provided by the previous versions of ROSMonitoring.

ROS 2 Actions

ROS 2 provides topics, services, and actions as its main communication mechanisms [12]. A topic supports asynchronous communication between publishers and subscribers. A service supports a request–response interaction between a client and a server. An action supports a longer-running interaction in which a client submits a goal and receives information about its execution over time.

An action interaction starts when the client sends a goal request. The action server can accept or reject the goal. If the goal is accepted, the server can publish feedback while executing it. The client can request the final result or ask the server to cancel the goal. The server also publishes status information about active and completed goals. An accepted goal may eventually succeed, be aborted, or be cancelled.

Each goal is identified by a UUID. This identifier connects the initial goal request with later feedback, status, result, and cancellation messages. Several goals may be active at the same time, including different instances of the same action. Action-aware monitoring must therefore preserve the association between each event and its goal.

Although an action is exposed to the developer as one communication mechanism, it is implemented using three services and two topics [13]. For an action named <name>, these endpoints are:

  • the <name>/_action/send_goal service, used to submit a goal and return the acceptance decision;

  • the <name>/_action/get_result service, used to request and return the final result;

  • the <name>/_action/cancel_goal service, used to request the cancellation of one or more goals;

  • the <name>/_action/feedback topic, used to publish goal-specific progress information; and

  • the <name>/_action/status topic, used to publish the state of active and recently completed goals.

These endpoints form one protocol. Their messages cannot always be monitored or modified independently. For example, suppressing the response that accepts a goal does not remove the goal from the server. Once the server has accepted it, stopping the operation requires a cancellation request containing the corresponding UUID. Similarly, suppressing feedback prevents the client from seeing an update but does not stop the action itself.

ROSMonitoring

ROSMonitoring is a formalism-agnostic framework for runtime monitoring of robotic applications [7]. Its architecture comprises a generator, generated ROS-facing monitors, and a separate verification oracle. These components separate application instrumentation from property evaluation.

The generator reads a YAML configuration identifying the application nodes, the communication channels to intercept, and whether their traffic should be logged or filtered. It produces the monitoring nodes and the remappings required to route the selected communication through them. At runtime, the generated monitors intercept messages and convert them into JSON events.

In logging mode, events are stored for offline analysis. In online filtering mode, the monitor sends each event to the oracle over a WebSocket connection and waits for a verdict before deciding whether to forward the intercepted communication. The oracle implements the selected property language and verification procedure; the ROS-facing monitor applies the resulting communication decisions. This interface allows different oracle implementations and specification formalisms to be used without changing the application instrumentation. A topic proxy can observe, record, and filter published messages. A service proxy can check both the request and the response while preserving the request–response interaction.

These mechanisms provide most of the transport-level support required for actions because an action is built from topics and services. However, configuring the five action endpoints separately does not recover their shared semantics. The generated events do not identify the action-lifecycle step, and the monitor does not automatically correlate messages belonging to the same goal. The existing filtering rules also do not determine which protocol-level response is required when a violation occurs.

The extension presented in the next section builds on the existing ROSMonitoring architecture while adding action-aware generation, event correlation, state management, and enforcement.

ROSMonitoring with Actions

As discussed in § 2, a ROS 2 action is implemented through two topics and three services. ROSMonitoring 2.0 can already generate proxies for these endpoints. However, five independent proxies do not tell the oracle which action step is being observed or which goal is involved. They also do not determine how a violating event should be handled without breaking the action protocol.

The extension adds this missing action-level information while keeping the existing ROSMonitoring architecture. The application1 still uses the standard ROS 2 ActionClient and ActionServer interfaces, and the oracle still exchanges JSON events and verdicts with the monitor. The extension changes two parts of the framework. First, the generator compiles one action declaration into the five topic and service proxies used by ROS 2. Second, the generated callbacks recognise action traffic, enrich it with lifecycle and goal information, maintain state for accepted goals, and apply action-specific responses to violations.

Figure 1 shows these two parts. Endpoint interception and oracle communication reuse the mechanisms of ROSMonitoring 2.0. The new code performs action expansion at generation time and adds event enrichment, goal correlation, state, and protocol-aware filtering at runtime.

Overview of action generation and lifecycle-aware monitoring

Figure 1. Overview of action generation and lifecycle-aware monitoring.

Action Declaration and Endpoint Generation

Instrumentation is configured through the same YAML file used by earlier versions of ROSMonitoring. The user can add an actions list to a monitor. Each entry gives the action name, its ROS 2 type, and the operation assigned to the generated endpoints. The available operations are log and filter. The protocol-aware reactions described below concern online filtering.

The optional clients and servers fields identify the nodes that must be remapped. The client declarations are applied to the three action services. The server declarations are applied to the feedback and status topics. Listing 1 shows the main fields for a navigation action. The corresponding node and launch-file declarations are omitted to keep the example short.

monitors:
  - monitor:
      id: navigation_monitor
      log: ./navigation_events.jsonl
      oracle:
        url: 127.0.0.1
        port: 8080
        action: nothing
      actions:
        - name: /navigate_to_pose
          type: nav2_msgs.action.NavigateToPose
          action: filter
          clients: [navigation_client]
          servers: [navigation_server]

Listing 1: Main configuration fields for monitoring a navigation action.

Before the normal monitor code is generated, each action entry is expanded into the endpoints shown in Table 1. The expansion reuses the existing topic and service generation path. It also converts the action types into the internal runtime classes used by rclpy. The status subscriber uses the standard ROS 2 action-status quality-of-service profile. The instrumented launch files remap the selected client and server traffic through the generated monitor.

EndpointRuntime type used by the generated monitor
<name>/_action/feedback<Action>.Impl.FeedbackMessage
<name>/_action/statusaction_msgs.msg.GoalStatusArray
<name>/_action/send_goal<Action>.Impl.SendGoalService
<name>/_action/get_result<Action>.Impl.GetResultService
<name>/_action/cancel_goalaction_msgs.srv.CancelGoal

Table 1. Endpoints generated from an action named <name> with type <Action>.

The user therefore describes a complete action once instead of listing five internal endpoints. The original topics and services fields remain available when a deployment needs to observe or filter only selected action endpoints. In both cases, action semantics are recognised from the standard /_action/ endpoint names.

Lifecycle Events and Goal State

When a generated callback receives action traffic, it adds an event_kind and an action_name to the JSON event. The event kind identifies the action step rather than only the transport endpoint. Goal UUIDs are copied from requests, feedback, and status messages. For a service response, the monitor retains the UUID obtained from the corresponding request. A status message can contain several goals, so its event carries all UUIDs reported in the message. Table 2 summarises the event kinds produced by the implementation.

TrafficEvent kindCorrelation information
send_goal requeststart_action_requestaction name and goal UUID
send_goal responsestart_action_responseaction name and UUID retained from the request
get_result request/responseget_result_request / get_result_responseaction name and correlated goal UUID
cancel_goal request/responsecancel_action_request / cancel_action_responseaction name and request selector; the response includes the accepted goal UUIDs
feedback topicfeedbackaction name and goal UUID
status topicstatusaction name and reported goal UUIDs

Table 2. Action traffic represented in the event stream.

For example, an oracle may require a navigation goal to start only when the robot arm is in a safe pose. The start_action_request event contains the navigation request, the action name, and its UUID. If the request is allowed, the server response is reported as a separate start_action_response event. Later feedback, status, result, and cancellation events can be related to the same goal. The monitor records an accepted goal only after two conditions hold: the server has returned accepted=true, and the oracle has allowed the corresponding response event. Accepted goals are stored in a dictionary keyed by the serialised UUID. Each entry contains the action name, the event time, flags that distinguish client- and monitor-initiated cancellation, and flags for cancellation and completion. This state is used when later topic or service events require an intervention. An entry is removed after an allowed result response or when a successful cancellation response lists the goal in goals_canceling.

The interface to the oracle is unchanged. In offline mode, the enriched events are written to the log. In online mode, the monitor sends each event as JSON through the WebSocket connection and waits for a verdict. The oracle can use any specification formalism that consumes this event stream; it does not need to know how the five underlying endpoints were generated.

Protocol-Aware Filtering

Filtering an action event cannot always mean dropping its underlying message. Before a goal reaches the server, the monitor can reject it directly. After the server has accepted it, the monitor must instead request cancellation. For other action steps, it must construct a response with the fields expected by the corresponding ROS 2 service. Table 3 lists the action-specific reactions implemented in filter mode.

Violation pointMonitor response
send_goal requestDo not call the server and return a synthetic response with accepted=false.
Accepted send_goal responseSend cancel_goal for the UUID and return accepted=false to the client.
Feedback or statusAttempt to cancel the reported goal or goals and suppress publication of the violating topic message.
get_result requestDo not forward the request and return a synthetic response with STATUS_UNKNOWN.
get_result responseReturn a synthetic response with STATUS_ABORTED.
cancel_goal requestDo not forward the request and return ERROR_REJECTED.
cancel_goal responseRepeat the server-side cancellation request and return ERROR_REJECTED.

Table 3. Protocol-aware response to a violating oracle verdict in filter mode.

Figure 2 shows the two checks performed while starting a goal. The first event is the start_action_request. If its verdict is violating, the monitor publishes a monitor error, does not call the action server, and returns accepted=false. Otherwise, the monitor forwards the request and receives a SendGoal.Response from the server. This response is sent to the oracle as a start_action_response, regardless of whether the server accepted or rejected the goal.

Sequence diagram showing a send_goal interaction between the Client Node, ROSMonitoring, Oracle, and Action Server in filter mode

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.

If the second verdict is non-violating, the original server response is returned to the client. When its accepted field is true, the goal is also entered in the monitor state. If the second verdict is violating and the server had accepted the goal, the monitor calls the generated cancel_goal proxy and waits for that service call to finish. It then returns a new SendGoal.Response with accepted=false. If the server had already rejected the goal, no cancellation is needed and the client simply receives a SendGoal.Response with accepted=false.

The table lists the points for which the extension adds an action-specific reaction. For get_result, request and response violations are handled differently. If a get_result request violates the property, the monitor does not forward it to the server and returns a protocol-compliant GetResult.Response with STATUS_UNKNOWN. The goal itself is not interrupted. If the server response violates the property instead, the monitor returns a GetResult.Response with STATUS_ABORTED.

The current online execution path is synchronous. A topic callback serialises and enriches the message, acquires the shared WebSocket lock, sends the event, and waits for the oracle reply. An intercepted service normally performs this exchange twice: once for the request and once for the response, with the downstream service call between them. All endpoints generated for one monitor share the same connection and lock. This preserves one order for the oracle exchanges and, under concurrent workloads, can delay independent goals. § 4 measures the overall cost of this synchronous execution path under sequential goal execution; it does not evaluate contention between concurrently active goals.

Evaluation

The evaluation addresses two complementary questions. First, can the action extension enforce safety properties that depend on the state of independent ROS 2 frameworks while allowing compliant action goals to proceed? Second, how does the runtime cost of the extension change with the number of action calls, the amount of data produced by each action, and the number of client–server pairs?

We answer the first question through a mobile-manipulation case study involving Nav2 and MoveIt 2. We answer the second through a synthetic benchmark in which the workload can be varied systematically. The two experiments therefore serve different purposes: the case study evaluates the functional behaviour of action-aware enforcement, while the benchmark measures its cost and scalability.

In both experiments, the baseline configuration executes the same scenario without ROSMonitoring. In the monitored configuration, the relevant action traffic passes through ROSMonitoring and is checked by the oracle.

Qualitative Experiments: Cross-Framework Safety

The qualitative experiments study whether ROSMonitoring can enforce properties that involve navigation and manipulation at the same time. These properties cannot be enforced by considering each framework in isolation because they depend on their combined state.

Platform and scope. The case study uses the Clearpath simulator with a Husky A200 mobile base, a Kinova Gen3 Lite arm, and a Kinova 2F Lite gripper [5]. The system runs on ROS 2 Jazzy and Gazebo Harmonic. Nav2 is used for navigation, MoveIt 2 for arm motion planning, and ros2_control for low-level control. All these components are standard ROS 2 packages and their source code is not modified. The case-study repository contains the selected robot configuration in robot.yaml, the ROSMonitoring configuration and properties, and a small set of nodes used to generate the experimental scenarios. The robot-specific robot.yaml file selects the required Clearpath configuration. Clearpath then generates the corresponding robot description, controllers, MoveIt configuration, and launch files. Nav2 and MoveIt 2 manage navigation and manipulation independently. However, neither framework has complete knowledge of the global robot state. Nav2 does not determine whether the arm is in a safe configuration for navigation, while MoveIt 2 does not determine whether an arm or gripper request is safe while a navigation goal is active. The case study uses ROSMonitoring as an external coordination layer that observes both frameworks and enforces constraints involving their combined state.

Properties and experimental design. We consider three cross-framework safety properties, expressed as LTL invariants. P1 permits navigation only when the arm is in one of two predefined configurations. In the STOWED configuration, the arm is folded close to the robot to minimise its footprint. In the CARRY configuration, the arm remains compact while keeping the gripper and any transported object in a position that does not obstruct the lidar. P2 rejects new arm-trajectory goals while a navigation goal is active. P3 rejects new gripper-opening goals while a navigation goal is active. The properties are defined as follows:

P1:G(nav_request⇒(arm_stowed∨arm_carry))P_1:\quad\mathbf{G}(\mathrm{nav\_request} \Rightarrow(\mathrm{arm\_stowed} \lor\mathrm{arm\_carry}))
P2:G(arm_request⇒¬navigation_active),P_2:\quad\mathbf{G}(\mathrm{arm\_request} \Rightarrow\neg\mathrm{navigation\_active}),
P3:G(gripper_open_request⇒¬navigation_active).P_3:\quad\mathbf{G}(\mathrm{gripper\_open\_request} \Rightarrow\neg\mathrm{navigation\_active}).

The operator G\mathbf{G} is the LTL globally operator and requires its argument to hold at every point of the execution. The predicates nav_request, arm_request, and gripper_open_request identify requests for a new navigation goal, arm trajectory, and gripper-opening operation, respectively. These predicates are true only for the corresponding request event. The predicates arm_stowed and arm_carry are derived from the observed arm-joint values. Finally, navigation_active indicates that Nav2 has accepted a navigation goal that has not yet terminated. Table 4 summarises how the three properties are used in the experiments.

PropertyEnforced conditionRole in the experiments
P1Navigation is permitted only when the arm is in STOWED or CARRY.The permitted case is exercised in both scenarios: the navigation goal is accepted and executed.
P2New arm-trajectory goals are rejected while a navigation goal is active.Scenario 1 sends a new arm-trajectory goal during navigation and checks that it is rejected.
P3New gripper-opening goals are rejected while a navigation goal is active.Scenario 2 sends a new gripper-opening goal during navigation and checks that it is rejected.

Table 4. Properties and their roles in the qualitative experiments.

The experiments are not intended as an exhaustive test of every possible property violation. Instead, they consider two representative workflows. In both workflows, P1 defines a valid initial condition and allows navigation to start normally. Once navigation is active, each scenario introduces a different conflicting request to exercise the enforcement of P2 or P3.

Monitoring implementation. The properties P1–P3 use Boolean values such as nav_request and arm_stowed. Before checking these properties, the oracle derives these values from the received JSON events. This step is implemented by the abstract_message() function.

The function recognises requests to navigate, move the arm, or open the gripper. It uses joint positions to check whether the arm is in STOWED or CARRY, and action responses and status updates to track whether navigation is active. The oracle is used to enforce the conjunction Φ=P1∧P2∧P3\Phi= P_1 \land P_2 \land P_3. Since all three properties are invariants whose violations can be determined from the current request and the maintained robot state, ROSMonitoring checks the body of the relevant invariant before forwarding an action goal. If forwarding the goal would violate Φ\Phi, ROSMonitoring returns a rejected action response before the goal reaches its action server. In the baseline configuration, the same action goals reach their corresponding servers without this additional check. The predicate navigation_active directly uses the action-lifecycle support introduced by the extension. It becomes true when Nav2 accepts a navigation goal and remains true until Nav2 reports a terminal status. The monitor must therefore relate the goal-acceptance event to a later lifecycle event rather than treating the underlying service and topic messages as independent events.

Scenario 1: navigation and arm coordination. The first automated scenario is executed in both the baseline and monitored configurations. The arm initially moves to the predefined STOWED configuration. Nav2 then receives a navigation goal that requires the robot to travel five metres. Since the arm is in STOWED, the goal satisfies P1 and navigation starts in both configurations. While the navigation goal is active, the scenario asks MoveIt 2 to move the arm from STOWED to READY. In the baseline execution, MoveIt 2 sends the resulting trajectory to the ros2_control controller and the arm moves while the robot is navigating.2 In the monitored execution, ROSMonitoring rejects the corresponding trajectory action goal before it reaches the controller, as required by P2.3 The requested arm movement is therefore not executed. Rejecting the arm trajectory does not interrupt the independent navigation goal. In both executions, the robot continues towards the same destination. After navigation terminates, navigation_active becomes false and a new request to move the arm to READY is permitted.

Scenario 2: box transport. The second automated scenario is also executed in the baseline and monitored configurations. The robot first picks up a box from the floor and moves the arm to the predefined CARRY configuration. Nav2 then receives a five-metre navigation goal. Since the arm is in CARRY, the goal satisfies P1 and is accepted in both configurations. After the robot has travelled two metres, the scenario sends a request to open the gripper. In the baseline execution, the request is accepted and the box is released.3 In the monitored execution, ROSMonitoring rejects the same gripper action goal because navigation_active is true, as required by P3.4 The gripper therefore remains closed while the robot continues towards the same destination.

Qualitative findings. The two scenarios exercise both the transparent and enforcing behaviours of the extension. Navigation goals satisfying P1 are forwarded and executed normally. Once navigation is active, the monitor uses the state of the accepted goal to reject an incompatible arm trajectory in Scenario 1 and an incompatible gripper goal in Scenario 2. The experiments also show that rejecting one action goal does not stop an independent action that is already running. In both scenarios, the unsafe manipulation request is rejected while the navigation goal continues. Moreover, ROSMonitoring returns a protocol-compliant goal rejection rather than simply dropping an underlying service request. This behaviour requires the action-level information introduced by the extension. The case study provides functional evidence that ROSMonitoring can coordinate actions managed by independent ROS 2 frameworks, preserve permitted behaviour, and reject representative cross-framework conflicts. These constraints are introduced externally, without modifying Nav2, MoveIt 2, ros2_control, or the robot controllers.

A dedicated controller could also enforce P1–P3. Here, users define the properties, while ROSMonitoring provides the action interception and the mechanisms needed to reject conflicting goals.

Quantitative Experiments: Scalability

The qualitative experiments demonstrate the extension in a robotic scenario. To study monitoring cost under controlled workloads, we use the ROS 2 Fibonacci action interface with a benchmark server.

Each goal specifies a sequence length ss. Starting from 0 and 1, the server computes the first ss Fibonacci numbers, publishes the growing sequence as feedback after each additional element, and returns the completed sequence as the result. No artificial execution delay is introduced. Varying ss therefore changes both the result size and the feedback traffic, while varying the number of goals changes how often the action lifecycle is executed. This simple workload allows us to study monitoring overhead without the additional behaviour of navigation or manipulation software.

Experimental design. The experiments were run on a machine equipped with an AMD Ryzen 5 3600 processor, an NVIDIA GeForce RTX 2080 graphics card, and 16GB of DDR4 memory clocked at 3200MHz.

The monitored configuration uses an always-true oracle. It parses each incoming JSON event and returns a non-violating verdict without evaluating a temporal property. The benchmark therefore measures the monitoring infrastructure with minimal verdict logic, including interception, serialisation, event exchange, and forwarding. Application-specific property evaluation may introduce additional cost. The benchmark creates nn distinct action client–server pairs. All nn ActionClients are hosted by one client node, while all nn ActionServers are hosted by one server node. Goals are executed sequentially: the client waits for each result before sending the next goal, including when switching between action pairs. Therefore, nn varies the number of configured action interfaces, not the number of simultaneously active goals. Each pair receives gg action goals, so one measured execution contains a=n⋅ga = n \cdot g goals. Each server returns a Fibonacci sequence of length ss; throughout the paper, we call it sequence length because it is the number of returned elements. We evaluate every combination n∈1,…,20n \in1,\ldots,20, g∈1,…,20g \in1,\ldots,20, and s∈2,…,20s \in2,\ldots,20. This gives 7,600 conditions. Each condition is repeated five times, producing 38,000 paired repetitions and 76,000 individual executions across the baseline and monitored configurations. Across all repetitions, the baseline executes 4,189,500 goals and the monitored configuration executes the same number, for 8,379,000 goal executions in total. The baseline timings contain occasional large positive spikes. We therefore use the median of the five repetitions for each condition as the main estimate. All figures and summary values below use these condition medians. We report the added time ΔT=TM−T0\Delta T = T_M - T_0 and the slowdown TM/T0T_M/T_0, where T0T_0 is the baseline elapsed time and TMT_M is the monitored elapsed time.

Timing starts after all action servers are available and ends after the client receives the final goal result. Process launch and the initial wait for server availability are outside the measured interval.

Figure 3 presents the results. Its four panels address three questions: whether overhead accumulates with repeated action calls, whether it changes with sequence length, and whether distributing the same number of goals across more client–server pairs introduces an additional cost.

Figure 3. Benchmark results based on the median of five complete executions for each condition. Panel (a) shows repeated action calls from one client–server pair. Panels (b) and (c) show how slowdown and added time per action change with sequence length. Panel (d) compares configurations with more pairs against configurations with more goals per pair while keeping the total goal count fixed. Shaded regions show the interquartile range.

Overall cost. Across the 7,600 conditions, the median added time is 0.885s and the median slowdown is 6.52, with an interquartile range from 5.58 to 7.74. Monitoring is slower in 7,599 conditions. The single exception contains large positive spikes in the baseline repetitions and does not indicate a performance advantage. At the largest tested setting, (n,g,s)=(20,20,20)(n,g,s) = (20,20,20), one execution contains 400 goals. Median elapsed time rises from 0.877s without monitoring to 8.766s with monitoring. This corresponds to 7.890s of added time and a slowdown of 10.00. These measurements show that the cost of the current implementation is not negligible under a dense workload of short actions. The slowdown values must also be read in the context of this benchmark. Fibonacci goals complete quickly, and the fixed work required to intercept, serialise, check, and forward their events forms a large part of their execution time. The ratios should therefore not be transferred directly to longer robotic actions. Nevertheless, they show that the current synchronous monitoring path requires optimisation before it can be used for workloads containing many short or frequent actions.

Cost of repeated action calls. The setting n=1n = 1 isolates one client–server pair. Holding ss fixed and raising gg from 1 to 20 tests how the total monitoring overhead changes when the same pair calls its action repeatedly. As shown in Figure 3(a), the total added time grows almost linearly with gg. For each of the 19 sequence lengths, a straight line explains between 98.5% and 99.8% of the observed variation. Lines constrained to pass through the origin also match the measurements closely, supporting an approximately

proportional relationship. The result can be summarised as ΔT(1,g,s)≈g⋅cs\Delta T(1,g,s) \approx g \cdot c_s, where csc_s is the marginal cost of one action call for a fixed sequence length and topology. For the sequence lengths shown in the figure, this cost is approximately 5–8ms per action. Thus, each additional action contributes approximately the same amount of overhead. The result does not indicate that the monitor becomes slower over time or that later calls are more expensive. This behaviour follows from the event-based operation of the monitor. Each additional goal produces new protocol traffic and new oracle interactions. Their processing costs are added to the elapsed time of the complete execution. The measurements therefore do not support interpreting the overhead mainly as a one-time setup cost associated with creating the client–server pair. The coefficient csc_s measures the added time associated with one complete action lifecycle. It combines the cost of checking the goal request and response, feedback and status messages, and the result request and response. It is therefore a per-action cost rather than a per-event cost.

Effect of sequence length. Panels (b) and (c) of Figure 3 show that action count alone does not explain the overhead. At s=2s = 2, the median slowdown is 4.68 and the median added time per action is 5.45ms. At s=20s = 20, these values increase to 8.80 and 16.80ms, respectively. Over the same range, median monitored time increases by a factor of 2.53, while baseline time increases by a factor of 1.39. This difference is consistent with how online monitoring is implemented. Each intercepted message is converted to JSON and sent to the oracle, and the monitor waits for the oracle response before continuing. Longer sequences produce larger feedback and result payloads. They can also produce more feedback events because the server publishes partial sequences while constructing the result. Both effects increase the work performed by the monitor. The measurements do not separate the cost of larger payloads from the cost of additional feedback events. They nevertheless show that there is no universal per-action overhead. The cost depends on the action traffic exposed to the monitor, and therefore on both the number and the size of the events generated by an action. This result points to compact event representations and selective monitoring of relevant lifecycle events as possible optimisations.

Effect of topology. The total number of goals a=n⋅ga = n \cdot g can be kept fixed while changing how those goals are distributed. For every setting with n>gn > g, we compare (n,g,s)(n,g,s) with (g,n,s)(g,n,s). The first configuration uses more configured client–server pairs, while the second sends more goals through each pair. Both execute the same number of goals and use the same sequence length. This gives 190 matched comparisons for each sequence length and 3,610 matched comparisons in total. Of these, a contiguous block affected by anomalous timing measurements was excluded from the analysis. Specifically, we excluded matched comparisons involving (n,g)=(8,19)(n,g) = (8,19), (8,20)(8,20), or (9,g)(9,g) with g∈{1,…,17}g \in\{1,\ldots,17\}. This leaves 3,268 matched comparisons. Figure 3(d) shows that the two configurations do not have the same execution time. In the monitored configuration, the median ratio between the run with more pairs and its swapped run is 1.032 at s=2s = 2 and 1.169 at s=20s = 20. Thus, at the longer sequence length, distributing the same goals across more pairs is 16.9% slower at the median. In the baseline configuration, the corresponding ratio remains close to 1.08 across the sequence lengths. The number of goals is therefore the main scaling factor, but topology also matters. More pairs introduce additional action endpoints, middleware entities, discovery traffic, and scheduling work, while the number of nodes and processes remains fixed. Oracle exchanges share one WebSocket lock and are therefore serialised. However, since goals are issued sequentially, this experiment does not measure contention between concurrently active goals and does not isolate the causes of the observed topology effect. The shared connection remains an important target for investigation under concurrent workloads.

Discussion and limitations. The two evaluations provide complementary results. The case study demonstrates protocol-aware enforcement, while the benchmark characterises its runtime cost. At fixed sequence length, added time grows approximately with the number of goals. Sequence length and the distribution of goals across configured pairs are associated with smaller additional effects. These results concern the current sequential and synchronous implementation; they do not represent an inherent lower bound for action monitoring. Future optimisation should reduce event volume and the cost of synchronous exchanges with the oracle.

The benchmark measures the total added elapsed time. It does not separate communication between the monitor and the oracle from monitor processing and oracle evaluation. Further profiling is needed to measure these contributions and identify the main sources of overhead.

Related Work

Runtime verification has been integrated with ROS at several abstraction levels. An early ROS-specific approach is ROSRV, introduced by Huang et al. [10]. ROSRV provides transparent instrumentation that intercepts ROS commands and messages and checks them against formally specified safety and security properties using generated monitors. ROSMonitoring subsequently adopted a different architecture, separating ROS instrumentation from the oracle that implements the monitoring formalism [7]. This makes the ROS-facing part of the framework independent of the property language used by the oracle. ROSMonitoring 2.0 extended the same approach to ROS 2, including support for service monitoring [15]. These works are the closest predecessors of the present paper. Our extension retains the topic and service instrumentation of ROSMonitoring 2.0, but raises the monitored abstraction from individual endpoints to a goal-correlated action lifecycle.

Other work has connected ROS and ROS 2 to particular specification and monitoring technologies. Perez et al. generate ROS 2 monitoring nodes from structured requirements by integrating FRET, Ogma, and Copilot [14]. Stadler et al. proposed flexible runtime-monitoring support for ROS applications [18] and subsequently presented ROMoSu, a framework for configurable runtime monitoring of ROS-based systems [17]. Begemann et al. introduced the TeSSLa-ROS-Bridge, which connects ROS-based robotic systems to TeSSLa [2]. RTAMT provides quantitative monitoring of Signal Temporal Logic properties and includes a ROS integration [19]. More recently, Baumeister et al. presented an adapter connecting RTLola monitors to ROS topics and services [1]. These integrations focus on monitoring nodes, streams, topics, or services; to the best of our knowledge, they do not represent a ROS 2 action as a goal-correlated lifecycle.

Runtime monitoring also appears in broader runtime-assurance architectures for robotics. Desai et al. combine model checking of high-level robotic software with online monitoring of assumptions about lower-level controllers [6]. SOTER places a language-based runtime-assurance architecture on top of ROS to protect distributed mobile robotic systems [16]. For robot swarms, Hu et al. study hierarchical runtime verification [9] and decentralised enforcement [8]. These approaches enforce safety at the level of controllers, behaviours, or swarm properties. In contrast, our enforcement operates on the ROS 2 communication protocol: a violation may reject a goal, cancel an accepted goal, suppress feedback or status traffic, or produce a valid protocol response.

Recent work also considers the wider engineering context in which runtime verification is deployed. Caldas et al. study runtime verification and field testing for ROS-based robotic systems and identify guidelines for designing applications that support runtime observation and testing [4]. At the architectural level, Safe-ROS separates normal autonomous control from independently verifiable Safety Instrumented Functions [3]. These approaches concern the wider runtime-assurance architecture, whereas our work exposes and mediates the semantics of a specific ROS 2 communication abstraction.

To the best of our knowledge, existing ROS runtime-verification approaches do not treat a ROS 2 action as a single monitored protocol correlated by goal identifier with action-specific enforcement. Our contribution is an action-aware instrumentation and enforcement layer extending ROSMonitoring’s formalism-agnostic architecture to this previously unsupported abstraction.

Conclusion and Future Work

We extended ROSMonitoring with support for ROS 2 actions. A single action declaration generates the five protocol endpoints, while the monitor adds lifecycle information, goal correlation, and protocol-aware enforcement. The mobile-manipulation case study showed that permitted goals proceed normally and that new conflicting arm and gripper goals can be rejected without interrupting navigation or modifying the underlying frameworks. The benchmark found approximately proportional growth in added time with the number of goals at fixed sequence length, together with additional effects associated with sequence length and goal distribution.

Future work will investigate a C++ implementation of the ROS-facing monitor using rclcpp and a native oracle integrated with the monitor. We will compare this approach with the existing external oracle to assess the trade-off between performance and flexibility. Further experiments will evaluate concurrent goals, cancellation, late feedback, and server failures.

We also plan to investigate predictive runtime verification. An action may satisfy the properties when it starts but lead to a violation during execution or when its goal is reached. Predicting such violations requires information about how the action and its environment may evolve.

Another direction is to combine action monitoring with state machines describing the robot’s current condition. For example, after a grasp action has finished, the robot may still be holding a fixed handle. Starting navigation in that state could be unsafe even though no arm action is running.

AI Usage

OpenAI’s ChatGPT (GPT-5.6 SOL) was used to support the preparation and language editing of this paper. The authors remain responsible for checking all technical claims, experimental results, figures, and references before submission.

References

  1. [1]Jan Baumeister, Bernd Finkbeiner, Franz Jünger, Florian Kohn, Sebastian Schirmer & Christoph Torens (2025): A ROS Adapter for RTLola. In Bettina Königshofer & Hazem Torfah, editors: Runtime Verification - 25th International Conference, RV 2025, Graz, Austria, September 15-19, 2025, Proceedings, Lecture Notes in Computer Science 16087, Springer, pp. 92–100, doi:10.1007/978-3-032-05435-7_6.DOI
  2. [2]Marian Johannes Begemann, Hannes Kallwies, Martin Leucker & Malte Schmitz (2023): TeSSLa-ROS-Bridge - Runtime Verification of Robotic Systems. In Erika Ábrahám, Clemens Dubslff & Silvia Lizeth Tapia Tarifa, editors: Theoretical Aspects of Computing - ICTAC 2023 - 20th International Colloquium, Lima, Peru, December 4-8, 2023, Proceedings, Lecture Notes in Computer Science 14446, Springer, pp. 388–398, doi:10.1007/978-3-031-47963-2_23.DOI
  3. [3]Diana C. Benjumea, Marie Farrell & Louise A. Dennis (2025): Safe-ROS: An Architecture for Autonomous Robots in Safety-Critical Domains. In Matt Luckcuck, Maike Schwammberger & Mengwei Xu, editors: Proceedings Seventh International Workshop on Formal Methods for Autonomous Systems, FMAS@iFM 2025, Paris, 17th to 19th of November 2025, EPTCS 436, pp. 48–68, doi:10.4204/EPTCS.436.6.DOI
  4. [4]Ricardo Caldas, Juan Antonio Piñera García, Matei Schiopu, Patrizio Pelliccione, Genaína Nunes Rodrigues & Thorsten Berger (2024): Runtime Verification and Field-Based Testing for ROS-Based Robotic Systems. IEEE Trans. Software Eng. 50(10), pp. 2544–2567, doi:10.1109/TSE.2024.3444697.DOI
  5. [5]Clearpath Robotics (2025): Manipulation in Gazebo Ignition. https://docs.clearpathrobotics.com/docs/ros2humble/ros/tutorials/manipulation/gazebo/. Accessed 17 August 2026.
  6. [6]Ankush Desai, Tommaso Dreossi & Sanjit A. Seshia (2017): Combining Model Checking and Runtime Verification for Safe Robotics. In Shuvendu K. Lahiri & Giles Reger, editors: Runtime Verification - 17th International Conference, RV 2017, Seattle, WA, USA, September 13-16, 2017, Proceedings, Lecture Notes in Computer Science 10548, Springer, pp. 172–189, doi:10.1007/978-3-319-67531-2_11.DOI
  7. [7]Angelo Ferrando, Rafael C. Cardoso, Michael Fisher, Davide Ancona, Luca Franceschini & Viviana Mascardi (2020): ROSMonitoring: A Runtime Verification Framework for ROS. In: Towards Autonomous Robotic Systems, Lecture Notes in Computer Science 12228, Springer, pp. 387–399, doi:10.1007/978-3-030-63486-5_40.DOI
  8. [8]Chi Hu, Wei Dong, Yonghui Yang, Hao Shi & Fei Deng (2020): Decentralized runtime enforcement for robotic swarms. Frontiers Inf. Technol. Electron. Eng. 21(11), pp. 1591–1606, doi:10.1631/FITEE.2000203.DOI
  9. [9]Chi Hu, Wei Dong, Yonghui Yang, Hao Shi & Ge Zhou (2020): Runtime Verification on Hierarchical Properties of ROS-Based Robot Swarms. IEEE Trans. Reliab. 69(2), pp. 674–689, doi:10.1109/TR.2019.2923681.DOI
  10. [10]Jeff Huang, Cansu Erdogan, Yi Zhang, Brandon M. Moore, Qingzhou Luo, Aravind Sundaresan & Grigore Rosu (2014): ROSRV: Runtime Verification for Robots. In Borzoo Bonakdarpour & Scott A. Smolka, editors: Runtime Verification - 5th International Conference, RV 2014, Toronto, ON, Canada, September 22-25, 2014. Proceedings, Lecture Notes in Computer Science 8734, Springer, pp. 247–254, doi:10.1007/978-3-319-11164-3_20.DOI
  11. [11]Martin Leucker & Christian Schallhart (2009): A Brief Account of Runtime Verification. The Journal of Logic and Algebraic Programming 78(5), pp. 293–303, doi:10.1016/j.jlap.2008.08.004.DOI
  12. [12]Steven Macenski, Tully Foote, Brian Gerkey, Chris Lalancette & William Woodall (2022): Robot Operating System 2: Design, Architecture, and Uses in the Wild. Science Robotics 7(66), p. eabm6074, doi:10.1126/scirobotics.abm6074.DOI
  13. [13]Open Robotics (2019): Actions. ROS 2 Design. Available at https://design.ros2.org/articles/actions.html. Accessed 27 July 2026.
  14. [14]Ivan Perez, Anastasia Mavridou, Thomas Pressburger, Alexander Will & Patrick J. Martin (2022): Monitoring ROS2: from Requirements to Autonomous Robots. In Matt Luckcuck & Marie Farrell, editors: Proceedings Fourth International Workshop on Formal Methods for Autonomous Systems (FMAS) and Fourth International Workshop on Automated and verifiable Software sYstem DEvelopment (ASYDE), FMAS/ASYDE@SEFM 2022, and Fourth International Workshop on Automated and verifiable Software sYstem Development (ASYDE)Berlin, Germany, 26th and 27th of September 2022, EPTCS 371, pp. 208–216, doi:10.4204/EPTCS.371.15.DOI
  15. [15]Maryam Ghaffari Saadat, Angelo Ferrando, Louise A. Dennis & Michael Fisher (2024): ROSMonitoring 2.0: Extending ROS Runtime Verification to Services and Ordered Topics. In: Proceedings of the 6th Workshop on Formal Methods for Autonomous Systems, Electronic Proceedings in Theoretical Computer Science 411, pp. 38–55, doi:10.4204/EPTCS.411.3.DOI
  16. [16][16*] Sumukh Shivakumar, Hazem Torfah, Ankush Desai & Sanjit A. Seshia (2020): SOTER on ROS: A Run-Time Assurance Framework on the Robot Operating System. In Jyotirmoy Deshmukh & Dejan Nickovic, editors: Runtime Verification - 20th International Conference, RV 2020, Los Angeles, CA, USA, October 6-9, 2020, Proceedings, Lecture Notes in Computer Science 12399, Springer, pp. 184–194, doi:10.1007/978-3-030-60508-7_10.DOI
  17. [17]Marco Stadler & Michael Vierhauser (2023): ROMoSu: Flexible Runtime Monitoring Support for ROS-based Applications. In: 5th IEEE/ACM International Workshop on Robotics Software Engineering, RoSE@ICSE 2023, Melbourne, Australia, May 15, 2023, IEEE, pp. 53–60, doi:10.1109/RoSE59155.2023.00013.DOI
  18. [18]Marco Stadler, Michael Vierhauser & Jane Cleland-Huang (2022): Towards flexible runtime monitoring support for ROS-based applications. In Andreas Angerer, Federico Ciccozzi, Ivano Malavolta & Andreas Wortmann, editors: Proceedings of the 4th International Workshop on Robotics Software Engineering, RoSE 2022, Pittsburgh, Pennsylvania, 9 May 2022, ACM, pp. 43–46, doi:10.1145/3526071.3527515.DOI
  19. [19]Tomoya Yamaguchi, Bardh Hoxha & Dejan Nickovic (2024): RTAMT - Runtime Robustness Monitors with Application to CPS and Robotics. Int. J. Softw. Tools Technol. Transf. 26(1), pp. 79–99, doi:10.1007/s10009-023-00720-3.DOI

Paper details

vlnc:W_2rxqueyq
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 2

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

GPT-5.6 Sol (bare)

View statement
Looking for related papers…
Contents