Sabina Davis | a553dc4 | 2018-09-05 19:38:59 -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 | gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.') |
| 12 | |
| 13 | #TODO(sabina): update values |
| 14 | kDrivetrain = drivetrain.DrivetrainParams( |
| 15 | J=1.0, |
| 16 | mass=1.0, |
| 17 | robot_radius=0.6 / 2.0, |
| 18 | wheel_radius=4.0 / 2.0, |
| 19 | G_high=1.0, |
| 20 | G_low=1.0, |
| 21 | q_pos_low=0.12, |
| 22 | q_pos_high=0.14, |
| 23 | q_vel_low=1.0, |
| 24 | q_vel_high=0.95, |
| 25 | has_imu=False) |
| 26 | |
| 27 | def main(argv): |
| 28 | argv = FLAGS(argv) |
| 29 | glog.init() |
| 30 | |
| 31 | if FLAGS.plot: |
| 32 | drivetrain.PlotDrivetrainMotions(kDrivetrain) |
| 33 | elif len(argv) != 5: |
| 34 | print "Expected .h file name and .cc file name" |
| 35 | else: |
| 36 | # Write the generated constants out to a file. |
| 37 | drivetrain.WriteDrivetrain(argv[1:3], argv[3:5], 'y2018_bot3', kDrivetrain) |
| 38 | |
| 39 | if __name__ == '__main__': |
| 40 | sys.exit(main(sys.argv)) |