Class DriveSpeed
- java.lang.Object
-
- com.thegongoliers.output.drivetrain.DriveSpeed
-
public class DriveSpeed extends java.lang.ObjectA class representing the speed of a differential drivetrain
-
-
Field Summary
Fields Modifier and Type Field Description static DriveSpeedSTOP
-
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 DriveSpeedfromArcade(double forward, double turn)Convert arcade inputs into tankdoublegetLeftSpeed()The left speed of the drivetraindoublegetRightSpeed()The right speed of the drivetrainDriveSpeedplus(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)
-
-