No Robot Code on power cycle

When testing the robot today I noticed some very weird behavior. The robot was working fine before, and the code ran smoothly. However, every time we switched batteries and turned the rio back on, the DS said No Robot Code, and I have to do a redeploy (even though it’s the exact same code). How can I fix this annoying behavior?

Which programming language are you using?

One thing to check is the startup settings for the rio. In the roboRio imaging tool, there’s a box for “Disable RT Startup App”, which I believe would prevent your code from running at power on if checked.

We’re using java. That reminds me - in robotInit(), the robot is supposed to wait for a maximum of 1 minute for the vision subsystem to start up (as we’re using a Jetson). Could that be causing the issues?

Yes, your robot code will not report to the DS as ready until robotInit finishes.

A good practice in a case like this is to print a message to console every few seconds to indicate the system is still waiting. That way you can differentiate between frozen or crashed execution, and code that is legitimately waiting for some new input.