blob: 47b7217f6defb9de19217cc493bc4b797e4aacfc [file] [log] [blame]
Austin Schuh085eab92020-11-26 13:54:51 -08001#!/usr/bin/python3
Austin Schuh48d60c12017-02-04 21:58:58 -08002
3from frc971.control_loops.python import control_loop
4from frc971.control_loops.python import controls
5import numpy
Austin Schuh6c20f202017-02-18 22:31:44 -08006import scipy
Austin Schuh48d60c12017-02-04 21:58:58 -08007import sys
8from matplotlib import pylab
9
10import gflags
11import glog
12
13FLAGS = gflags.FLAGS
14
15gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.')
16
Austin Schuh3ad5ed82017-02-25 21:36:19 -080017
18def PlotDiff(list1, list2, time):
Tyler Chatow6738c362019-02-16 14:12:30 -080019 pylab.subplot(1, 1, 1)
20 pylab.plot(time, numpy.subtract(list1, list2), label='diff')
21 pylab.legend()
22
Austin Schuh3ad5ed82017-02-25 21:36:19 -080023
Austin Schuh3ad5ed82017-02-25 21:36:19 -080024class VelocityShooter(control_loop.HybridControlLoop):
Austin Schuh48d60c12017-02-04 21:58:58 -080025
Tyler Chatow6738c362019-02-16 14:12:30 -080026 def __init__(self, name='VelocityShooter'):
27 super(VelocityShooter, self).__init__(name)
28 # Number of motors
29 self.num_motors = 2.0
30 # Stall Torque in N m
31 self.stall_torque = 0.71 * self.num_motors
32 # Stall Current in Amps
33 self.stall_current = 134.0 * self.num_motors
34 # Free Speed in RPM
35 self.free_speed_rpm = 18730.0
36 # Free Speed in rotations/second.
37 self.free_speed = self.free_speed_rpm / 60.0
38 # Free Current in Amps
39 self.free_current = 0.7 * self.num_motors
40 # Moment of inertia of the shooter wheel in kg m^2
41 # 1400.6 grams/cm^2
42 # 1.407 *1e-4 kg m^2
43 self.J = 0.00120
44 # Resistance of the motor, divided by 2 to account for the 2 motors
45 self.R = 12.0 / self.stall_current
46 # Motor velocity constant
47 self.Kv = ((self.free_speed * 2.0 * numpy.pi) /
48 (12.0 - self.R * self.free_current))
49 # Torque constant
50 self.Kt = self.stall_torque / self.stall_current
51 # Gear ratio
52 self.G = 12.0 / 36.0
53 # Control loop time step
54 self.dt = 0.00505
Austin Schuh48d60c12017-02-04 21:58:58 -080055
Tyler Chatow6738c362019-02-16 14:12:30 -080056 # State feedback matrices
57 # [angular velocity]
58 self.A_continuous = numpy.matrix(
59 [[-self.Kt / (self.Kv * self.J * self.G * self.G * self.R)]])
60 self.B_continuous = numpy.matrix(
61 [[self.Kt / (self.J * self.G * self.R)]])
62 self.C = numpy.matrix([[1]])
63 self.D = numpy.matrix([[0]])
Austin Schuh48d60c12017-02-04 21:58:58 -080064
Tyler Chatow6738c362019-02-16 14:12:30 -080065 # The states are [unfiltered_velocity]
66 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
67 self.B_continuous, self.dt)
Austin Schuh48d60c12017-02-04 21:58:58 -080068
Tyler Chatow6738c362019-02-16 14:12:30 -080069 self.PlaceControllerPoles([.75])
Austin Schuhcd3237a2017-02-18 14:19:26 -080070
Tyler Chatow6738c362019-02-16 14:12:30 -080071 glog.debug('K %s', repr(self.K))
72 glog.debug('System poles are %s',
73 repr(numpy.linalg.eig(self.A_continuous)[0]))
74 glog.debug('Poles are %s',
75 repr(numpy.linalg.eig(self.A - self.B * self.K)[0]))
Austin Schuh48d60c12017-02-04 21:58:58 -080076
Tyler Chatow6738c362019-02-16 14:12:30 -080077 self.PlaceObserverPoles([0.3])
Austin Schuh48d60c12017-02-04 21:58:58 -080078
Tyler Chatow6738c362019-02-16 14:12:30 -080079 self.U_max = numpy.matrix([[12.0]])
80 self.U_min = numpy.matrix([[-12.0]])
Austin Schuh48d60c12017-02-04 21:58:58 -080081
Tyler Chatow6738c362019-02-16 14:12:30 -080082 qff_vel = 8.0
83 self.Qff = numpy.matrix([[1.0 / (qff_vel**2.0)]])
84
85 self.Kff = controls.TwoStateFeedForwards(self.B, self.Qff)
86 self.InitializeState()
87
Austin Schuh48d60c12017-02-04 21:58:58 -080088
Austin Schuhc66b6fc2017-03-25 19:56:59 -070089class SecondOrderVelocityShooter(VelocityShooter):
Austin Schuh48d60c12017-02-04 21:58:58 -080090
Tyler Chatow6738c362019-02-16 14:12:30 -080091 def __init__(self, name='SecondOrderVelocityShooter'):
92 super(SecondOrderVelocityShooter, self).__init__(name)
Austin Schuhc66b6fc2017-03-25 19:56:59 -070093
Tyler Chatow6738c362019-02-16 14:12:30 -080094 self.A_continuous_unaugmented = self.A_continuous
95 self.B_continuous_unaugmented = self.B_continuous
Austin Schuhc66b6fc2017-03-25 19:56:59 -070096
Tyler Chatow6738c362019-02-16 14:12:30 -080097 self.A_continuous = numpy.matrix(numpy.zeros((2, 2)))
98 self.A_continuous[0:1, 0:1] = self.A_continuous_unaugmented
99 self.A_continuous[1, 0] = 175.0
100 self.A_continuous[1, 1] = -self.A_continuous[1, 0]
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700101
Tyler Chatow6738c362019-02-16 14:12:30 -0800102 self.B_continuous = numpy.matrix(numpy.zeros((2, 1)))
103 self.B_continuous[0:1, 0] = self.B_continuous_unaugmented
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700104
Tyler Chatow6738c362019-02-16 14:12:30 -0800105 self.C = numpy.matrix([[0, 1]])
106 self.D = numpy.matrix([[0]])
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700107
Tyler Chatow6738c362019-02-16 14:12:30 -0800108 # The states are [unfiltered_velocity, velocity]
109 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
110 self.B_continuous, self.dt)
Austin Schuheb5c22e2017-04-09 18:30:28 -0700111
Tyler Chatow6738c362019-02-16 14:12:30 -0800112 self.PlaceControllerPoles([.70, 0.60])
Austin Schuheb5c22e2017-04-09 18:30:28 -0700113
Tyler Chatow6738c362019-02-16 14:12:30 -0800114 q_vel = 40.0
115 q_filteredvel = 30.0
116 self.Q = numpy.matrix([[(1.0 / (q_vel**2.0)), 0.0],
117 [0.0, (1.0 / (q_filteredvel**2.0))]])
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700118
Tyler Chatow6738c362019-02-16 14:12:30 -0800119 self.R = numpy.matrix([[(1.0 / (3.0**2.0))]])
120 self.K = controls.dlqr(self.A, self.B, self.Q, self.R)
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700121
Tyler Chatow6738c362019-02-16 14:12:30 -0800122 glog.debug('K %s', repr(self.K))
123 glog.debug('System poles are %s',
124 repr(numpy.linalg.eig(self.A_continuous)[0]))
125 glog.debug('Poles are %s',
126 repr(numpy.linalg.eig(self.A - self.B * self.K)[0]))
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700127
Austin Schuh085eab92020-11-26 13:54:51 -0800128 self.PlaceObserverPoles([0.299, 0.301])
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700129
Tyler Chatow6738c362019-02-16 14:12:30 -0800130 self.U_max = numpy.matrix([[12.0]])
131 self.U_min = numpy.matrix([[-12.0]])
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700132
Tyler Chatow6738c362019-02-16 14:12:30 -0800133 qff_vel = 8.0
134 self.Qff = numpy.matrix([[1.0 / (qff_vel**2.0), 0.0],
135 [0.0, 1.0 / (qff_vel**2.0)]])
136
137 self.Kff = controls.TwoStateFeedForwards(self.B, self.Qff)
138 self.InitializeState()
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700139
140
141class Shooter(SecondOrderVelocityShooter):
Austin Schuh48d60c12017-02-04 21:58:58 -0800142
Tyler Chatow6738c362019-02-16 14:12:30 -0800143 def __init__(self, name='Shooter'):
144 super(Shooter, self).__init__(name)
Austin Schuh48d60c12017-02-04 21:58:58 -0800145
Tyler Chatow6738c362019-02-16 14:12:30 -0800146 self.A_continuous_unaugmented = self.A_continuous
147 self.B_continuous_unaugmented = self.B_continuous
Austin Schuh48d60c12017-02-04 21:58:58 -0800148
Tyler Chatow6738c362019-02-16 14:12:30 -0800149 self.A_continuous = numpy.matrix(numpy.zeros((3, 3)))
150 self.A_continuous[1:3, 1:3] = self.A_continuous_unaugmented
151 self.A_continuous[0, 2] = 1
Austin Schuh48d60c12017-02-04 21:58:58 -0800152
Tyler Chatow6738c362019-02-16 14:12:30 -0800153 self.B_continuous = numpy.matrix(numpy.zeros((3, 1)))
154 self.B_continuous[1:3, 0] = self.B_continuous_unaugmented
Austin Schuh48d60c12017-02-04 21:58:58 -0800155
Tyler Chatow6738c362019-02-16 14:12:30 -0800156 # State feedback matrices
157 # [position, unfiltered_velocity, angular velocity]
158 self.C = numpy.matrix([[1, 0, 0]])
159 self.D = numpy.matrix([[0]])
Austin Schuh48d60c12017-02-04 21:58:58 -0800160
Tyler Chatow6738c362019-02-16 14:12:30 -0800161 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
162 self.B_continuous, self.dt)
163 glog.debug(repr(self.A_continuous))
164 glog.debug(repr(self.B_continuous))
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700165
Tyler Chatow6738c362019-02-16 14:12:30 -0800166 observeability = controls.ctrb(self.A.T, self.C.T)
167 glog.debug('Rank of augmented observability matrix. %d',
168 numpy.linalg.matrix_rank(observeability))
Austin Schuhc66b6fc2017-03-25 19:56:59 -0700169
Tyler Chatow6738c362019-02-16 14:12:30 -0800170 self.PlaceObserverPoles([0.9, 0.8, 0.7])
Austin Schuh48d60c12017-02-04 21:58:58 -0800171
Tyler Chatow6738c362019-02-16 14:12:30 -0800172 self.K_unaugmented = self.K
173 self.K = numpy.matrix(numpy.zeros((1, 3)))
174 self.K[0, 1:3] = self.K_unaugmented
175 self.Kff_unaugmented = self.Kff
176 self.Kff = numpy.matrix(numpy.zeros((1, 3)))
177 self.Kff[0, 1:3] = self.Kff_unaugmented
Austin Schuh48d60c12017-02-04 21:58:58 -0800178
Tyler Chatow6738c362019-02-16 14:12:30 -0800179 self.InitializeState()
Austin Schuh48d60c12017-02-04 21:58:58 -0800180
181
182class IntegralShooter(Shooter):
Austin Schuh48d60c12017-02-04 21:58:58 -0800183
Tyler Chatow6738c362019-02-16 14:12:30 -0800184 def __init__(self, name='IntegralShooter'):
185 super(IntegralShooter, self).__init__(name=name)
Austin Schuh48d60c12017-02-04 21:58:58 -0800186
Tyler Chatow6738c362019-02-16 14:12:30 -0800187 self.A_continuous_unaugmented = self.A_continuous
188 self.B_continuous_unaugmented = self.B_continuous
Austin Schuh48d60c12017-02-04 21:58:58 -0800189
Tyler Chatow6738c362019-02-16 14:12:30 -0800190 self.A_continuous = numpy.matrix(numpy.zeros((4, 4)))
191 self.A_continuous[0:3, 0:3] = self.A_continuous_unaugmented
192 self.A_continuous[0:3, 3] = self.B_continuous_unaugmented
Austin Schuh48d60c12017-02-04 21:58:58 -0800193
Tyler Chatow6738c362019-02-16 14:12:30 -0800194 self.B_continuous = numpy.matrix(numpy.zeros((4, 1)))
195 self.B_continuous[0:3, 0] = self.B_continuous_unaugmented
Austin Schuh48d60c12017-02-04 21:58:58 -0800196
Tyler Chatow6738c362019-02-16 14:12:30 -0800197 self.C_unaugmented = self.C
198 self.C = numpy.matrix(numpy.zeros((1, 4)))
199 self.C[0:1, 0:3] = self.C_unaugmented
Austin Schuh48d60c12017-02-04 21:58:58 -0800200
Tyler Chatow6738c362019-02-16 14:12:30 -0800201 # The states are [position, unfiltered_velocity, velocity, torque_error]
202 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
203 self.B_continuous, self.dt)
Austin Schuh6c20f202017-02-18 22:31:44 -0800204
Tyler Chatow6738c362019-02-16 14:12:30 -0800205 glog.debug('A: \n%s', repr(self.A_continuous))
206 glog.debug('eig(A): \n%s', repr(scipy.linalg.eig(self.A_continuous)))
Ravago Jones5127ccc2022-07-31 16:32:45 -0700207 glog.debug('schur(A): \n%s',
208 repr(scipy.linalg.schur(self.A_continuous)))
Tyler Chatow6738c362019-02-16 14:12:30 -0800209 glog.debug('A_dt(A): \n%s', repr(self.A))
Austin Schuh48d60c12017-02-04 21:58:58 -0800210
Tyler Chatow6738c362019-02-16 14:12:30 -0800211 q_pos = 0.01
212 q_vel = 5.0
213 q_velfilt = 1.5
214 q_voltage = 2.0
215 self.Q_continuous = numpy.matrix([[(q_pos**2.0), 0.0, 0.0, 0.0],
216 [0.0, (q_vel**2.0), 0.0, 0.0],
217 [0.0, 0.0, (q_velfilt**2.0), 0.0],
218 [0.0, 0.0, 0.0, (q_voltage**2.0)]])
Austin Schuh48d60c12017-02-04 21:58:58 -0800219
Tyler Chatow6738c362019-02-16 14:12:30 -0800220 r_pos = 0.0003
221 self.R_continuous = numpy.matrix([[(r_pos**2.0)]])
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800222
Ravago Jones5127ccc2022-07-31 16:32:45 -0700223 _, _, self.Q, self.R = controls.kalmd(A_continuous=self.A_continuous,
224 B_continuous=self.B_continuous,
225 Q_continuous=self.Q_continuous,
226 R_continuous=self.R_continuous,
227 dt=self.dt)
Austin Schuh48d60c12017-02-04 21:58:58 -0800228
Ravago Jones5127ccc2022-07-31 16:32:45 -0700229 self.KalmanGain, self.P_steady_state = controls.kalman(A=self.A,
230 B=self.B,
231 C=self.C,
232 Q=self.Q,
233 R=self.R)
Tyler Chatow6738c362019-02-16 14:12:30 -0800234 self.L = self.A * self.KalmanGain
Austin Schuh48d60c12017-02-04 21:58:58 -0800235
Tyler Chatow6738c362019-02-16 14:12:30 -0800236 self.K_unaugmented = self.K
237 self.K = numpy.matrix(numpy.zeros((1, 4)))
238 self.K[0, 0:3] = self.K_unaugmented
239 self.K[0, 3] = 1
240 self.Kff_unaugmented = self.Kff
241 self.Kff = numpy.matrix(numpy.zeros((1, 4)))
242 self.Kff[0, 0:3] = self.Kff_unaugmented
243
244 self.InitializeState()
Austin Schuh48d60c12017-02-04 21:58:58 -0800245
246
247class ScenarioPlotter(object):
Austin Schuh48d60c12017-02-04 21:58:58 -0800248
Tyler Chatow6738c362019-02-16 14:12:30 -0800249 def __init__(self):
250 # Various lists for graphing things.
251 self.t = []
252 self.x = []
253 self.v = []
254 self.a = []
255 self.x_hat = []
256 self.u = []
257 self.offset = []
258 self.diff = []
Austin Schuh48d60c12017-02-04 21:58:58 -0800259
Tyler Chatow6738c362019-02-16 14:12:30 -0800260 def run_test(self,
261 shooter,
262 goal,
263 iterations=200,
264 controller_shooter=None,
265 observer_shooter=None,
266 hybrid_obs=False):
267 """Runs the shooter plant with an initial condition and goal.
Austin Schuh48d60c12017-02-04 21:58:58 -0800268
Tyler Chatow6738c362019-02-16 14:12:30 -0800269 Args:
270 shooter: Shooter object to use.
271 goal: goal state.
272 iterations: Number of timesteps to run the model for.
273 controller_shooter: Shooter object to get K from, or None if we should
274 use shooter.
275 observer_shooter: Shooter object to use for the observer, or None if we
276 should use the actual state.
277 """
Austin Schuh48d60c12017-02-04 21:58:58 -0800278
Tyler Chatow6738c362019-02-16 14:12:30 -0800279 if controller_shooter is None:
280 controller_shooter = shooter
Austin Schuh48d60c12017-02-04 21:58:58 -0800281
Tyler Chatow6738c362019-02-16 14:12:30 -0800282 vbat = 12.0
Austin Schuh48d60c12017-02-04 21:58:58 -0800283
Tyler Chatow6738c362019-02-16 14:12:30 -0800284 if self.t:
285 initial_t = self.t[-1] + shooter.dt
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800286 else:
Tyler Chatow6738c362019-02-16 14:12:30 -0800287 initial_t = 0
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800288
Tyler Chatow6738c362019-02-16 14:12:30 -0800289 last_U = numpy.matrix([[0.0]])
Austin Schuh5ea48472021-02-02 20:46:41 -0800290 for i in range(iterations):
Tyler Chatow6738c362019-02-16 14:12:30 -0800291 X_hat = shooter.X
Austin Schuh48d60c12017-02-04 21:58:58 -0800292
Tyler Chatow6738c362019-02-16 14:12:30 -0800293 if observer_shooter is not None:
294 X_hat = observer_shooter.X_hat
295 self.x_hat.append(observer_shooter.X_hat[2, 0])
Austin Schuh48d60c12017-02-04 21:58:58 -0800296
Tyler Chatow6738c362019-02-16 14:12:30 -0800297 ff_U = controller_shooter.Kff * (goal - observer_shooter.A * goal)
Austin Schuh48d60c12017-02-04 21:58:58 -0800298
Tyler Chatow6738c362019-02-16 14:12:30 -0800299 U = controller_shooter.K * (goal - X_hat) + ff_U
300 U[0, 0] = numpy.clip(U[0, 0], -vbat, vbat)
301 self.x.append(shooter.X[0, 0])
Austin Schuh48d60c12017-02-04 21:58:58 -0800302
Tyler Chatow6738c362019-02-16 14:12:30 -0800303 self.diff.append(shooter.X[2, 0] - observer_shooter.X_hat[2, 0])
Austin Schuh48d60c12017-02-04 21:58:58 -0800304
Tyler Chatow6738c362019-02-16 14:12:30 -0800305 if self.v:
306 last_v = self.v[-1]
307 else:
308 last_v = 0
309
310 self.v.append(shooter.X[2, 0])
311 self.a.append((self.v[-1] - last_v) / shooter.dt)
312
313 if observer_shooter is not None:
314 if i != 0:
315 observer_shooter.Y = shooter.Y
316 observer_shooter.CorrectObserver(U)
317 self.offset.append(observer_shooter.X_hat[3, 0])
318
319 applied_U = last_U.copy()
320 if i > 60:
321 applied_U += 2
322 shooter.Update(applied_U)
323
324 if observer_shooter is not None:
325 if hybrid_obs:
326 observer_shooter.PredictHybridObserver(last_U, shooter.dt)
327 else:
328 observer_shooter.PredictObserver(last_U)
329 last_U = U.copy()
330
331 self.t.append(initial_t + i * shooter.dt)
332 self.u.append(U[0, 0])
333
334 def Plot(self):
335 pylab.figure()
336 pylab.subplot(3, 1, 1)
337 pylab.plot(self.t, self.v, label='x')
338 pylab.plot(self.t, self.x_hat, label='x_hat')
339 pylab.legend()
340
341 pylab.subplot(3, 1, 2)
342 pylab.plot(self.t, self.u, label='u')
343 pylab.plot(self.t, self.offset, label='voltage_offset')
344 pylab.legend()
345
346 pylab.subplot(3, 1, 3)
347 pylab.plot(self.t, self.a, label='a')
348 pylab.legend()
349
350 pylab.draw()
Austin Schuh48d60c12017-02-04 21:58:58 -0800351
352
353def main(argv):
Tyler Chatow6738c362019-02-16 14:12:30 -0800354 scenario_plotter = ScenarioPlotter()
Austin Schuh48d60c12017-02-04 21:58:58 -0800355
Tyler Chatow6738c362019-02-16 14:12:30 -0800356 if FLAGS.plot:
357 iterations = 200
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800358
Tyler Chatow6738c362019-02-16 14:12:30 -0800359 initial_X = numpy.matrix([[0.0], [0.0], [0.0]])
360 R = numpy.matrix([[0.0], [100.0], [100.0], [0.0]])
Austin Schuh48d60c12017-02-04 21:58:58 -0800361
Tyler Chatow6738c362019-02-16 14:12:30 -0800362 scenario_plotter_int = ScenarioPlotter()
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800363
Tyler Chatow6738c362019-02-16 14:12:30 -0800364 shooter = Shooter()
365 shooter_controller = IntegralShooter()
366 observer_shooter_hybrid = IntegralShooter()
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800367
Ravago Jones5127ccc2022-07-31 16:32:45 -0700368 scenario_plotter_int.run_test(shooter,
369 goal=R,
370 controller_shooter=shooter_controller,
371 observer_shooter=observer_shooter_hybrid,
372 iterations=iterations,
373 hybrid_obs=True)
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800374
Tyler Chatow6738c362019-02-16 14:12:30 -0800375 scenario_plotter_int.Plot()
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800376
Tyler Chatow6738c362019-02-16 14:12:30 -0800377 pylab.show()
Austin Schuh3ad5ed82017-02-25 21:36:19 -0800378
Tyler Chatow6738c362019-02-16 14:12:30 -0800379 if len(argv) != 5:
380 glog.fatal('Expected .h file name and .cc file name')
381 else:
382 namespaces = ['y2017', 'control_loops', 'superstructure', 'shooter']
383 shooter = Shooter('Shooter')
Ravago Jones5127ccc2022-07-31 16:32:45 -0700384 loop_writer = control_loop.ControlLoopWriter('Shooter', [shooter],
385 namespaces=namespaces)
Tyler Chatow6738c362019-02-16 14:12:30 -0800386 loop_writer.AddConstant(
387 control_loop.Constant('kFreeSpeed', '%f', shooter.free_speed))
388 loop_writer.AddConstant(
389 control_loop.Constant('kOutputRatio', '%f', shooter.G))
390 loop_writer.Write(argv[1], argv[2])
Austin Schuh48d60c12017-02-04 21:58:58 -0800391
Tyler Chatow6738c362019-02-16 14:12:30 -0800392 integral_shooter = IntegralShooter('IntegralShooter')
393 integral_loop_writer = control_loop.ControlLoopWriter(
394 'IntegralShooter', [integral_shooter],
395 namespaces=namespaces,
396 plant_type='StateFeedbackHybridPlant',
397 observer_type='HybridKalman')
398 integral_loop_writer.Write(argv[3], argv[4])
Austin Schuh48d60c12017-02-04 21:58:58 -0800399
400
401if __name__ == '__main__':
Tyler Chatow6738c362019-02-16 14:12:30 -0800402 argv = FLAGS(sys.argv)
403 glog.init()
404 sys.exit(main(argv))