Pull state out of the zeroing estimators more nicely
I'm eventually going to remove the position() member, but for now Austin
wants this too.
Change-Id: I12b0c01eb5174751bd04fee8fdb770378a87f541
diff --git a/frc971/control_loops/profiled_subsystem.h b/frc971/control_loops/profiled_subsystem.h
index 9a19201..45ef912 100644
--- a/frc971/control_loops/profiled_subsystem.h
+++ b/frc971/control_loops/profiled_subsystem.h
@@ -98,11 +98,7 @@
// Returns the current internal estimator state for logging.
typename ZeroingEstimator::State EstimatorState(int index) {
- typename ZeroingEstimator::State estimator_state;
- ::frc971::zeroing::PopulateEstimatorState(estimators_[index],
- &estimator_state);
-
- return estimator_state;
+ return estimators_[index].GetEstimatorState();
}
// Sets the maximum voltage that will be commanded by the loop.