Operations
This section describes the operations API for executing diagnostic operations such as ROS 2 services and actions.
Operations Overview
An operation resource represents an executable diagnostic object. In ros2_medkit, operations map to:
ROS 2 Services - Synchronous operations that return immediately with results
ROS 2 Actions - Asynchronous operations that return an execution ID for status tracking
The API supports:
Synchronous execution: Service calls return after the operation completes
Asynchronous execution: Action goals return immediately with an execution ID; clients poll for status
The endpoint shall list all supported operations that can be executed on the addressed entity. Response attributes:
|
The endpoint shall return the definition and metadata of the addressed operation. Response attributes:
|
The endpoint shall start a new execution of the addressed operation on the entity. Request body:
Response for synchronous execution (200 OK):
Response for asynchronous execution (202 Accepted):
|
The endpoint shall list active and past executions of the addressed operation. Response:
|
The endpoint shall return the current status and any result details of the addressed operation execution. Response:
|
The endpoint shall control the addressed operation execution (e.g. execute, freeze, reset, stop) and may update execution parameters, if supported. Request body:
Supported capabilities for ROS 2 actions:
Response:
|
The endpoint shall terminate the addressed operation execution (if still running) and remove its execution resource, if cancellation is supported. Response: 204 No Content on successful termination |
ExecutionStatus Values
The SOVD ExecutionStatus type maps to ROS 2 action statuses:
SOVD Status |
ROS 2 Action Status |
|---|---|
running |
ACCEPTED, EXECUTING, CANCELING |
completed |
SUCCEEDED |
failed |
CANCELED, ABORTED |
stopped |
(not directly mapped) |
Capability Mapping
SOVD operation capabilities map to ROS 2 as follows:
Capability |
Description |
ROS 2 Mapping |
Method |
|---|---|---|---|
execute |
Start operation |
Send action goal |
POST |
stop |
Stop operation |
Cancel action |
PUT |
terminate |
Stop + remove |
Cancel + cleanup |
DELETE |
status |
Get status |
Get goal status |
GET |
freeze |
I/O control |
Not applicable |
— |
reset |
I/O control |
Not applicable |
— |