Remove position() member from zeroing estimators
It didn't return anything particularly useful, so it should not have
been used anywhere. Turns out it was only used in the test, so it was
pretty easy.
Change-Id: I3f81bd16a1a8e429c9748abd4e9dc9c7e0259dc5
diff --git a/frc971/control_loops/control_loops.q b/frc971/control_loops/control_loops.q
index f3d224b..cb95df8 100644
--- a/frc971/control_loops/control_loops.q
+++ b/frc971/control_loops/control_loops.q
@@ -77,6 +77,23 @@
double pot_position;
};
+// The internal state of a zeroing estimator.
+struct IndexEstimatorState {
+ // If true, there has been a fatal error for the estimator.
+ bool error;
+ // If the joint has seen an index pulse and is zeroed.
+ bool zeroed;
+ // The estimated position of the joint. This is just the position relative to
+ // where we started if we're not zeroed yet.
+ double position;
+
+ // The positions of the extreme index pulses we've seen.
+ double min_index_position;
+ double max_index_position;
+ // The number of index pulses we've seen.
+ int32_t index_pulses_seen;
+};
+
// A left/right pair of PotAndIndexPositions.
struct PotAndIndexPair {
PotAndIndexPosition left;