blob: 1eeeb424500f2b3affe86b001237c6f44d63ae18 [file] [log] [blame]
Austin Schuh085eab92020-11-26 13:54:51 -08001#!/usr/bin/python3
Austin Schuhbcce26a2018-03-26 23:41:24 -07002
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
James Kuszmauleeb98e92024-01-14 22:15:32 -080029 if len(argv) != 7:
30 glog.error("Expected .h, .cc, and .json filenames")
Austin Schuhbcce26a2018-03-26 23:41:24 -070031 else:
32 # Write the generated constants out to a file.
James Kuszmauleeb98e92024-01-14 22:15:32 -080033 drivetrain.WriteDrivetrain(argv[1:4],
34 argv[4:7], ['motors', 'seems_reasonable'],
Ravago Jones5127ccc2022-07-31 16:32:45 -070035 kDrivetrain,
36 scalar_type='float')
Austin Schuhbcce26a2018-03-26 23:41:24 -070037
38
39if __name__ == '__main__':
40 sys.exit(main(sys.argv))