Re: Dual encoders
Ok I'll chime in, we typically end up using just one encoder and the gyro even though we have two encoders.
Some years, we have implemented some code which has some logic like the following "psuedo-code":
if ((encoder count isn't changing) && (trying to drive))
{
encoder_is_broken_counter++;
}
else
{
encoder_is_broken_counter = 0;
}
const int ENCODER_MUST_BE_BROKEN_COUNT = 100;
if (encoder_broken_counter > ENCODER_MUST_BE_BROKEN_COUNT)
{
ABORT_AUTONOMOUS_MODE!
}
Maybe one could improve on this logic to switch which encoder you are using, switch from averaging the encoders to ignoring the one that isn't working?
Typically we run out of time to do all of the fancy stuff we would like to do in autonomous.
|