Severe CommandScheduler Loop Overrun

We are having CommandScheduler loop overruns to an extent that the robot stops responding to inputs. The log is showing various overruns on pretty much everything with robotPeriodic() going over four seconds. This only seems to happen after running for a long time.

Code
log.txt (179.4 KB)

This may not be your main issue, but you’re creating new bindings to the command scheduler’s event loop every time you call leftStick(), which you do every loop. These bindings are memory that can’t be garbage collected, so GCs will be more frequent as the program continues to run.

3 Likes

Is there a better way to handle that then?

You need to store the Triggers you need to reference in the class, instead of recreating them within the method.

You might find this thread useful.

1 Like