Class AdvancedArcadeJoystickInput

  • All Implemented Interfaces:
    Supplier<TankDriveData>, Input<TankDriveData>

    public class AdvancedArcadeJoystickInput
    extends Object
    implements Input<TankDriveData>
    Modified arcade drive joystick input. This arcade drive uses one throttle input and two wheel inputs (soft and hard). The soft wheel input is multiplied by the absolute value of the throttle input before being used, while the hard is not—this allows for smoother control of the robot's path at a variety of speeds. The core algorithm is adapted from Team 2471's drive code, which can be found here.

    This class is an Input that provides a TankDriveData. The resulting TankDriveData will have the left and right feed-forwards set to throttles between -1 and 1. All other values are empty OptionalDoubles.

    See Also:
    Input, FeedForwardProcessor
    • Constructor Detail

      • AdvancedArcadeJoystickInput

        public AdvancedArcadeJoystickInput​(@NotNull
                                           @NotNull DoubleSupplier throttleInput,
                                           @NotNull
                                           @NotNull DoubleSupplier softTurnInput,
                                           @NotNull
                                           @NotNull DoubleSupplier hardTurnInput)
        Creates a new AdvancedArcadeJoystickInput that does not reverse while going backwards.
        Parameters:
        throttleInput - A DoubleSupplier that supplies the input for the throttle, from -1 to 1 inclusive.
        softTurnInput - A DoubleSupplier that supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.
        hardTurnInput - A DoubleSupplier that supplies the input for the soft-turn, from -1 to 1 inclusive.
      • AdvancedArcadeJoystickInput

        public AdvancedArcadeJoystickInput​(boolean reverseBackwards,
                                           @NotNull
                                           @NotNull DoubleSupplier throttleInput,
                                           @NotNull
                                           @NotNull DoubleSupplier softTurnInput,
                                           @NotNull
                                           @NotNull DoubleSupplier hardTurnInput)
        Creates a new AdvancedArcadeJoystickInput.
        Parameters:
        reverseBackwards - If true, reverses the direction of the soft turn when the throttle is negative.
        throttleInput - A DoubleSupplier that supplies the input for the throttle, from -1 to 1 inclusive.
        softTurnInput - A DoubleSupplier that supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.
        hardTurnInput - A DoubleSupplier that supplies the input for the soft-turn, from -1 to 1 inclusive.