got the new drive code working
diff --git a/frc971/control_loops/python/drivetrain.py b/frc971/control_loops/python/drivetrain.py
index 27bebbc..c6a3f05 100755
--- a/frc971/control_loops/python/drivetrain.py
+++ b/frc971/control_loops/python/drivetrain.py
@@ -62,7 +62,7 @@
self.free_current = 2.7
# Moment of inertia of the drivetrain in kg m^2
# Just borrowed from last year.
- self.J = 6.4
+ self.J = 4.5
# Mass of the robot, in kg.
self.m = 68
# Radius of the robot, in meters (from last year).
diff --git a/frc971/control_loops/python/polydrivetrain.py b/frc971/control_loops/python/polydrivetrain.py
index da9d414..f28cf42 100755
--- a/frc971/control_loops/python/polydrivetrain.py
+++ b/frc971/control_loops/python/polydrivetrain.py
@@ -209,9 +209,9 @@
def SimShifter(self, gear, shifter_position):
if gear is VelocityDrivetrain.HIGH or gear is VelocityDrivetrain.SHIFTING_UP:
- shifter_position = min(shifter_position + 0.1, 1.0)
+ shifter_position = min(shifter_position + 0.5, 1.0)
else:
- shifter_position = max(shifter_position - 0.1, 0.0)
+ shifter_position = max(shifter_position - 0.5, 0.0)
if shifter_position == 1.0:
gear = VelocityDrivetrain.HIGH
@@ -441,11 +441,11 @@
for t in numpy.arange(0, 4.0, vdrivetrain.dt):
if t < 1.0:
- vdrivetrain.Update(throttle=0.60, steering=0.0)
+ vdrivetrain.Update(throttle=1.00, steering=0.0)
elif t < 1.2:
- vdrivetrain.Update(throttle=0.60, steering=0.0)
+ vdrivetrain.Update(throttle=1.00, steering=0.0)
else:
- vdrivetrain.Update(throttle=0.60, steering=0.0)
+ vdrivetrain.Update(throttle=1.00, steering=0.0)
t_plot.append(t)
vl_plot.append(vdrivetrain.X[0, 0])
vr_plot.append(vdrivetrain.X[1, 0])