Deleted self.L from the loops if possible and replaced it with KalmanGain
Change-Id: I22ba10ec042b72a91631b5e408429116b9d4b102
diff --git a/y2018/control_loops/python/intake.py b/y2018/control_loops/python/intake.py
index ac3e4c1..f29d3b5 100755
--- a/y2018/control_loops/python/intake.py
+++ b/y2018/control_loops/python/intake.py
@@ -103,15 +103,11 @@
self.KalmanGain, self.Q_steady = controls.kalman(
A=self.A, B=self.B, C=self.C, Q=self.Q, R=self.R)
- self.L = self.A * self.KalmanGain
-
# The box formed by U_min and U_max must encompass all possible values,
# or else Austin's code gets angry.
self.U_max = numpy.matrix([[12.0]])
self.U_min = numpy.matrix([[-12.0]])
- self.Kff = controls.TwoStateFeedForwards(self.B, self.Q)
-
self.InitializeState()
@@ -201,8 +197,6 @@
self.KalmanGain, self.Q_steady = controls.kalman(
A=self.A, B=self.B, C=self.C, Q=self.Q, R=self.R)
- self.L = self.A * self.KalmanGain
-
# The box formed by U_min and U_max must encompass all possible values,
# or else Austin's code gets angry.
self.U_max = numpy.matrix([[12.0]])
@@ -343,15 +337,20 @@
scenario_plotter.Plot()
# Write the generated constants out to a file.
- if len(argv) != 3:
- glog.fatal('Expected .h file name and .cc file name for the intake.')
+ if len(argv) != 5:
+ glog.fatal('Expected .h file name and .cc file name for intake and delayed_intake.')
else:
- namespaces = ['y2018', 'control_loops', 'superstructure']
+ namespaces = ['y2018', 'control_loops', 'superstructure', 'intake']
intake = Intake('Intake')
loop_writer = control_loop.ControlLoopWriter(
'Intake', [intake], namespaces=namespaces)
loop_writer.Write(argv[1], argv[2])
+ delayed_intake = DelayedIntake('DelayedIntake')
+ loop_writer = control_loop.ControlLoopWriter(
+ 'DelayedIntake', [delayed_intake], namespaces=namespaces)
+ loop_writer.Write(argv[3], argv[4])
+
if __name__ == '__main__':
argv = FLAGS(sys.argv)
glog.init()