Class CurvatureDrive
java.lang.Object
org.chsrobotics.lib.drive.differential.CurvatureDrive
- All Implemented Interfaces:
DifferentialDriveMode
Moves the robot in teleoperated mode similarly to
ArcadeDrive, but with turning speeds
dependent on linear speeds.-
Constructor Summary
ConstructorsConstructorDescriptionCurvatureDrive(JoystickAxis linearAxis, JoystickAxis rotationalAxis, double driveModifier, double turnModifier, double driveLimiter, double turnLimiter, boolean invertReverseTurning) Constructs a CurvatureDrive. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Calculate the drive output using the current joystick inputs.
-
Constructor Details
-
CurvatureDrive
public CurvatureDrive(JoystickAxis linearAxis, JoystickAxis rotationalAxis, double driveModifier, double turnModifier, double driveLimiter, double turnLimiter, boolean invertReverseTurning) Constructs a CurvatureDrive.- Parameters:
linearAxis- TheJoystickAxisto be used for linear movement.rotationalAxis- TheJoystickAxisto be used for rotational movement.driveModifier- A scalar to multiply the linear input by.turnModifier- A scalar to multiply the rotational input by.driveLimiter- The maximum rate of change of the linear input, in units of input / second. If equal to 0, no rate limiting will be applied.turnLimiter- The maximum rate of change of the rotational input, in units of input / second. If equal to 0, no rate limiting will be applied.invertReverseTurning- Whether turning in reverse should be inverted.
-
-
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.
-