|
A.R.G.U.S 2.1.0
Adaptive Real-Time Guardian for Unsafe Situations
|
Event-driven safety state machine with callback hooks. More...
#include <GuardianStateMachine.hpp>
Public Member Functions | |
| GuardianStateMachine (int fc=30, int rc=3) | |
| Construct the FSM with frame-count hysteresis thresholds. | |
| void | processEvent (GuardianEvent event) |
| Process an explicit FSM event. | |
| void | processFrame (FrameStatus status) |
| Convenience wrapper that maps frame status to an FSM event. | |
| void | operatorAcknowledge () |
| Inject an operator acknowledge event. | |
| void | setOnFreezeCallback (std::function< void()> callback) |
| Register callback fired when freeze is commanded. | |
| void | setOnClearFreezeCallback (std::function< void()> callback) |
| Register callback fired when freeze is cleared. | |
| void | setOnStateChangeCallback (std::function< void(GuardianState, GuardianState)> callback) |
| Register callback fired on state transitions. | |
| GuardianState | getState () const |
| Get current FSM state. | |
| bool | isMotionBlocked () const |
| True when guardian currently blocks motion. | |
| bool | isMotionAllowed () const |
| True when motion is currently allowed. | |
| int | getBadCount () const |
| Get current consecutive bad-frame count. | |
| int | getGoodCount () const |
| Get current consecutive good-frame count. | |
| std::string | stateToString (GuardianState state) const |
| Convert a state enum to a readable string. | |
| std::string | getCurrentStateString () const |
| Return readable string for current state. | |
| void | printStatus () const |
| Print a status snapshot for debugging. | |
Integration model:
processFrame(...) is called for each vision decision.operatorAcknowledge() is called when operator input is received.Definition at line 63 of file GuardianStateMachine.hpp.
| GuardianStateMachine::GuardianStateMachine | ( | int | fc = 30, |
| int | rc = 3 |
||
| ) |
| fc | Consecutive bad frames required to freeze. |
| rc | Consecutive good frames required to clear after ack. |
Definition at line 24 of file GuardianStateMachine.cpp.
| int GuardianStateMachine::getBadCount | ( | ) | const |
Definition at line 314 of file GuardianStateMachine.cpp.
| std::string GuardianStateMachine::getCurrentStateString | ( | ) | const |
Definition at line 343 of file GuardianStateMachine.cpp.
References stateToString().
Referenced by printStatus().
| int GuardianStateMachine::getGoodCount | ( | ) | const |
Definition at line 318 of file GuardianStateMachine.cpp.
| GuardianState GuardianStateMachine::getState | ( | ) | const |
Definition at line 302 of file GuardianStateMachine.cpp.
| bool GuardianStateMachine::isMotionAllowed | ( | ) | const |
Definition at line 310 of file GuardianStateMachine.cpp.
| bool GuardianStateMachine::isMotionBlocked | ( | ) | const |
Definition at line 306 of file GuardianStateMachine.cpp.
| void GuardianStateMachine::operatorAcknowledge | ( | ) |
Definition at line 272 of file GuardianStateMachine.cpp.
References OPERATOR_ACK, and processEvent().
Referenced by AppController::runGuardianScenarioDemo().
| void GuardianStateMachine::printStatus | ( | ) | const |
Definition at line 354 of file GuardianStateMachine.cpp.
References getCurrentStateString().
Referenced by AppController::runGuardianScenarioDemo().
| void GuardianStateMachine::processEvent | ( | GuardianEvent | event | ) |
Definition at line 185 of file GuardianStateMachine.cpp.
References CLEAR_FREEZE, FRAME_BAD, FRAME_GOOD, FREEZE_NOW, FROZEN_UNSAFE, NONE, OPERATOR_ACK, RESET_PENDING, and SAFE_MONITORING.
Referenced by operatorAcknowledge(), and processFrame().
| void GuardianStateMachine::processFrame | ( | FrameStatus | status | ) |
Definition at line 255 of file GuardianStateMachine.cpp.
References FRAME_BAD, FRAME_GOOD, and processEvent().
Referenced by AppController::runGuardianScenarioDemo().
| void GuardianStateMachine::setOnClearFreezeCallback | ( | std::function< void()> | callback | ) |
Definition at line 288 of file GuardianStateMachine.cpp.
Referenced by AppController::runGuardianScenarioDemo().
| void GuardianStateMachine::setOnFreezeCallback | ( | std::function< void()> | callback | ) |
Definition at line 284 of file GuardianStateMachine.cpp.
Referenced by AppController::runGuardianScenarioDemo().
| void GuardianStateMachine::setOnStateChangeCallback | ( | std::function< void(GuardianState, GuardianState)> | callback | ) |
Definition at line 292 of file GuardianStateMachine.cpp.
Referenced by AppController::runGuardianScenarioDemo().
| std::string GuardianStateMachine::stateToString | ( | GuardianState | state | ) | const |
Definition at line 329 of file GuardianStateMachine.cpp.
References FROZEN_UNSAFE, RESET_PENDING, and SAFE_MONITORING.
Referenced by getCurrentStateString().