CommandSheduler overrun in sequential command group problems

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.

heres a video of the problem

it should be stopping but the motors keep running

the scheduler overrun command group might mean that perhaps the commands are taking longer than the 20ms loop time? does the robot have this problem with any other sequential command groups?

could you maybe send a copy of the exact errors?

1 Like

I haven’t written or tested any other commands yet. The rio log was saying that the CommandScheduler was overrunning the loop time of 0.02 seconds, and had showed the execution times for different subsystems, but it wouldn’t always immediately say that it was overrun when the problem would happen. I can get the logs in 7 hours or so.

I found that I had accidentally used RunCommand in multiple places where I should have used InstantCommand, and that was causing all the problems. :man_facepalming:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.