blob: dfa2f1600c264295a90beeecbfd5988f2ed0fa55 [file] [log] [blame]
Austin Schuhbcce26a2018-03-26 23:41:24 -07001#!/usr/bin/python
2
3from frc971.control_loops.python import drivetrain
4import sys
5
6import gflags
7import glog
8
9FLAGS = gflags.FLAGS
10
11kDrivetrain = drivetrain.DrivetrainParams(
12 J=8.0,
13 mass=100.0,
14 robot_radius=0.616 / 2.0,
15 wheel_radius=0.127 / 2.0 * 120.0 / 118.0,
16 G_low=46.0 / 60.0 * 20.0 / 48.0 * 14.0 / 62.0,
17 G_high=62.0 / 44.0 * 20.0 / 48.0 * 14.0 / 62.0,
18 controller_poles=[0.82, 0.82],
19)
20
21
22def main(argv):
23 argv = FLAGS(argv)
24 glog.init()
25
26 if len(argv) != 5:
27 print "Expected .h file name and .cc file name"
28 else:
29 # Write the generated constants out to a file.
30 drivetrain.WriteDrivetrain(
31 argv[1:3],
32 argv[3:5], ['motors', 'seems_reasonable'],
33 kDrivetrain,
34 scalar_type='float')
35
36
37if __name__ == '__main__':
38 sys.exit(main(sys.argv))