Updated shooter motor constants.
diff --git a/bot3/control_loops/python/shooter.py b/bot3/control_loops/python/shooter.py
index 7cbe617..cc7930f 100755
--- a/bot3/control_loops/python/shooter.py
+++ b/bot3/control_loops/python/shooter.py
@@ -40,8 +40,10 @@
self.C = numpy.matrix([[1, 0]])
self.D = numpy.matrix([[0]])
- self.ContinuousToDiscrete(self.A_continuous, self.B_continuous,
- self.dt, self.C)
+ self.A, self.B = self.ContinuousToDiscrete(self.A_continuous, self.B_continuous,
+ self.dt)
+
+ self.InitializeState()
self.PlaceControllerPoles([.6, .981])
@@ -77,7 +79,7 @@
pylab.plot(range(shooter_data.shape[0]), real_x, label='Reality')
pylab.plot(range(shooter_data.shape[0]), x_vel, label='Velocity')
pylab.legend()
- pylab.show()
+# pylab.show()
# Simulate the closed loop response of the system to a step input.
shooter = Shooter()
@@ -112,7 +114,7 @@
#pylab.plot(pylab.linspace(0,1.99,200), close_loop_U, 'ro')
#pylab.plotfile("shooter.csv", (0,2))
pylab.plot(pylab.linspace(0,1.99,200), close_loop_x, 'ro')
- pylab.show()
+# pylab.show()
# Simulate spin down.
spin_down_x = [];
diff --git a/bot3/control_loops/shooter/shooter_motor_plant.cc b/bot3/control_loops/shooter/shooter_motor_plant.cc
index 0617554..70f052d 100644
--- a/bot3/control_loops/shooter/shooter_motor_plant.cc
+++ b/bot3/control_loops/shooter/shooter_motor_plant.cc
@@ -1,17 +1,17 @@
-#include "bot3/control_loops/shooter/shooter_motor_plant.h"
+#include "frc971/control_loops/shooter/shooter_motor_plant.h"
#include <vector>
#include "frc971/control_loops/state_feedback_loop.h"
-namespace bot3 {
+namespace frc971 {
namespace control_loops {
StateFeedbackPlantCoefficients<2, 1, 1> MakeShooterPlantCoefficients() {
Eigen::Matrix<double, 2, 2> A;
- A << 1.0, 0.00992127884628, 0.0, 0.984297191531;
+ A << 1.0, 0.00994518845675, 0.0, 0.989057756738;
Eigen::Matrix<double, 2, 1> B;
- B << 0.00398899915072, 0.795700859132;
+ B << 0.00267091861198, 0.533205953514;
Eigen::Matrix<double, 1, 2> C;
C << 1, 0;
Eigen::Matrix<double, 1, 1> D;
@@ -25,9 +25,9 @@
StateFeedbackController<2, 1, 1> MakeShooterController() {
Eigen::Matrix<double, 2, 1> L;
- L << 1.08429719153, 29.2677479765;
+ L << 1.08905775674, 29.7111780621;
Eigen::Matrix<double, 1, 2> K;
- K << 0.955132813139, 0.50205697652;
+ K << 1.42534042426, 0.758151303088;
return StateFeedbackController<2, 1, 1>(L, K, MakeShooterPlantCoefficients());
}
@@ -44,4 +44,4 @@
}
} // namespace control_loops
-} // namespace bot3
+} // namespace frc971
diff --git a/bot3/control_loops/shooter/shooter_motor_plant.h b/bot3/control_loops/shooter/shooter_motor_plant.h
index 1721d30..3588605 100644
--- a/bot3/control_loops/shooter/shooter_motor_plant.h
+++ b/bot3/control_loops/shooter/shooter_motor_plant.h
@@ -3,7 +3,7 @@
#include "frc971/control_loops/state_feedback_loop.h"
-namespace bot3 {
+namespace frc971 {
namespace control_loops {
StateFeedbackPlantCoefficients<2, 1, 1> MakeShooterPlantCoefficients();
@@ -15,6 +15,6 @@
StateFeedbackLoop<2, 1, 1> MakeShooterLoop();
} // namespace control_loops
-} // namespace bot3
+} // namespace frc971
#endif // FRC971_CONTROL_LOOPS_SHOOTER_SHOOTER_MOTOR_PLANT_H_
diff --git a/bot3/control_loops/update_shooter.sh b/bot3/control_loops/update_shooter.sh
new file mode 100755
index 0000000..db98547
--- /dev/null
+++ b/bot3/control_loops/update_shooter.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+# Updates the shooter controller.
+
+./python/shooter.py shooter/shooter_motor_plant.h shooter/shooter_motor_plant.cc