Write class to handle gyro zeroing
Since we're moving the gyro zeroing into the drivetrain, take the
opportunity to write a new class to wrap it and to handle automatically
zeroing us any time we stay still for 5 seconds.
Change-Id: I9be7c970b6bbe3cf1eddc217c93467dfc21cd4cd
diff --git a/frc971/wpilib/gyro_sender.cc b/frc971/wpilib/gyro_sender.cc
index 4f88f9e..0b590f9 100644
--- a/frc971/wpilib/gyro_sender.cc
+++ b/frc971/wpilib/gyro_sender.cc
@@ -136,7 +136,7 @@
if (joystick_state_fetcher_.get() &&
joystick_state_fetcher_->outputs_enabled() &&
zeroing_data_.full()) {
- zero_offset_ = -zeroing_data_.GetAverage();
+ zero_offset_ = -zeroing_data_.GetAverage()(0, 0);
AOS_LOG(INFO, "total zero offset %f\n", zero_offset_);
zeroed_ = true;
}