I am having some issues with a Sequential Command Group that does a handoff from the intake to the shooter on our bot, and I am having this problem where the last part of the command group just doesn’t get run, and the rio log sometimes says that the scheduler is overrun. (you can find the repo here
public class intakeHandoff extends SequentialCommandGroup {
/** Creates a new intakeHandoff. */
public intakeHandoff(Shooter shooter, Intake intake) {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
/*new SequentialCommandGroup(
),*/
new setShooterAngle(shooter, Constants.kShooterHandoffPosition),
new setIntakeAngle(intake, Constants.kIntakeDownPosition-3),
new setIntakeSpeed(intake, -0.3),
new WaitUntilCommand(intake::hasNote),
new setIntakeSpeed(intake, 0),
new setIntakeAngle(intake, 0.2),
new WaitUntilCommand(intake::isAtGoal),
new setShooterIntakeSpeed(shooter, Constants.kShooterIntakeSpeed),
new setIntakeSpeed(intake, 0.4),
new WaitUntilCommand(shooter::hasNote), //Problems start here
new setShooterIntakeSpeed(shooter, -0.3),
new setIntakeSpeed(intake, 0.3),
new WaitCommand(1),
new setShooterIntakeSpeed(shooter, 0),
new setIntakeSpeed(intake, 0)
);
}
}
90% of the time, the commands after the WaitUntilCommand(shooter::hasNote)
don’t run at all, even though hasNote()
returns true, but occasionally it does work. Interestingly, when WaitUntilCommand(intake::hasNote)
or WaitCommand(1)
is commented out, the whole command group is run no problem.
Any help is greatly appreciated.