Split StatespaceLoop into a Plant, Controller, and Observer.
This doesn't yet move any of the logic out of the Loop.
Change-Id: I2cb0ea6d1a75c7011576ba752c50e512eeff5890
diff --git a/y2015/actors/drivetrain_actor.cc b/y2015/actors/drivetrain_actor.cc
index 8772af7..91873eb 100644
--- a/y2015/actors/drivetrain_actor.cc
+++ b/y2015/actors/drivetrain_actor.cc
@@ -25,7 +25,8 @@
: aos::common::actions::ActorBase<actors::DrivetrainActionQueueGroup>(s) {}
bool DrivetrainActor::RunAction(const actors::DrivetrainActionParams ¶ms) {
- static const auto K = constants::GetValues().make_drivetrain_loop().K();
+ static const auto K =
+ constants::GetValues().make_drivetrain_loop().controller().K();
const double yoffset = params.y_offset;
const double turn_offset =
diff --git a/y2015/control_loops/claw/claw.cc b/y2015/control_loops/claw/claw.cc
index 25b5b9d..6a56105 100644
--- a/y2015/control_loops/claw/claw.cc
+++ b/y2015/control_loops/claw/claw.cc
@@ -25,7 +25,7 @@
double ClawCappedStateFeedbackLoop::UnsaturateOutputGoalChange() {
// Compute K matrix to compensate for position errors.
- double Kp = K(0, 0);
+ double Kp = controller().K(0, 0);
// Compute how much we need to change R in order to achieve the change in U
// that was observed.
diff --git a/y2015/control_loops/fridge/fridge.cc b/y2015/control_loops/fridge/fridge.cc
index a6acae7..d34cd33 100644
--- a/y2015/control_loops/fridge/fridge.cc
+++ b/y2015/control_loops/fridge/fridge.cc
@@ -39,8 +39,8 @@
// Compute the K matrix used to compensate for position errors.
Eigen::Matrix<double, 2, 2> Kp;
Kp.setZero();
- Kp.col(0) = this->K().col(0);
- Kp.col(1) = this->K().col(2);
+ Kp.col(0) = this->controller().K().col(0);
+ Kp.col(1) = this->controller().K().col(2);
Eigen::Matrix<double, 2, 2> Kp_inv = Kp.inverse();