Added catch for NaN in the Absolute Encoder ZeroingEstimator
Change-Id: I4ae379931dc198f3742b5d161af7e48b88f40d00
diff --git a/frc971/zeroing/zeroing.h b/frc971/zeroing/zeroing.h
index dc8a1ad..d850f54 100644
--- a/frc971/zeroing/zeroing.h
+++ b/frc971/zeroing/zeroing.h
@@ -155,8 +155,7 @@
double offset() const override { return offset_; }
- // TODO(austin): Actually implement this.
- bool error() const override { return false; }
+ bool error() const override { return error_; }
// Returns true if the sample buffer is full.
bool offset_ready() const {
@@ -195,6 +194,8 @@
double filtered_position_ = 0.0;
// The filtered position.
double position_ = 0.0;
+ // Whether or not there is an error in the estimate.
+ bool error_ = false;
};
// Populates an EstimatorState struct with information from the zeroing