March 16, 2018, 4:17pm
So to reset a gyro sensor back to 0, you would do
SensorValue[gyro] = 0;
My question is if every time I do this, do I have to make the robot sit still for 1.1 sec like it would normally do for the beginning calibration? Or will it just quickly reset to 0 and then continue like a quad encoder would?
March 16, 2018, 4:35pm
Yes to sit still for 1.1 sec or yes to it will just continue?
the 1.1 is for
initializing not resetting
you only need the wait during pre-auton
March 16, 2018, 6:30pm
Thank you for the clarification!
I’m confused. Mid way through the autonomous does the program need to wait the 1.1 seconds to reset or is it nearly instantaneous ?
Since I was not clear before:
the wait is only needed in your pre-auton not auton
For resetting a sensor, there is no wait necessary
I know this is off topic, but that may be the first time I have seen a quote in a quote on these forums.
But, the wait is just to initialize. Reseting just sets the number to 0 and goes from there.
March 22, 2018, 6:25pm
Do other sensors such as encoders need to be cleared during pre-auton?
March 22, 2018, 6:33pm
You can clear encoders in pre-autonomous but there’s no real advantage to doing so, and on other sensor benefits from a reset.
The reason for calibrating the gyro in pre-autonomous is because it takes about 2 seconds, and you don’t want to give up that precious time. But a statement like:
// clear right encoder
SensorValue[rightEncoder] = 0;
is essentially instantaneous. So you can just do that in your autonomous routines at no real cost.