86 void guardianHeartbeat(std::uint32_t tick)
noexcept;
95 std::uint32_t max_allowed_delay)
noexcept;
100 void operatorAcknowledge()
noexcept;
106 bool motionAllowed()
const noexcept;
122 void attemptResume()
noexcept;
126 std::atomic<InterlockState> state_;
127 std::atomic<bool> operator_ack_;
128 std::atomic<FreezeReason> freeze_reason_;
129 std::atomic<std::uint32_t> last_guardian_tick_;
141 bool freezeMotion()
noexcept override;
147 bool enableMotion()
noexcept override;
150 static void GPIO_WritePin(
int pin,
bool value)
noexcept;
152 static constexpr int ARM_ENABLE_PIN = 1;
153 static constexpr int CUTTER_ENABLE_PIN = 2;
FreezeReason
Latched freeze/fault reason.
@ UNKNOWN_FAULT
Unspecified fault reason.
@ MARKER_LOST
Vision lost expected marker.
@ POSITION_ERROR
Position-related safety violation.
@ VISION_TIMEOUT
Vision heartbeat/timing failure.
@ DEPTH_EXCEEDED
Forbidden depth-layer/colour detected.
@ NONE
No freeze reason currently latched.
@ MARKER_OUT_OF_ROI
Marker/tool moved outside allowed ROI.
@ WATCHDOG_TIMEOUT
Guardian heartbeat timeout.
InterlockState
Interlock state machine output states.
@ FROZEN
Motion blocked due to safety freeze.
@ FAULT
Motion blocked due to hardware/path fault.
ControlEvent
Control commands issued to the interlock.
@ ALLOW_MOTION
Attempt to allow motion when safety conditions permit.
@ FREEZE_NOW
Immediately freeze/deny motion.
Basic physical hardware adapter for interlock freeze/enable actions.
Abstract hardware contract used by RobotInterlock.
virtual ~RobotHardware()=default
virtual bool freezeMotion() noexcept=0
Immediately stop motion output.
virtual bool enableMotion() noexcept=0
Re-enable motion output after safe/ack conditions.
Thread-safe safety gate that owns interlock state transitions.