Today I tried using this code:
visionOn.debounce(Constants.INPUT_DEBOUNCE, DebounceType.kBoth).whenActive(new CommandBase() {
@Override
public void initialize() {
_drive.getVisionState().setEnabled(true);
}
@Override
public boolean runsWhenDisabled() {
return true;
}
});
visionOff.debounce(Constants.INPUT_DEBOUNCE, DebounceType.kBoth).whenActive(new CommandBase() {
@Override
public void initialize() {
_drive.getVisionState().setEnabled(false);
}
@Override
public boolean runsWhenDisabled() {
return true;
}
});
I noticed that the command scheduler does nothing when the robot is disabled. Do we have to resort to doing stuff like this via getRawButton to make this work?
I want to be able to turn the vision on and off while the robot is disabled. Was this use case not thought of when designing the command scheduler stuff?