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 DriveSpeed
run(DriveSpeed currentSpeed, DriveSpeed desiredSpeed, double deltaTime)
Run the drive modulevoid
setMaxSpeed(double maxSpeed)
void
setShouldScaleSpeeds(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:DriveModule
Run the drive module- Specified by:
run
in 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)
-
-