Package xbot.common.logic
package xbot.common.logic
Logic utilities.
-
ClassDescriptionA small, reusable, polled finite state machine, intended to be ticked once per robot loop from a
Subsystem.periodic()orCommand.execute().FsmContext<ContextT>The information passed in to everyFsmStatehook and to everyFiniteStateMachinehook.FsmHook<StateT,ContextT> A hook that aFiniteStateMachineruns immediately before or immediately after the current state'sFsmState.execute(FsmContext, FsmTransition)on every cycle, regardless of which state is active.The behavior contract implemented by every state of aFiniteStateMachine.FsmTransition<StateT>Decides whether to use human or machine control of a subsystem.Factory for creating a new decider.The states ofHumanVsMachineDecider's internal state machine, in the order control moves through them:RobotDisabledwhile the robot is disabled,InitializeMachineControlfor exactly one cycle after control returns to automatic (before anything else has a chance to run),MachineControlwhile running automatically,HumanControlwhile a human is actively providing input above the deadband, andCoastfor a brief grace period after human input stops, before handing back toInitializeMachineControl.Logical switch which consumes booleans and signals when the given value changes.Utility methods for working with logic.Checks that a value is stable for a given amount of time.