Common
rammp_common_interfaces. Two things no single subsystem owns: the
emergency stop, and the arbitration protocol for taking control of a
resource. Every arbitrated resource on the robot runs its own arbitration
server speaking this one protocol on its own namespace: the arm at the root,
the base under /base.
Emergency stop
EStop (msg)
Broadcast on /estop, best-effort, every 100 ms per publisher. The protocol lets
any node engage; on the chair the joystick’s e-stop button is what does, the MIB
owns the latch and is the only thing that can end a stop, and the arm driver reads
the topic and obeys. A ROS 2 node reads it rather than publishing it; how to pick
the latch’s state out of the traffic is on
Controlling the base. Engaging is fail-safe: an
ENGAGED from anyone is always acted on, never age- or sequence-checked.
| Field | Type | Meaning |
|---|---|---|
header | std_msgs/Header | The stamp is for the log only, never for decisions |
state | uint8 | STATE_ENGAGED (1) engages. STATE_NOT_ENGAGED (0) is a heartbeat, or a clear attempt. Any other value reads as engaged. |
source | string | Who published it (node name), for the log and the clear attempt |
reason | string | Free text, for the log |
pub_seq | uint32 | This publisher’s message number: +1 per message, wraps |
clear_target | string | Clear attempts only: whose engagement to clear. "" otherwise. |
clear_pub_seq | uint32 | Clear attempts only: the newest pub_seq the clearer had received from clear_target |
What a message means:
state | clear_target | Meaning | Who sends it |
|---|---|---|---|
ENGAGED | any | Engage | Any node |
NOT_ENGAGED | "" | Heartbeat: alive, not engaging. It never ends a stop. | Any node, every period |
NOT_ENGAGED | <source> | A clear attempt for that source’s engagement | The clearer only |
A plain NOT_ENGAGED is not a clear, or any node’s heartbeat would end another
node’s stop. The stop is released only when a clear attempt succeeds: the
target accepts it and answers NOT_ENGAGED with a newer pub_seq, within the
timeout. A source the clearer watches that goes silent longer than the timeout
counts as engaged.
It is not a std_msgs/Bool because the protocol is load-bearing. The .msg
mirrors the firmware’s rammp::EStop in
rammp-rtps , where the rules and
timings live. Subscribe best-effort, or a firmware publisher never matches.
Arbitration
Who may command a resource right now. A client acquires control, receives a token, and puts that token on every command the resource arbitrates. Engaging the e-stop and every new acquire both clear ownership and invalidate outstanding tokens.
AcquireControl (srv)
Acquire control of a resource. This seizes: if another owner holds it, the call succeeds anyway, halting their in-flight motion and settling their outstanding goals. By operational contract only the task orchestrator calls it.
| Field | Type | Meaning | |
|---|---|---|---|
| Request | owner_id | string | Human-readable label. Mirrors sender_id on arbitrated goals. |
token | uint8[16] | Optional pre-generated key, so one orchestrator key can cover several resources. All-zero, the default, means mint one. | |
| Response | accepted | bool | |
token | uint8[16] | The capability. Put it on every command this resource arbitrates. | |
generation | uint64 | ||
message | string |
A supplied key gives up what minting guarantees: every holder of the key is the owner at once, and a restart does not lock out a stale holder. Check that the returned token equals the one sent; a server that predates the field ignores it and mints.
ReleaseControl (srv)
Release control you hold. Refused unless the token matches the current owner.
| Field | Type | |
|---|---|---|
| Request | token | uint8[16] |
| Response | released | bool |
message | string |
RevokeControl (srv)
Operator override: take the resource from whoever holds it. Carries no token, because it is the recovery path for a crashed owner and ownership has no lease.
| Field | Type | |
|---|---|---|
| Request | reason | string |
| Response | revoked | bool |
message | string |
ControlStatus (msg)
Published on change, so a client that starts late learns the current state at once: the arm latches it, the base resends it every second. One publisher per arbitrated resource.
| Field | Type | Meaning |
|---|---|---|
header | std_msgs/Header | |
arbitration_enabled | bool | false means tokens are ignored. A launch-time parameter on the arm, a build-time constant on the MIB, true on the chair. |
estopped | bool | Latched. Nothing is admitted while true. |
owned | bool | Whether anyone holds the resource |
owner_id | string | Empty if none |
generation | uint64 | Bumps on every grant. A client compares it to detect that it was dispossessed. |
rejected_count | uint64 | Commands refused since start |
Where they are served
| Resource | Status | Services | Notes |
|---|---|---|---|
| The arm | /control_status | /acquire_control, /release_control, /revoke_control | QoS and rates in the arm interface reference |
| The base | /base/control_status | /base/acquire_control, /base/release_control, /base/revoke_control | The token goes on every TwistSetpoint, the base’s only tokened command. A release or revoke during autonomy drops the base to IDLE. See Taking the base. |
Both subscribe to the one /estop. The MIB owns its latch.