blob: b630601b46520b3bc79c499c37244eae8fd3455a [file] [log] [blame]
Sabina Davisf4c5e762018-01-24 10:18:43 -08001#!/usr/bin/python
2
3from frc971.control_loops.python import drivetrain
4import sys
5
6import gflags
7import glog
8
9FLAGS = gflags.FLAGS
10
11gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.')
12
13#update mass (120lbs right now)
14#robot radius needs confirming(set as distance of center wheels from each other)
15#J needs updating
16
17kDrivetrain = drivetrain.DrivetrainParams(J = 2.0,
18 mass = 54.4311,
19 robot_radius = 0.675 / 2.0,
20 wheel_radius = 0.127 / 2.0,
21 G_low = 46.0 / 60.0 * 20.0 / 48.0 * 14.0 / 62.0 ,
22 G_high = 62.0 / 44.0 * 20.0 / 48.0 * 14.0 / 62.0,
23 q_pos_low = 0.12,
24 q_pos_high = 0.14,
25 q_vel_low = 1.0,
26 q_vel_high = 0.95)
27
28def main(argv):
29 argv = FLAGS(argv)
30 glog.init()
31
32 if FLAGS.plot:
33 drivetrain.PlotDrivetrainMotions(kDrivetrain)
34 elif len(argv) != 5:
35 print "Expected .h file name and .cc file name"
36 else:
37 # Write the generated constants out to a file.
38 drivetrain.WriteDrivetrain(argv[1:3], argv[3:5], 'y2018', kDrivetrain)
39
40if __name__ == '__main__':
41 sys.exit(main(sys.argv))