Add single speed robot option to DrivetrainParams
It just forces high and low to have the same ratio, but then we can
change this in the future easier.
Change-Id: I7011703d5f0800638bc285d9da75b03342bc602c
diff --git a/y2017/control_loops/python/drivetrain.py b/y2017/control_loops/python/drivetrain.py
index 74b114d..50a5a1c 100755
--- a/y2017/control_loops/python/drivetrain.py
+++ b/y2017/control_loops/python/drivetrain.py
@@ -10,29 +10,29 @@
gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.')
-kDrivetrain = drivetrain.DrivetrainParams(J = 6.0,
- mass = 52,
- robot_radius = 0.59055 / 2.0,
- wheel_radius = 0.08255 / 2.0,
- G_high = 11.0 / 60.0,
- G_low = 11.0 / 60.0,
- q_pos_low = 0.12,
- q_pos_high = 0.14,
- q_vel_low = 1.0,
- q_vel_high = 0.95,
- has_imu = False)
+kDrivetrain = drivetrain.DrivetrainParams(
+ J=6.0,
+ mass=52,
+ robot_radius=0.59055 / 2.0,
+ wheel_radius=0.08255 / 2.0,
+ G=11.0 / 60.0,
+ q_pos_low=0.12,
+ q_pos_high=0.14,
+ q_vel_low=1.0,
+ q_vel_high=0.95,
+ has_imu=False)
def main(argv):
- argv = FLAGS(argv)
- glog.init()
+ argv = FLAGS(argv)
+ glog.init()
- if FLAGS.plot:
- drivetrain.PlotDrivetrainMotions(kDrivetrain)
- elif len(argv) != 5:
- print "Expected .h file name and .cc file name"
- else:
- # Write the generated constants out to a file.
- drivetrain.WriteDrivetrain(argv[1:3], argv[3:5], 'y2017', kDrivetrain)
+ if FLAGS.plot:
+ drivetrain.PlotDrivetrainMotions(kDrivetrain)
+ elif len(argv) != 5:
+ print "Expected .h file name and .cc file name"
+ else:
+ # Write the generated constants out to a file.
+ drivetrain.WriteDrivetrain(argv[1:3], argv[3:5], 'y2017', kDrivetrain)
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ sys.exit(main(sys.argv))