blob: 5e63df327a510ed737d0b092e0916ec24cc4d7b9 [file] [log] [blame]
Austin Schuh085eab92020-11-26 13:54:51 -08001#!/usr/bin/python3
Brian Silverman6260c092018-01-14 15:21:36 -08002
3from frc971.control_loops.python import control_loop
4from frc971.control_loops.python import controls
5import numpy
6import sys
7import copy
8import scipy.interpolate
9from matplotlib import pylab
10
11import gflags
12import glog
13
14FLAGS = gflags.FLAGS
15
16gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.')
17gflags.DEFINE_string('data', None, 'If defined, plot the provided CAN data')
Tyler Chatow6738c362019-02-16 14:12:30 -080018gflags.DEFINE_bool(
19 'rerun_kf', False,
20 'If true, rerun the KF. The torque in the data file will be interpreted as the commanded current.'
21)
22
Brian Silverman6260c092018-01-14 15:21:36 -080023
24class SystemParams(object):
Brian Silverman6260c092018-01-14 15:21:36 -080025
Tyler Chatow6738c362019-02-16 14:12:30 -080026 def __init__(self, J, G, kP, kD, kCompensationTimeconstant, q_pos, q_vel,
27 q_torque, current_limit):
28 self.J = J
29 self.G = G
30 self.q_pos = q_pos
31 self.q_vel = q_vel
32 self.q_torque = q_torque
33 self.kP = kP
34 self.kD = kD
35 self.kCompensationTimeconstant = kCompensationTimeconstant
36 self.r_pos = 0.001
37 self.current_limit = current_limit
Brian Silverman6260c092018-01-14 15:21:36 -080038
Tyler Chatow6738c362019-02-16 14:12:30 -080039 #[15.0, 0.25],
40 #[10.0, 0.2],
41 #[5.0, 0.13],
42 #[3.0, 0.10],
43 #[2.0, 0.08],
44 #[1.0, 0.06],
45 #[0.5, 0.05],
46 #[0.25, 0.025],
47
48
49kWheel = SystemParams(
50 J=0.0008,
51 G=(1.25 + 0.02) / 0.35,
52 q_pos=0.001,
53 q_vel=0.20,
54 q_torque=0.005,
55 kP=7.0,
56 kD=0.0,
57 kCompensationTimeconstant=0.95,
58 current_limit=4.5)
59kTrigger = SystemParams(
60 J=0.00025,
61 G=(0.925 * 2.0 + 0.02) / 0.35,
62 q_pos=0.001,
63 q_vel=0.1,
64 q_torque=0.005,
65 kP=120.0,
66 kD=1.8,
67 kCompensationTimeconstant=0.95,
68 current_limit=3.0)
69
Brian Silverman6260c092018-01-14 15:21:36 -080070
71class HapticInput(control_loop.ControlLoop):
Brian Silverman6260c092018-01-14 15:21:36 -080072
Tyler Chatow6738c362019-02-16 14:12:30 -080073 def __init__(self, params=None, name='HapticInput'):
74 # The defaults are for the steering wheel.
75 super(HapticInput, self).__init__(name)
76 motor = self.motor = control_loop.MN3510()
Brian Silverman6260c092018-01-14 15:21:36 -080077
Tyler Chatow6738c362019-02-16 14:12:30 -080078 # Moment of inertia of the wheel in kg m^2
79 self.J = params.J
Brian Silverman6260c092018-01-14 15:21:36 -080080
Tyler Chatow6738c362019-02-16 14:12:30 -080081 # Control loop time step
82 self.dt = 0.001
Brian Silverman6260c092018-01-14 15:21:36 -080083
Tyler Chatow6738c362019-02-16 14:12:30 -080084 # Gear ratio from the motor to the input.
85 self.G = params.G
Brian Silverman6260c092018-01-14 15:21:36 -080086
Tyler Chatow6738c362019-02-16 14:12:30 -080087 self.A_continuous = numpy.matrix(numpy.zeros((2, 2)))
88 self.A_continuous[1, 1] = 0
89 self.A_continuous[0, 1] = 1
Brian Silverman6260c092018-01-14 15:21:36 -080090
Tyler Chatow6738c362019-02-16 14:12:30 -080091 self.B_continuous = numpy.matrix(numpy.zeros((2, 1)))
92 self.B_continuous[1, 0] = motor.Kt * self.G / self.J
Brian Silverman6260c092018-01-14 15:21:36 -080093
Tyler Chatow6738c362019-02-16 14:12:30 -080094 # State feedback matrices
95 # [position, angular velocity]
96 self.C = numpy.matrix([[1.0, 0.0]])
97 self.D = numpy.matrix([[0.0]])
Brian Silverman6260c092018-01-14 15:21:36 -080098
Tyler Chatow6738c362019-02-16 14:12:30 -080099 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
100 self.B_continuous, self.dt)
Brian Silverman6260c092018-01-14 15:21:36 -0800101
Tyler Chatow6738c362019-02-16 14:12:30 -0800102 self.U_max = numpy.matrix([[2.5]])
103 self.U_min = numpy.matrix([[-2.5]])
Brian Silverman6260c092018-01-14 15:21:36 -0800104
Tyler Chatow6738c362019-02-16 14:12:30 -0800105 self.L = numpy.matrix([[0.0], [0.0]])
106 self.K = numpy.matrix([[0.0, 0.0]])
107
108 self.InitializeState()
Brian Silverman6260c092018-01-14 15:21:36 -0800109
110
111class IntegralHapticInput(HapticInput):
Brian Silverman6260c092018-01-14 15:21:36 -0800112
Tyler Chatow6738c362019-02-16 14:12:30 -0800113 def __init__(self, params=None, name="IntegralHapticInput"):
114 super(IntegralHapticInput, self).__init__(name=name, params=params)
Brian Silverman6260c092018-01-14 15:21:36 -0800115
Tyler Chatow6738c362019-02-16 14:12:30 -0800116 self.A_continuous_unaugmented = self.A_continuous
117 self.B_continuous_unaugmented = self.B_continuous
Brian Silverman6260c092018-01-14 15:21:36 -0800118
Tyler Chatow6738c362019-02-16 14:12:30 -0800119 self.A_continuous = numpy.matrix(numpy.zeros((3, 3)))
120 self.A_continuous[0:2, 0:2] = self.A_continuous_unaugmented
121 self.A_continuous[1, 2] = (1 / self.J)
Brian Silverman6260c092018-01-14 15:21:36 -0800122
Tyler Chatow6738c362019-02-16 14:12:30 -0800123 self.B_continuous = numpy.matrix(numpy.zeros((3, 1)))
124 self.B_continuous[0:2, 0] = self.B_continuous_unaugmented
Brian Silverman6260c092018-01-14 15:21:36 -0800125
Tyler Chatow6738c362019-02-16 14:12:30 -0800126 self.C_unaugmented = self.C
127 self.C = numpy.matrix(numpy.zeros((1, 3)))
128 self.C[0:1, 0:2] = self.C_unaugmented
Brian Silverman6260c092018-01-14 15:21:36 -0800129
Tyler Chatow6738c362019-02-16 14:12:30 -0800130 self.A, self.B = self.ContinuousToDiscrete(self.A_continuous,
131 self.B_continuous, self.dt)
Brian Silverman6260c092018-01-14 15:21:36 -0800132
Tyler Chatow6738c362019-02-16 14:12:30 -0800133 self.Q = numpy.matrix([[(params.q_pos**2.0), 0.0, 0.0],
134 [0.0, (params.q_vel**2.0), 0.0],
135 [0.0, 0.0, (params.q_torque**2.0)]])
Brian Silverman6260c092018-01-14 15:21:36 -0800136
Tyler Chatow6738c362019-02-16 14:12:30 -0800137 self.R = numpy.matrix([[(params.r_pos**2.0)]])
Brian Silverman6260c092018-01-14 15:21:36 -0800138
Tyler Chatow6738c362019-02-16 14:12:30 -0800139 self.KalmanGain, self.Q_steady = controls.kalman(
140 A=self.A, B=self.B, C=self.C, Q=self.Q, R=self.R)
141 self.L = self.A * self.KalmanGain
Brian Silverman6260c092018-01-14 15:21:36 -0800142
Tyler Chatow6738c362019-02-16 14:12:30 -0800143 self.K_unaugmented = self.K
144 self.K = numpy.matrix(numpy.zeros((1, 3)))
145 self.K[0, 0:2] = self.K_unaugmented
146 self.K[0, 2] = 1.0 / (self.motor.Kt / (self.motor.resistance))
147
148 self.InitializeState()
149
Brian Silverman6260c092018-01-14 15:21:36 -0800150
151def ReadCan(filename):
Tyler Chatow6738c362019-02-16 14:12:30 -0800152 """Reads the candump in filename and returns the 4 fields."""
153 trigger = []
154 trigger_velocity = []
155 trigger_torque = []
156 trigger_current = []
157 wheel = []
158 wheel_velocity = []
159 wheel_torque = []
160 wheel_current = []
Brian Silverman6260c092018-01-14 15:21:36 -0800161
Tyler Chatow6738c362019-02-16 14:12:30 -0800162 trigger_request_time = [0.0]
163 trigger_request_current = [0.0]
164 wheel_request_time = [0.0]
165 wheel_request_current = [0.0]
Brian Silverman6260c092018-01-14 15:21:36 -0800166
Tyler Chatow6738c362019-02-16 14:12:30 -0800167 with open(filename, 'r') as fd:
168 for line in fd:
169 data = line.split()
170 can_id = int(data[1], 16)
171 if can_id == 0:
172 data = [int(d, 16) for d in data[3:]]
173 trigger.append(((data[0] + (data[1] << 8)) - 32768) / 32768.0)
174 trigger_velocity.append(
175 ((data[2] + (data[3] << 8)) - 32768) / 32768.0)
176 trigger_torque.append(
177 ((data[4] + (data[5] << 8)) - 32768) / 32768.0)
178 trigger_current.append(
179 ((data[6] + ((data[7] & 0x3f) << 8)) - 8192) / 8192.0)
180 elif can_id == 1:
181 data = [int(d, 16) for d in data[3:]]
182 wheel.append(((data[0] + (data[1] << 8)) - 32768) / 32768.0)
183 wheel_velocity.append(
184 ((data[2] + (data[3] << 8)) - 32768) / 32768.0)
185 wheel_torque.append(
186 ((data[4] + (data[5] << 8)) - 32768) / 32768.0)
187 wheel_current.append(
188 ((data[6] + ((data[7] & 0x3f) << 8)) - 8192) / 8192.0)
189 elif can_id == 2:
190 data = [int(d, 16) for d in data[3:]]
191 trigger_request_current.append(
192 ((data[4] + (data[5] << 8)) - 32768) / 32768.0)
193 trigger_request_time.append(len(trigger) * 0.001)
194 elif can_id == 3:
195 data = [int(d, 16) for d in data[3:]]
196 wheel_request_current.append(
197 ((data[4] + (data[5] << 8)) - 32768) / 32768.0)
198 wheel_request_time.append(len(wheel) * 0.001)
Brian Silverman6260c092018-01-14 15:21:36 -0800199
Tyler Chatow6738c362019-02-16 14:12:30 -0800200 trigger_data_time = numpy.arange(0, len(trigger)) * 0.001
201 wheel_data_time = numpy.arange(0, len(wheel)) * 0.001
Brian Silverman6260c092018-01-14 15:21:36 -0800202
Tyler Chatow6738c362019-02-16 14:12:30 -0800203 # Extend out the data in the interpolation table.
204 trigger_request_time.append(trigger_data_time[-1])
205 trigger_request_current.append(trigger_request_current[-1])
206 wheel_request_time.append(wheel_data_time[-1])
207 wheel_request_current.append(wheel_request_current[-1])
Brian Silverman6260c092018-01-14 15:21:36 -0800208
Tyler Chatow6738c362019-02-16 14:12:30 -0800209 return (trigger_data_time, wheel_data_time, trigger, wheel,
210 trigger_velocity, wheel_velocity, trigger_torque, wheel_torque,
211 trigger_current, wheel_current, trigger_request_time,
212 trigger_request_current, wheel_request_time, wheel_request_current)
Brian Silverman6260c092018-01-14 15:21:36 -0800213
Brian Silverman6260c092018-01-14 15:21:36 -0800214
Tyler Chatow6738c362019-02-16 14:12:30 -0800215def rerun_and_plot_kf(data_time,
216 data_radians,
217 data_current,
218 data_request_current,
219 params,
220 run_correct=True):
221 kf_velocity = []
222 dt_velocity = []
223 kf_position = []
224 adjusted_position = []
225 last_angle = None
226 haptic_observer = IntegralHapticInput(params=params)
Brian Silverman6260c092018-01-14 15:21:36 -0800227
Tyler Chatow6738c362019-02-16 14:12:30 -0800228 # Parameter sweep J.
229 num_kf = 1
230 min_J = max_J = params.J
Brian Silverman6260c092018-01-14 15:21:36 -0800231
Tyler Chatow6738c362019-02-16 14:12:30 -0800232 # J = 0.0022
233 #num_kf = 15
234 #min_J = min_J / 2.0
235 #max_J = max_J * 2.0
236 initial_velocity = (data_radians[1] - data_radians[0]) * 1000.0
Brian Silverman6260c092018-01-14 15:21:36 -0800237
Tyler Chatow6738c362019-02-16 14:12:30 -0800238 def DupParamsWithJ(params, J):
239 p = copy.copy(params)
240 p.J = J
241 return p
Brian Silverman6260c092018-01-14 15:21:36 -0800242
Tyler Chatow6738c362019-02-16 14:12:30 -0800243 haptic_observers = [
244 IntegralHapticInput(params=DupParamsWithJ(params, j))
245 for j in numpy.logspace(
246 numpy.log10(min_J), numpy.log10(max_J), num=num_kf)
247 ]
248 # Initialize all the KF's.
249 haptic_observer.X_hat[1, 0] = initial_velocity
250 haptic_observer.X_hat[0, 0] = data_radians[0]
251 for observer in haptic_observers:
252 observer.X_hat[1, 0] = initial_velocity
253 observer.X_hat[0, 0] = data_radians[0]
Brian Silverman6260c092018-01-14 15:21:36 -0800254
Tyler Chatow6738c362019-02-16 14:12:30 -0800255 last_request_current = data_request_current[0]
Austin Schuh5ea48472021-02-02 20:46:41 -0800256 kf_torques = [[] for i in range(num_kf)]
Tyler Chatow6738c362019-02-16 14:12:30 -0800257 for angle, current, request_current in zip(data_radians, data_current,
258 data_request_current):
259 # Predict and correct all the parameter swept observers.
260 for i, observer in enumerate(haptic_observers):
261 observer.Y = numpy.matrix([[angle]])
262 if run_correct:
263 observer.CorrectObserver(numpy.matrix([[current]]))
264 kf_torques[i].append(-observer.X_hat[2, 0])
265 observer.PredictObserver(numpy.matrix([[current]]))
266 observer.PredictObserver(numpy.matrix([[current]]))
Brian Silverman6260c092018-01-14 15:21:36 -0800267
Tyler Chatow6738c362019-02-16 14:12:30 -0800268 # Predict and correct the main observer.
269 haptic_observer.Y = numpy.matrix([[angle]])
270 if run_correct:
271 haptic_observer.CorrectObserver(numpy.matrix([[current]]))
272 kf_position.append(haptic_observer.X_hat[0, 0])
273 adjusted_position.append(kf_position[-1] -
274 last_request_current / params.kP)
275 last_request_current = last_request_current * params.kCompensationTimeconstant + request_current * (
276 1.0 - params.kCompensationTimeconstant)
277 kf_velocity.append(haptic_observer.X_hat[1, 0])
278 if last_angle is None:
279 last_angle = angle
280 dt_velocity.append((angle - last_angle) / 0.001)
Brian Silverman6260c092018-01-14 15:21:36 -0800281
Tyler Chatow6738c362019-02-16 14:12:30 -0800282 haptic_observer.PredictObserver(numpy.matrix([[current]]))
283 last_angle = angle
Brian Silverman6260c092018-01-14 15:21:36 -0800284
Tyler Chatow6738c362019-02-16 14:12:30 -0800285 # Plot the wheel observers.
286 fig, ax1 = pylab.subplots()
287 ax1.plot(data_time, data_radians, '.', label='wheel')
288 ax1.plot(data_time, dt_velocity, '.', label='dt_velocity')
289 ax1.plot(data_time, kf_velocity, '.', label='kf_velocity')
290 ax1.plot(data_time, kf_position, '.', label='kf_position')
291 ax1.plot(data_time, adjusted_position, '.', label='adjusted_position')
Brian Silverman6260c092018-01-14 15:21:36 -0800292
Tyler Chatow6738c362019-02-16 14:12:30 -0800293 ax2 = ax1.twinx()
294 ax2.plot(data_time, data_current, label='data_current')
295 ax2.plot(data_time, data_request_current, label='request_current')
Brian Silverman6260c092018-01-14 15:21:36 -0800296
Tyler Chatow6738c362019-02-16 14:12:30 -0800297 for i, kf_torque in enumerate(kf_torques):
298 ax2.plot(
299 data_time,
300 kf_torque,
301 label='-kf_torque[%f]' % haptic_observers[i].J)
302 fig.tight_layout()
303 ax1.legend(loc=3)
304 ax2.legend(loc=4)
Brian Silverman6260c092018-01-14 15:21:36 -0800305
Brian Silverman6260c092018-01-14 15:21:36 -0800306
Tyler Chatow6738c362019-02-16 14:12:30 -0800307def plot_input(data_time,
308 data_radians,
309 data_velocity,
310 data_torque,
311 data_current,
312 params,
313 run_correct=True):
314 dt_velocity = []
315 last_angle = None
316 initial_velocity = (data_radians[1] - data_radians[0]) * 1000.0
Brian Silverman6260c092018-01-14 15:21:36 -0800317
Tyler Chatow6738c362019-02-16 14:12:30 -0800318 for angle in data_radians:
319 if last_angle is None:
320 last_angle = angle
321 dt_velocity.append((angle - last_angle) / 0.001)
322
323 last_angle = angle
324
325 # Plot the wheel observers.
326 fig, ax1 = pylab.subplots()
327 ax1.plot(data_time, data_radians, '.', label='angle')
328 ax1.plot(data_time, data_velocity, '-', label='velocity')
329 ax1.plot(data_time, dt_velocity, '.', label='dt_velocity')
330
331 ax2 = ax1.twinx()
332 ax2.plot(data_time, data_torque, label='data_torque')
333 ax2.plot(data_time, data_current, label='data_current')
334 fig.tight_layout()
335 ax1.legend(loc=3)
336 ax2.legend(loc=4)
337
Brian Silverman6260c092018-01-14 15:21:36 -0800338
339def main(argv):
Tyler Chatow6738c362019-02-16 14:12:30 -0800340 if FLAGS.plot:
341 if FLAGS.data is None:
342 haptic_wheel = HapticInput()
343 haptic_wheel_controller = IntegralHapticInput()
344 observer_haptic_wheel = IntegralHapticInput()
345 observer_haptic_wheel.X_hat[2, 0] = 0.01
Brian Silverman6260c092018-01-14 15:21:36 -0800346
Tyler Chatow6738c362019-02-16 14:12:30 -0800347 R = numpy.matrix([[0.0], [0.0], [0.0]])
Brian Silverman6260c092018-01-14 15:21:36 -0800348
Tyler Chatow6738c362019-02-16 14:12:30 -0800349 control_loop.TestSingleIntegralAxisSquareWave(
350 R, 1.0, haptic_wheel, haptic_wheel_controller,
351 observer_haptic_wheel)
352 else:
353 # Read the CAN trace in.
354 trigger_data_time, wheel_data_time, trigger, wheel, trigger_velocity, \
355 wheel_velocity, trigger_torque, wheel_torque, trigger_current, \
356 wheel_current, trigger_request_time, trigger_request_current, \
357 wheel_request_time, wheel_request_current = ReadCan(FLAGS.data)
358
359 wheel_radians = [w * numpy.pi * (338.16 / 360.0) for w in wheel]
360 wheel_velocity = [w * 50.0 for w in wheel_velocity]
361 wheel_torque = [w / 2.0 for w in wheel_torque]
362 wheel_current = [w * 10.0 for w in wheel_current]
363 wheel_request_current = [w * 2.0 for w in wheel_request_current]
364 resampled_wheel_request_current = scipy.interpolate.interp1d(
365 wheel_request_time, wheel_request_current,
366 kind="zero")(wheel_data_time)
367
368 trigger_radians = [t * numpy.pi * (45.0 / 360.0) for t in trigger]
369 trigger_velocity = [t * 50.0 for t in trigger_velocity]
370 trigger_torque = [t / 2.0 for t in trigger_torque]
371 trigger_current = [t * 10.0 for t in trigger_current]
372 trigger_request_current = [t * 2.0 for t in trigger_request_current]
373 resampled_trigger_request_current = scipy.interpolate.interp1d(
374 trigger_request_time, trigger_request_current,
375 kind="zero")(trigger_data_time)
376
377 if FLAGS.rerun_kf:
378 rerun_and_plot_kf(
379 trigger_data_time,
380 trigger_radians,
381 trigger_current,
382 resampled_trigger_request_current,
383 kTrigger,
384 run_correct=True)
385 rerun_and_plot_kf(
386 wheel_data_time,
387 wheel_radians,
388 wheel_current,
389 resampled_wheel_request_current,
390 kWheel,
391 run_correct=True)
392 else:
393 plot_input(trigger_data_time, trigger_radians, trigger_velocity,
394 trigger_torque, trigger_current, kTrigger)
395 plot_input(wheel_data_time, wheel_radians, wheel_velocity,
396 wheel_torque, wheel_current, kWheel)
397 pylab.show()
398
399 return
400
401 if len(argv) != 9:
402 glog.fatal('Expected .h file name and .cc file name')
Brian Silverman6260c092018-01-14 15:21:36 -0800403 else:
Tyler Chatow6738c362019-02-16 14:12:30 -0800404 namespaces = ['frc971', 'control_loops', 'drivetrain']
405 for name, params, filenames in [('HapticWheel', kWheel, argv[1:5]),
406 ('HapticTrigger', kTrigger, argv[5:9])]:
407 haptic_input = HapticInput(params=params, name=name)
408 loop_writer = control_loop.ControlLoopWriter(
409 name, [haptic_input],
410 namespaces=namespaces,
411 scalar_type='float')
412 loop_writer.Write(filenames[0], filenames[1])
Brian Silverman6260c092018-01-14 15:21:36 -0800413
Tyler Chatow6738c362019-02-16 14:12:30 -0800414 integral_haptic_input = IntegralHapticInput(
415 params=params, name='Integral' + name)
416 integral_loop_writer = control_loop.ControlLoopWriter(
417 'Integral' + name, [integral_haptic_input],
418 namespaces=namespaces,
419 scalar_type='float')
Brian Silverman6260c092018-01-14 15:21:36 -0800420
Tyler Chatow6738c362019-02-16 14:12:30 -0800421 integral_loop_writer.AddConstant(
422 control_loop.Constant("k" + name + "Dt", "%f",
423 integral_haptic_input.dt))
424 integral_loop_writer.AddConstant(
425 control_loop.Constant("k" + name + "FreeCurrent", "%f",
426 integral_haptic_input.motor.free_current))
427 integral_loop_writer.AddConstant(
428 control_loop.Constant("k" + name + "StallTorque", "%f",
429 integral_haptic_input.motor.stall_torque))
430 integral_loop_writer.AddConstant(
431 control_loop.Constant("k" + name + "J", "%f",
432 integral_haptic_input.J))
433 integral_loop_writer.AddConstant(
434 control_loop.Constant("k" + name + "R", "%f",
435 integral_haptic_input.motor.resistance))
436 integral_loop_writer.AddConstant(
437 control_loop.Constant("k" + name + "T", "%f",
438 integral_haptic_input.motor.Kt))
439 integral_loop_writer.AddConstant(
440 control_loop.Constant("k" + name + "V", "%f",
441 integral_haptic_input.motor.Kv))
442 integral_loop_writer.AddConstant(
443 control_loop.Constant("k" + name + "P", "%f", params.kP))
444 integral_loop_writer.AddConstant(
445 control_loop.Constant("k" + name + "D", "%f", params.kD))
446 integral_loop_writer.AddConstant(
447 control_loop.Constant("k" + name + "G", "%f", params.G))
448 integral_loop_writer.AddConstant(
449 control_loop.Constant("k" + name + "CurrentLimit", "%f",
450 params.current_limit))
Brian Silverman6260c092018-01-14 15:21:36 -0800451
Tyler Chatow6738c362019-02-16 14:12:30 -0800452 integral_loop_writer.Write(filenames[2], filenames[3])
Brian Silverman6260c092018-01-14 15:21:36 -0800453
454
455if __name__ == '__main__':
Tyler Chatow6738c362019-02-16 14:12:30 -0800456 argv = FLAGS(sys.argv)
457 sys.exit(main(argv))