A dashboard has a Cancel button beside a running robot task. An operator clicks it, the interface receives a response, and the task immediately disappears from the screen. The display looks decisive. Yet the software may have acknowledged only a request to cancel, with the final outcome still unresolved.
For ROS 2 actions, a useful interface preserves that interval. Requesting cancellation, having that request accepted, and receiving a terminal result are different events. Understanding the distinction prevents a task record from claiming more than its evidence supports.
The documented state distinction
The official ROS 2 action design separates active states from terminal states. CANCELING is active: the server has accepted a cancellation request and may perform application-defined cleanup. CANCELED is terminal. The cancel-service response identifies goals transitioning to CANCELING; status and result interfaces establish whether a goal ultimately becomes CANCELED.
The document was written in 2019 and last modified in 2020. It explains the protocol design, not the timing, cleanup behavior, or physical guarantees of every deployed server. Those depend on the actual implementation and application.
An illustrative event trace
Imagine a hypothetical action that processes a batch of inspection images. This example does not control a physical machine. The client calls the batch Goal A, while the actual goal identifier remains attached to every recorded event.
At an invented elapsed time of 0.0 seconds, the client sends the goal. At 0.1 seconds, the server accepts it. At 2.0 seconds, the client receives progress feedback. At 2.5 seconds, the user requests cancellation. At 2.6 seconds, the client receives a response identifying Goal A as canceling. At 3.4 seconds, the terminal result reports CANCELED.
These times are invented for explanation. They are not latency targets, observations from ROS software, or a suggested timeout policy. The important feature is their ordering and the distinct meaning of each event.
At 2.5 seconds, the client knows that it attempted to request cancellation. At 2.6 seconds, it has evidence that the server accepted that request for Goal A. Only at 3.4 seconds does this example include the terminal cancellation outcome. A screen that labels the task Canceled at 2.5 seconds collapses three observations into one unsupported conclusion.
What belongs on the screen during the gap
A practical display can retain the task row and show Cancellation requested while the response is pending. After acceptance, Canceling describes the intermediate condition. Once the terminal result arrives, the row can show Canceled and retain the completion record. These labels are editorial interface suggestions, not additional ROS protocol states.
The distinction also helps explain a rejected request. The interface can report that cancellation was not accepted without silently relabeling the task as finished. If no conclusive response arrives, an unresolved label describes the client's knowledge more accurately than either a success or failure assertion.
Progress feedback has a separate role. A percentage or processed-item count describes progress reported for the goal. It should not be promoted into evidence of a terminal outcome merely because the number stopped changing or the display stopped receiving updates.
Keep identity attached to the outcome
Suppose another inspection batch, Goal B, is submitted while Goal A is still canceling. A single global task-status field can now mix observations from two different requests. A late result for A might overwrite the display for B, even though neither server response is inherently inconsistent.
The client should retain goal identity when presenting the event history. A useful record associates each send attempt, acceptance response, cancellation attempt, feedback item, and terminal result with the relevant goal. Local observation times can help reconstruct what the client saw, but should remain distinguishable from timestamps supplied by a server or another clock.
This is an application-recording recommendation. It does not claim that an arbitrary log proves complete delivery, that timestamps establish a total ordering across machines, or that a reconnection automatically restores all missing information. An incomplete history should remain visibly incomplete.
A replacement goal is a separate policy question
ROS 2's official Rolling tutorial explicitly says that behavior when a new goal arrives during an existing goal depends on the action server implementation. Its Turtlesim example accepts the replacement and aborts the prior goal; another server can behave differently. That example must not become a general assumption that sending B cancels A.
For the hypothetical inspection application, the team must define whether new batches are rejected, queued, or allowed concurrently. It must also define what cancellation does to partial results and resources. These are questions for that server's contract, rather than conclusions that follow from the presence of an action interface.
Software completion and physical state
An image-processing action makes the protocol distinction easy to see. A motion-related action introduces another evidence boundary. Even a terminal action result describes the software goal under the server's contract. It should not, by itself, be advertised as an independently measured physical stop or a safety-rated stopping function.
A product interface that needs to report physical state must identify the separate observations and validated behavior supporting that statement. This article provides no emergency-stop procedure and does not propose using an ordinary action-cancellation request as one.
The durable design choice is to let each observation keep its meaning. A request records intent, acceptance records the server's response to that intent, and a terminal result records the goal's reported outcome. Keeping those events visible makes a Cancel button easier to trust because the interface can explain what has happened and what is still unknown.
Image note: The accompanying site-library robot and computer image is a concept illustration. It does not show a tested ROS installation or evidence of a cancellation event.
Sources and further reading
ROS 2 Actions design document, written March 2019, modified May 2020:
https://design.ros2.org/articles/actions.html
ROS 2 Rolling documentation, Learning about actions tutorial source:
https://github.com/ros2/ros2_documentation/blob/rolling/source/ROS-Framework/interfaces/actions/Working-with-actions/Understanding-ROS2-Actions/Understanding-ROS2-Actions.rst
Sources checked October 23, 2026. Event times, interface suggestions, and interpretation: original ZHILIANHAI editorial analysis.