Inertial Calibration During Skills

I have some questions regarding inertial sensor calibration.

If programming skills is run from the controller, is the pre-auton code skipped, and do you need to calibrate your inertial sensor as part of your programming routine?

1 Like

technically pre-auton, and any other code in main, is run, however, the controller has set the autonomous competition state and your autonomous function will be called almost immediately. The IMU will have started to calibrate (which it does every time a user program is run) so you should check that isCalibrating() returns false before using any values from it. At some point we will rewrite the controller match control code so there’s some delay before the autonomous match state is entered, just don’t know when, perhaps this summer.

5 Likes

I don’t understand this. Can you give me a first grader’s explanation?

1 Like

Hm, which bit is not clear ?

usually when you connect to comp control and start a program, your code starts at main and there is time to do things before that match. When using the controller you get the 3-2-1 countdown and the controller starts the program and immediately sets comp state to autonomous, so there is not any time to do the things to like letting IMU calibration finish (or anything else like selecting things on the screen).

1 Like

So I’m assuming there is no way around this? ~2 seconds of auton time will be lost?

2 Likes

when calibrating the sensor, is it okay to be moving? I’m assuming not.

it would be really nice if you could somehow calibrate sensors before skills runs.
I guess you could ask people running skills to use a competition switch and let it sit in disabled for a few seconds.

1 Like

From our competitions, we just calibrate the inertial sensor manually before through the devices screen before each run or match. It seems to work fine as long as you don’t move the robot.

2 Likes

no, don’t calibrate with a moving robot.

yea, don’t use the controller match simulation to run a real programming skills run. That’s not good. Are events really doing this ? What if you were running a cortex, it’s not even possible, skills runs should be started using field control or worst case a competition switch.

Only if you are using the controller, that should not be an issue during competition when connected to the field control system,

3 Likes

Our calibration is in pre_auton() so we just run the program after our bot is set up on the field, let the inertial sensor calibrate, select autonomous through GUI, and then plug the controller into the field controller.

I was not understanding what the problem is - whether it is a programming or implementation problem. It sounds like, if a team calibrates the inertial sensor in pre-auton, this is not an issue. However, if they use the controller (not even sure how that’s done), calibration can be bypassed…

1 Like

There is no problem if connected to a field controller or competition switch.

The problem is that using the 1 minute programming skills timer run directly on the controller, your program will effectively loose 2 seconds at the beginning while you wait for the IMU to calibrate, only leaving 58 seconds for the actual run.

3 Likes