Package me.autobot.lib.robot.drivebase
Class ArcadeDrive
java.lang.Object
me.autobot.lib.robot.drivebase.ArcadeDrive
A drivebase that uses arcade drive.
-
Constructor Summary
ConstructorsConstructorDescriptionArcadeDrive
(Motor topLeft, Motor topRight, Motor bottomLeft, Motor bottomRight) Creates a new ArcadeDrive object. -
Method Summary
Modifier and TypeMethodDescriptionprotected Vector2d
arcadeDrive
(double speed, double rot) Translates arcade drive to motor speeds.void
drive
(double speed, double rotation) Drives the robot with the given speed and rotation.void
drive
(double speed, double rotation, double multiplier) Drives the robot with the given speed and rotation.
-
Constructor Details
-
ArcadeDrive
Creates a new ArcadeDrive object.- Parameters:
topLeft
- The top left motor. This motor is on the top left of the robot.topRight
- The top right motor. This motor is on the top right of the robot.bottomLeft
- The bottom left motor. This motor is on the bottom left of the robot.bottomRight
- The bottom right motor. This motor is on the bottom right of the robot.- See Also:
-
-
Method Details
-
drive
public void drive(double speed, double rotation) Drives the robot with the given speed and rotation.- Parameters:
speed
- The speed of the robot. Positive is forward, negative is backward. Range: -1 to 1.rotation
- The rotation of the robot. Positive is right, negative is left.
-
drive
public void drive(double speed, double rotation, double multiplier) Drives the robot with the given speed and rotation.- Parameters:
speed
- The speed of the robot. Positive is forward, negative is backward. Range: -1 to 1.rotation
- The rotation of the robot. Positive is right, negative is left.multiplier
- The multiplier to apply to the motor speeds.
-
arcadeDrive
Translates arcade drive to motor speeds.- Parameters:
speed
- The speed of the robot.rot
- The rotation of the robot.- Returns:
- The motor speeds. (x=left, y=right)
-