A little bit more hood stuff, adding a command to trigger the rezero functionality
This commit is contained in:
@@ -68,6 +68,7 @@ public class Hood extends SubsystemBase {
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
Logger.recordOutput("Hood/OutputCurrent", motor.getOutputCurrent());
|
||||
Logger.recordOutput("Hood/CurrentTarget", currentTargetDegrees);
|
||||
Logger.recordOutput("Hood/CurrentAngle", encoder.getPosition());
|
||||
Logger.recordOutput("Hood/AtSetpoint", controller.isAtSetpoint());
|
||||
@@ -81,6 +82,14 @@ public class Hood extends SubsystemBase {
|
||||
});
|
||||
}
|
||||
|
||||
public Command automatedRezero() {
|
||||
return manualSpeed(() -> -1)
|
||||
.until(timerTrigger)
|
||||
.andThen(
|
||||
stop().until(timerTrigger.negate())
|
||||
);
|
||||
}
|
||||
|
||||
public Command manualSpeed(DoubleSupplier speed) {
|
||||
currentTargetDegrees = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user