How can I make it such that when I run the auton routine, I donβt have to physically make the robot wait 2 seconds just for the inertial sensor to initialize?
It sounds like your brain and/or controller are not on latest firmware. The program should run at the beginning of the 3 second countdown so when auton starts the imu has finished calibration.
Just in case, in the future if someone goes back to this thread I built a simple safeguard for anyone having this issue and cannot update their brain. Note: This may chop off about 1-2 seconds of auton, but at least you have something in case of an emergency
He provided a construction of the actual function itself and where it comes from. I edited my post after he made that response to have the function as he requested. (Aka if you look at my code it implements exactly what he said)