UpdateObserver now takes U as an argument.
This supports running UpdateObserver without a control loop better.
Change-Id: I62a304fa192604bc5b400c8bbf5191971a8534cc
diff --git a/frc971/control_loops/state_feedback_loop.h b/frc971/control_loops/state_feedback_loop.h
index 6ebd32e..d1b24a5 100644
--- a/frc971/control_loops/state_feedback_loop.h
+++ b/frc971/control_loops/state_feedback_loop.h
@@ -385,11 +385,11 @@
CapU();
}
- UpdateObserver();
+ UpdateObserver(U_);
}
- void UpdateObserver() {
- X_hat_ = A() * X_hat() + B() * U();
+ void UpdateObserver(const Eigen::Matrix<double, number_of_inputs, 1> &new_u) {
+ X_hat_ = A() * X_hat() + B() * new_u;
}
// Sets the current controller to be index, clamped to be within range.