Loop Time Overrun / Issues?

Gettin a loop time overrun error; I’m using a changing arb feed forward for all of our mechanisms so having a slow loop time is not ideal. Can’t quite figure out what part of my code is slowing down the loop, or if there even is a way to speed it up.

Here is the link to my code

Robot.java -> teleopPeriodic() and all of the objects it references is where I’d assume the problem is happening.

You need to sum up the time it’s taking to make the series of calls and see how long your loop time could potentially be in the worst case scenario.

Some of the TalonSRX calls are very slow (up to 4 ms a piece), so if you call a bunch of them in succession they can stack up very highly, very quickly. Just as an example, you call a talon get sensor position in each movement call for the Elbow and Wrist in your Arm movement. I don’t remember the exact timing of those (if they are the slow ones or not) but that could be the cause.

1 Like

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