blob: f4a5094ccd6f6a2bdef35cd16c3de8a887d01dc4 [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,
Austin Schuhecc92a02019-01-20 17:42:19 -080018 q_pos_low=0.12,
19 q_pos_high=0.14,
20 q_vel_low=1.0,
21 q_vel_high=0.95,
22 controller_poles=[0.82, 0.82])
Austin Schuhbcce26a2018-03-26 23:41:24 -070023
24
25def main(argv):
26 argv = FLAGS(argv)
27 glog.init()
28
29 if len(argv) != 5:
30 print "Expected .h file name and .cc file name"
31 else:
32 # Write the generated constants out to a file.
33 drivetrain.WriteDrivetrain(
34 argv[1:3],
35 argv[3:5], ['motors', 'seems_reasonable'],
36 kDrivetrain,
37 scalar_type='float')
38
39
40if __name__ == '__main__':
41 sys.exit(main(sys.argv))