Converted state feedback controller and plant over to being gain scheduled, and used them in the indexer. Also wrote the python to make it easy to design gain scheduled controllers.
diff --git a/frc971/control_loops/python/angle_adjust.py b/frc971/control_loops/python/angle_adjust.py
index f49c305..bee58bc 100755
--- a/frc971/control_loops/python/angle_adjust.py
+++ b/frc971/control_loops/python/angle_adjust.py
@@ -44,7 +44,7 @@
self.ContinuousToDiscrete(self.A_continuous, self.B_continuous,
self.dt, self.C)
- self.PlaceControllerPoles([.5, .5])
+ self.PlaceControllerPoles([.45, .8])
self.rpl = .05
self.ipl = 0.008
@@ -92,11 +92,11 @@
if len(argv) != 3:
print "Expected .cc file name and .h file name"
else:
+ loop_writer = control_loop.ControlLoopWriter("AngleAdjust", [angle_adjust])
if argv[1][-3:] == '.cc':
- print '.cc file is second'
+ loop_writer.Write(argv[2], argv[1])
else:
- angle_adjust.DumpHeaderFile(argv[1])
- angle_adjust.DumpCppFile(argv[2], argv[1])
+ loop_writer.Write(argv[1], argv[2])
if __name__ == '__main__':
sys.exit(main(sys.argv))