A.R.G.U.S 2.1.0
Adaptive Real-Time Guardian for Unsafe Situations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RobotInterlock Class Reference

Thread-safe safety gate that owns interlock state transitions. More...

#include <RobotInterlock.hpp>

Public Member Functions

 RobotInterlock (RobotHardware &hardware) noexcept
 Construct interlock bound to a hardware implementation.
 
void onControlEvent (ControlEvent event, FreezeReason reason=FreezeReason::UNKNOWN_FAULT) noexcept
 Submit a control event to the interlock state machine.
 
void guardianHeartbeat (std::uint32_t tick) noexcept
 Update guardian heartbeat tick observed by interlock.
 
void watchdogCheck (std::uint32_t now, std::uint32_t max_allowed_delay) noexcept
 Evaluate watchdog timeout against last guardian heartbeat.
 
void operatorAcknowledge () noexcept
 Register operator acknowledge for motion resume attempts.
 
bool motionAllowed () const noexcept
 Query whether motion is currently allowed.
 
FreezeReason freezeReason () const noexcept
 Get currently latched freeze reason.
 
InterlockState state () const noexcept
 Get current interlock state.
 

Detailed Description

Definition at line 65 of file RobotInterlock.hpp.

Constructor & Destructor Documentation

◆ RobotInterlock()

RobotInterlock::RobotInterlock ( RobotHardware hardware)
explicitnoexcept
Parameters
hardwareHardware adapter used for freeze/enable side effects.

Definition at line 11 of file RobotInterlock.cpp.

Member Function Documentation

◆ freezeReason()

FreezeReason RobotInterlock::freezeReason ( ) const
noexcept
Returns
Freeze reason.

Definition at line 53 of file RobotInterlock.cpp.

◆ guardianHeartbeat()

void RobotInterlock::guardianHeartbeat ( std::uint32_t  tick)
noexcept
Parameters
tickMonotonic guardian tick counter.

Definition at line 28 of file RobotInterlock.cpp.

◆ motionAllowed()

bool RobotInterlock::motionAllowed ( ) const
noexcept
Returns
true when interlock state is SAFE.

Definition at line 49 of file RobotInterlock.cpp.

References SAFE.

◆ onControlEvent()

void RobotInterlock::onControlEvent ( ControlEvent  event,
FreezeReason  reason = FreezeReason::UNKNOWN_FAULT 
)
noexcept
Parameters
eventControl event (FREEZE_NOW or ALLOW_MOTION).
reasonAssociated freeze reason when applicable.

Definition at line 18 of file RobotInterlock.cpp.

References FREEZE_NOW.

◆ operatorAcknowledge()

void RobotInterlock::operatorAcknowledge ( )
noexcept

Definition at line 43 of file RobotInterlock.cpp.

References FROZEN.

◆ state()

InterlockState RobotInterlock::state ( ) const
noexcept
Returns
Interlock state.

Definition at line 57 of file RobotInterlock.cpp.

◆ watchdogCheck()

void RobotInterlock::watchdogCheck ( std::uint32_t  now,
std::uint32_t  max_allowed_delay 
)
noexcept
Parameters
nowCurrent monotonic tick.
max_allowed_delayMaximum allowed stale-heartbeat delay in ticks.

Definition at line 32 of file RobotInterlock.cpp.

References WATCHDOG_TIMEOUT.


The documentation for this class was generated from the following files: