Loop overrun warning -- can't figure out or even drive the robot

The DriverStation reports an error of the code looping beyond 20ms, seen in the code here. I can’t understand what would be causing the code to time out immediately upon enabling teleop. Any suggestions?

edit: entire codebase uploaded here.

2 Likes
Scheduler.getInstance().run();

Is running all your commands. One of them is likely taking longer than 20ms to run. Hard to tell without the full code though.

Seconded. Could you post the entire codebase? Maybe then we could help you out.

That post is the key one. Look at a few posts above and below for more information.

Our particular issues were: addressing devices not present in CAN and addressing the PDP more than once.

The entire codebase? I am using vscode and struggling with git integration, thus I had to copy and paste the latest version of my main file to github.

The code in the link above is rather similar to the example template listed in the WPILib section of vscode.

Yes, the whole codebase. You most likely have a command that is taking too long, so we need to see your commands to see the problems.

It’s probably easier and more useful to figure out how to use git properly than to copy your code to GitHub manually.

Edit: if you are on Windows, you may have to download Git for Windows.

This might help:

1 Like

On the subject of GitHub you can simply use GitHub command line or desktop, initialize the base directory you have the project in as a repo, and then just push it to GitHub that way. It doesn’t use VSCode’s Git integration but it works either way so :man_shrugging:

1 Like

If it only printed once, it’s LiveWindow taking more than 20ms to do its thing during teleopInit() (your code can’t do much about it). It’s a warning, not an error. If MotorSafety is kicking in too, that’s because you probably don’t have a default command set to do driving.

Thank you for your suggestion, this should be it:

https://github.com/colelewis/FRC1819_Java