Software Reset using PROS/ConVEX

Hey guys,

In the past when my team has been working on our robot, we’ve encountered annoying issues with our programming. Either things not working as they should, or the robot freezing up and spinning in circles or something. Looking for a solution, we managed to piece together a function the resets the robot through software, restarting our operator control code. We’d have this tied to a button on our controller, and in competition it would really help us out when we’d have the occasional programming mess-up.

I’ve finally documented the code, and thought I’d share it with the rest of the world in case anybody else would find it useful. You can get it here, on github.

Thanks for the code, to clarify it does not just restart operator control, it causes the entire OS to reset including initialize, initializeIO, etc so any tasks and user variables will be cleared

If you are having random freezes, etc and feel like its an issue with PROS, feel free to PM me or anyone on the PROS team so we can fix any bugs

I’d have to double check when I have access to my robot. My team switched from PROS to ConVEX a while ago, so I don’t quite remember how it acts. In ConVEX I believe it does reset our static variables, which would lead me to believe it does do a full reset, and would run through the initialize functions.

The issues we were having weren’t with PROS itself, they were are own issues with things like managing a ton of tasks at once, forgetting to put adequate delays in some loops.

So,
The cortex has two processors in it, one that does ‘core’ things like connect to the joystick and another that the user’s code/program is uploaded to. This reset function fully resets the user processor, restarting all of our code (including things like PROS’s initialize and initializeIO). The joystick however remains connected, so going from reset to running again only takes a few seconds.