Zero the swerve test drivebase
Update the constants to accommodate zeroing and zero the wheels on the
swerve base.
Change-Id: I448deca4ff1bb776072db631c7327a8cc33fbbc8
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/zeroing/zeroing.h b/frc971/zeroing/zeroing.h
index 8fe381d..68ef38f 100644
--- a/frc971/zeroing/zeroing.h
+++ b/frc971/zeroing/zeroing.h
@@ -6,6 +6,7 @@
#include <cstdint>
#include <vector>
+#include "absl/log/check.h"
#include "flatbuffers/flatbuffers.h"
#include "frc971/constants.h"
@@ -80,6 +81,7 @@
// by buffer_size.
bool Update(const PositionBuffer &position_buffer, size_t buffer_size,
double zeroing_threshold) {
+ CHECK_LT(0u, buffer_size);
bool moving = true;
Position position(position_buffer);
if (buffered_samples_.size() < buffer_size) {
@@ -103,6 +105,7 @@
}
}
buffered_samples_idx_ = (buffered_samples_idx_ + 1) % buffer_size;
+
return moving;
}