Class AbstractController

    • Field Detail

      • backingHID

        protected final edu.wpi.first.wpilibj.GenericHID backingHID
      • controlsModeMap

        protected final java.util.Map<Gamepad.Mapping,​java.util.function.Function<java.lang.Double,​java.lang.Double>> controlsModeMap
      • controlsMapping

        protected final java.util.Map<Gamepad.Mapping,​java.util.function.Consumer<java.lang.Double>> controlsMapping
      • buttonBindings

        protected final java.util.Map<Gamepad.Binding,​java.lang.Runnable> buttonBindings
      • buttonStates

        protected final java.util.Map<Gamepad.Button,​java.lang.Boolean> buttonStates
      • port

        protected final int port
      • BOUND_PORTS

        protected static final java.util.BitSet BOUND_PORTS
    • Constructor Detail

      • AbstractController

        protected AbstractController​(int port,
                                     long timeout,
                                     java.util.concurrent.TimeUnit timeUnit)
    • Method Detail

      • getBackingHID

        public edu.wpi.first.wpilibj.GenericHID getBackingHID()
        Get the backing input device of this Gamepad.
        Specified by:
        getBackingHID in interface Gamepad
        Returns:
        the backing input device, eg Joystick
      • getPort

        public int getPort()
        Get the USB port (as numbered in the Driver Station) that this Gamepad is plugged into.
        Specified by:
        getPort in interface Gamepad
        Returns:
        the USB port number
      • enableBindings

        public void enableBindings()
        Enable button bindings. If bindings are not enabled, then no bound actions will be executed. By default, bindings are not enabled.
        Specified by:
        enableBindings in interface Gamepad
      • disableBindings

        public void disableBindings()
        Disable button bindings. If bindings are not enabled, then no bound actions will be executed. By default, bindings are not enabled.
        Specified by:
        disableBindings in interface Gamepad
      • getButtons

        protected abstract java.util.Set<Gamepad.Button> getButtons()
        Get the set of Buttons on this controller.
        Returns:
        a set of Buttons
      • task

        public void task()
                  throws java.lang.Exception
        Description copied from interface: Subsystem
        The background task to run.
        Specified by:
        task in interface Subsystem
        Throws:
        java.lang.Exception - in case the defined task throws any Exceptions