Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package org.usfirst.frc.team4009.robot;
import edu.wpi.first.wpilibj.SpeedController;
class CorrectionSpeedController implements SpeedController {
SpeedController actualController;
double correctionFactor;
public CorrectionSpeedController(SpeedController controller){
actualController = controller;
}
public void setCorrection(double correction) {
correctionFactor = correction;
}
public double get() {
return actualController.get();
}
public void set(double speed) {
actualController.set(speed * correctionFactor);
}
public void disable() {
actualController.disable();
}
public void stopMotor(){
actualController.stopMotor();
}
public void setInverted(boolean isInverted){
actualController.setInverted(isInverted);
}
public boolean getInverted() {
return actualController.getInverted();
}
public void pidWrite(double output) {
actualController.pidWrite(output);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.