Austin Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | from frc971.control_loops.python import drivetrain |
| 4 | import sys |
| 5 | |
| 6 | import gflags |
| 7 | import glog |
| 8 | |
| 9 | FLAGS = gflags.FLAGS |
| 10 | |
| 11 | kDrivetrain = 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 Schuh | ecc92a0 | 2019-01-20 17:42:19 -0800 | [diff] [blame^] | 18 | 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 Schuh | bcce26a | 2018-03-26 23:41:24 -0700 | [diff] [blame] | 23 | |
| 24 | |
| 25 | def 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 | |
| 40 | if __name__ == '__main__': |
| 41 | sys.exit(main(sys.argv)) |