Class TankDrive
- java.lang.Object
-
- org.chsrobotics.lib.drive.differential.TankDrive
-
- All Implemented Interfaces:
DifferentialDriveMode
public class TankDrive extends java.lang.Object implements DifferentialDriveMode
Moves the robot in teleoperated mode using one input directly mapped to each wheel.
-
-
Constructor Summary
Constructors Constructor Description TankDrive(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DifferentialDrivetrainInputexecute()Calculate the drive output using the current joystick inputs.
-
-
-
Constructor Detail
-
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
public TankDrive(JoystickAxis leftAxis, JoystickAxis rightAxis)
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 Detail
-
execute
public DifferentialDrivetrainInput execute()
Calculate the drive output using the current joystick inputs.- Specified by:
executein interfaceDifferentialDriveMode- Returns:
- The input, mapped to left and right side inputs.
-
-