Class TankDrive
java.lang.Object
org.chsrobotics.lib.drive.differential.TankDrive
- All Implemented Interfaces:
DifferentialDriveMode
Moves the robot in teleoperated mode using one input directly mapped to each wheel.
-
Constructor Summary
ConstructorsConstructorDescriptionTankDrive(JoystickAxis leftAxis, JoystickAxis rightAxis) Constructs a TankDrive with no rate limiting.TankDrive(JoystickAxis leftAxis, JoystickAxis rightAxis, double driveModifier, double driveLimiter) Constructs a TankDrive. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Calculate the drive output using the current joystick inputs.
-
Constructor Details
-
TankDrive
public TankDrive(JoystickAxis leftAxis, JoystickAxis rightAxis, double driveModifier, double driveLimiter) Constructs a TankDrive.- Parameters:
leftAxis- TheJoystickAxisto be used for the left side.rightAxis- TheJoystickAxisto be used for the right side.driveModifier- A scalar to multiply each input by.driveLimiter- The maximum rate of change for each input, in units of input / second. If equal to 0, no rate limiting will be applied.
-
TankDrive
Constructs a TankDrive with no rate limiting.- Parameters:
leftAxis- TheJoystickAxisto be used for the left side.rightAxis- TheJoystickAxisto be used for the right side.
-
-
Method Details
-
execute
Calculate the drive output using the current joystick inputs.- Specified by:
executein interfaceDifferentialDriveMode- Returns:
- The input, mapped to left and right side inputs.
-