How do I Calibrate Inertial Sensor in Pre_Auton?

Pretty much the title… I’ve got an inertial sensor that I calibrate using this:
image

The issue is that this creates a two second delay when I open up auton-mode or user-control. How would I actually move calibration to pre_auton since the new Vexcode doesn’t create a pre_auton function.

1 Like

you don’t really even need to do that, we calibrate every time you run your program. Just check calibration has finished before using it. (also, use calibrate instead of startCalibration as that function is deprecated and only there to match the gyro, the value passed is not used )

7 Likes

So are you saying that I don’t need to run a calibration command? Just check that I am calibrated?

When you run a program, the inertial sensor starts a calibration sequence, the first second of that sequence does not look at gyro values, it just waits for everything to stabilize, so any movement from touching the V5 should have stopped. It won’t hurt if you restart the calibration at the beginning of your program, I’m just saying that it’s not strictly necessary. You can also choose to manually recalibrate the inertial sensor at any time by going to the dashboard and selecting calibrate, you can do this while user code is running (press the V5 power button, then the V5 brain/devices icon etc. )

5 Likes