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
Input
that provides aTankDriveData
. The resultingTankDriveData
will 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 newAdvancedArcadeJoystickInput
that 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 newAdvancedArcadeJoystickInput
that does not reverse while going backwards.- Parameters:
throttleInput
- ADoubleSupplier
that supplies the input for the throttle, from -1 to 1 inclusive.softTurnInput
- ADoubleSupplier
that supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.hardTurnInput
- ADoubleSupplier
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 newAdvancedArcadeJoystickInput
.- Parameters:
reverseBackwards
- Iftrue
, reverses the direction of the soft turn when the throttle is negative.throttleInput
- ADoubleSupplier
that supplies the input for the throttle, from -1 to 1 inclusive.softTurnInput
- ADoubleSupplier
that supplies the input for the soft-turn, from -1 (full left) to 1 (full right) inclusive.hardTurnInput
- ADoubleSupplier
that supplies the input for the soft-turn, from -1 to 1 inclusive.
-
-
Method Detail
-
get
public TankDriveData get()
Gets the desired output.- Specified by:
get
in interfaceSupplier<TankDriveData>
- Returns:
- A
TankDriveData
with only the left and right velocity fields specified.
-
-