Class MwSubsystem<StateType extends Enum<StateType>,ConstantsType extends MwConstants>

java.lang.Object
com.marswars.subsystem.MwSubsystem<StateType,ConstantsType>
All Implemented Interfaces:
MwSubsystemBase

public abstract class MwSubsystem<StateType extends Enum<StateType>,ConstantsType extends MwConstants> extends Object implements MwSubsystemBase
  • Field Details

  • Constructor Details

  • Method Details

    • handleStateTransition

      protected void handleStateTransition(StateType wanted)
    • updateLogic

      public abstract void updateLogic(double timestamp)
      Computes updated outputs for the actuators
    • reset

      public abstract void reset()
      Called to reset and configure the subsystem
      Specified by:
      reset in interface MwSubsystemBase
    • setWantedState

      public void setWantedState(StateType wanted)
      Sets the desired state for the state machine
      Parameters:
      wanted - the desired state machine state to transition to
    • getSystemState

      public StateType getSystemState()
      Gets the current state of the state machine
      Returns:
      the current state of the state machine
    • update

      public void update(double timestamp)
      DO NOT OVERRIDE THIS METHOD IN THE BASE CLASS IF YOU DO, BAD THINGS WILL HAPPEN! YOUR SUBSYSTEM WILL NOT TICK CORRECTLY
      Specified by:
      update in interface MwSubsystemBase
    • getSubsystemKey

      public String getSubsystemKey()
      a common logging key to use for the subsystem
      Specified by:
      getSubsystemKey in interface MwSubsystemBase
      Returns:
      the logging key to use as a base. eg getSubsystemKey() + "Some Special Value"
    • getNtKey

      public String getNtKey()
      a common NT key to use for the subsystem
      Returns:
      the NT key to use as a base. eg getSubsystemKey() + "Some Special Value"
    • getName

      public String getName()
      Gets the name of the subsystem used to enable and disable. Also used for logging
      Specified by:
      getName in interface MwSubsystemBase
      Returns:
      the string name of the subsystem