Class AdvancedArcadeJoystickInput
- java.lang.Object
-
- org.team1540.rooster.drive.pipeline.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
Inputthat provides aTankDriveData. The resultingTankDriveDatawill have the left and right feed-forwards set to throttles between -1 and 1. All other values are emptyOptionalDoubles.- See Also:
Input,FeedForwardProcessor
-
-
Constructor Summary
Constructors Constructor Description AdvancedArcadeJoystickInput(boolean reverseBackwards, @NotNull DoubleSupplier throttleInput, @NotNull DoubleSupplier softTurnInput, @NotNull DoubleSupplier hardTurnInput)Creates a newAdvancedArcadeJoystickInput.AdvancedArcadeJoystickInput(@NotNull DoubleSupplier throttleInput, @NotNull DoubleSupplier softTurnInput, @NotNull DoubleSupplier hardTurnInput)Creates a newAdvancedArcadeJoystickInputthat does not reverse while going backwards.
-
-
-
Constructor Detail
-
AdvancedArcadeJoystickInput
public AdvancedArcadeJoystickInput(@NotNull @NotNull DoubleSupplier throttleInput, @NotNull @NotNull DoubleSupplier softTurnInput, @NotNull @NotNull DoubleSupplier hardTurnInput)Creates a newAdvancedArcadeJoystickInputthat does not reverse while going backwards.- Parameters:
throttleInput- ADoubleSupplierthat supplies the input for the throttle, from -1 to 1 inclusive.softTurnInput- ADoubleSupplierthat supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.hardTurnInput- ADoubleSupplierthat 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 newAdvancedArcadeJoystickInput.- Parameters:
reverseBackwards- Iftrue, reverses the direction of the soft turn when the throttle is negative.throttleInput- ADoubleSupplierthat supplies the input for the throttle, from -1 to 1 inclusive.softTurnInput- ADoubleSupplierthat supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.hardTurnInput- ADoubleSupplierthat supplies the input for the soft-turn, from -1 to 1 inclusive.
-
-
Method Detail
-
get
public TankDriveData get()
Gets the desired output.- Specified by:
getin interfaceSupplier<TankDriveData>- Returns:
- A
TankDriveDatawith only the left and right velocity fields specified.
-
-