Class SpeedConstraintModule
- java.lang.Object
-
- com.thegongoliers.output.drivetrain.SpeedConstraintModule
-
- All Implemented Interfaces:
DriveModule
public class SpeedConstraintModule extends java.lang.Object implements DriveModule
A drivetrain module which will constrain the maximum speed of the robot.
-
-
Constructor Summary
Constructors Constructor Description SpeedConstraintModule(double maxSpeed, boolean shouldScaleSpeeds)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DriveSpeedrun(DriveSpeed currentSpeed, DriveSpeed desiredSpeed, double deltaTime)Run the drive modulevoidsetMaxSpeed(double maxSpeed)voidsetShouldScaleSpeeds(boolean shouldScaleSpeeds)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.thegongoliers.output.drivetrain.DriveModule
overridesUser
-
-
-
-
Method Detail
-
run
public DriveSpeed run(DriveSpeed currentSpeed, DriveSpeed desiredSpeed, double deltaTime)
Description copied from interface:DriveModuleRun the drive module- Specified by:
runin interfaceDriveModule- Parameters:
currentSpeed- the current speed of the drivetraindesiredSpeed- the desired speed of the drivetraindeltaTime- the delta time since the last call in seconds- Returns:
- the speed the drivetrain should set
-
setMaxSpeed
public void setMaxSpeed(double maxSpeed)
-
setShouldScaleSpeeds
public void setShouldScaleSpeeds(boolean shouldScaleSpeeds)
-
-