Inertial sensor calibration checking

our team wants to use an inertial sensor to help align the robot in both auton and driver control, and I have been looking for way too long trying to find a straight answer: How do I check the calibration of the inertial sensor at the beginning of the match?? I know I do not need to manually calibrate the sensor, I just want to check if it is calibrated. I also intend to use a PID loop with this as well by the way if anyone has any tips for that.

I understand I may be asking some pretty basic questions- I do all our team’s coding, but I have never had any form of coding class, so I’ve had to learn from scratch as I go, and I am still trying to wrap my head around some things. We also have no coach who is knowledgeable in programming. ( I realize PID is complicated, I’ll figure it out one way or another.)

you can use inertial1.isCalibrating();

Does this return a boolean or something else?

Are you using Python or C++?

I use C++ in VEXcode Pro

For C++ the Inertial::isCalibrating() returns true if the inertial sensor is in the process of calibrating, and false if it isn’t. You could use it in the following way:

void Calibrate() {
  Inertial.calibrate();
  while (Inertial.isCalibrating()) {
    wait(20, msec);
  }
}
2 Likes