State Machine Approach#
Derive from an abstract state that automatically handles shutdown checks.
State Machine Approach for User Use#
Abstract base class for all robot behavior states.
Users create custom states by inheriting from this class and implementing
the execute() method. This approach is completely optional. It is solely available
for those who are comfortable with a more advanced approach.
- This framework provides:
Automatic loop cancellation
Safe shutdown handling
Consistent state lifecycle hooks
- class go2.states.robot_state.Go2StateAbstract(unitree_controller: Go2Controller)[source]#
Bases:
ABCAbstract base class for robot behavior states.
- cancel() None[source]#
Request cancellation of the current state.
Notes
This flag can be checked manually by user logic
Loop-based logic is already auto-cancellable
- final check_shutdown()[source]#
Check whether the system is shutting down.
- Raises:
KeyboardInterrupt – If the controller shutdown event is set