Quote:
Originally Posted by eugenebrooks
We do our averaging to get the bias in the pit where we can be sure
that the robot is not disturbed while the data is being taken. The
resulting number is then hard coded.
|
We do ours immediately before every match by using the disabled_mode flag. In other words, we're running a moving average right up until they enable the robots. Since everyone is required to be off the field for the last few seconds before the match start, you're pretty much guaranteed to get have the robot undisturbed and still, and you get the bias as close to what you're going to have in the match.
The code is more or less:
Code:
static char runBais = 1;
if (disabled_mode && runBias)
{
// run moving-average bias code
}
else
{
// the bias has now been captured and is held
// don't let the bias run again if the robot is disabled for a short period of time
runBias = 0;
// run integral code
}