Package xbot.common.logic
Class HumanVsMachineDecider
java.lang.Object
xbot.common.logic.HumanVsMachineDecider
Decides whether to use human or machine control of a subsystem.
Human control is used when the inputs exceed a deadband.
When input stops, control is handed back to the machine after a
coast period.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Factory for creating a new decider.static enum
-
Constructor Summary
ConstructorDescriptionHumanVsMachineDecider
(String prefix, PropertyFactory propertyFactory) Creates a new decider with the given prefix. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the deadband value.getRecommendedMode
(double humanInput) Gets the recommended mode based on the human input.void
reset()
Resets the decider defaulting to machine control.void
reset
(boolean startInAutomaticMode) Resets the decider.void
setDeadband
(double value)
-
Constructor Details
-
HumanVsMachineDecider
@AssistedInject public HumanVsMachineDecider(@Assisted("prefix") String prefix, PropertyFactory propertyFactory) Creates a new decider with the given prefix.- Parameters:
prefix
- The prefix to use for all properties created by this decider.propertyFactory
- The property factory to use for creating properties.
-
-
Method Details
-
reset
public void reset()Resets the decider defaulting to machine control. -
reset
public void reset(boolean startInAutomaticMode) Resets the decider.- Parameters:
startInAutomaticMode
- Whether to start in automatic mode.
-
getRecommendedMode
Gets the recommended mode based on the human input.- Parameters:
humanInput
- The human input to use for the decision.- Returns:
- The recommended mode.
-
getDeadband
public double getDeadband()Get the deadband value.- Returns:
- The deadband value.
-
setDeadband
public void setDeadband(double value)
-