Class DriveSpeed
- java.lang.Object
-
- com.thegongoliers.output.drivetrain.DriveSpeed
-
public class DriveSpeed extends java.lang.Object
A class representing the speed of a differential drivetrain
-
-
Field Summary
Fields Modifier and Type Field Description static DriveSpeed
STOP
-
Constructor Summary
Constructors Constructor Description DriveSpeed(double left, double right)
Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DriveSpeed
fromArcade(double forward, double turn)
Convert arcade inputs into tankdouble
getLeftSpeed()
The left speed of the drivetraindouble
getRightSpeed()
The right speed of the drivetrainDriveSpeed
plus(DriveSpeed other)
-
-
-
Field Detail
-
STOP
public static final DriveSpeed STOP
-
-
Method Detail
-
fromArcade
public static DriveSpeed fromArcade(double forward, double turn)
Convert arcade inputs into tank- Parameters:
forward
- the forward speedturn
- the turn speed- Returns:
- the tank speed
-
getLeftSpeed
public double getLeftSpeed()
The left speed of the drivetrain- Returns:
- the left speed
-
getRightSpeed
public double getRightSpeed()
The right speed of the drivetrain- Returns:
- the right speed
-
plus
public DriveSpeed plus(DriveSpeed other)
-
-