Robot takes a while to start up in autonomous mode

Hi, I’m having a bit of a problem with autonomous mode on my team’s robot. after starting autonomous, the robot waits a few seconds and a bunch of these errors:

Error 1 Robot Drive... Output not updated often enough. java.lang.Thread.run(Thread.java.747)

show up on our drive station. After a while, the errors stop and the robot completes all the autonomous tasks perfectly fine. does anyone know how to solve this problem?

Initializing a camera at the start of Autonomous might cause a blocking delay like that.

Thanks, but our code doesn’t have any camera initialization. We are initializing a Gyro, would that cause something like this?

Yep. Gyro’s have a 5sec blocking period when you initialize them.

I’d suggest commenting out all code leaving just enough to see that Auto is running and Teleop is running, then if the delay is gone just add things back in gradually to see when the delay reappears.

Initialize the gyro during Disabled.

I would recommend initializing the gyro during robotInit, otherwise the field might think you’re ready and start a match before the gyro finishes initialization.

Generally speaking, the best way to make sure the field knows you’re not ready is to stand in your driver station holding a thumbs down in the glass. Often times, our field monitor may be completely green, but teams are still waiting for gyros, camera feeds, or some smart dashboard mess. A good FTA (which as far as I know is all FTAs) would see your thumbs down and would be able to assist before starting the match.

*A simple thumbs down is sufficient. No need to start banging that thumb into the glass unless a countdown to start match has begun.

Thanks for the help!
Turns out that a PID loop was causing the problem, I took it out and everything works fine now.

Thanks for letting us know how you fixed it.:slight_smile: