Updated constants in control loop python files.
Although the shooter should have the correct constants and all, there are currently stability issues.
diff --git a/frc971/control_loops/python/polydrivetrain.py b/frc971/control_loops/python/polydrivetrain.py
index 5ffcff4..280db16 100755
--- a/frc971/control_loops/python/polydrivetrain.py
+++ b/frc971/control_loops/python/polydrivetrain.py
@@ -96,11 +96,10 @@
class VelocityDrivetrainModel(control_loop.ControlLoop):
- def __init__(self, left_low=True, right_low=True, name="VelocityDrivetrainModel", is_clutch=False):
+ def __init__(self, left_low=True, right_low=True, name="VelocityDrivetrainModel"):
super(VelocityDrivetrainModel, self).__init__(name)
self._drivetrain = drivetrain.Drivetrain(left_low=left_low,
- right_low=right_low,
- is_clutch=is_clutch)
+ right_low=right_low)
self.dt = 0.01
self.A_continuous = numpy.matrix(
[[self._drivetrain.A_continuous[1, 1], self._drivetrain.A_continuous[1, 3]],
@@ -138,13 +137,12 @@
SHIFTING_UP = 'up'
SHIFTING_DOWN = 'down'
- def __init__(self, is_clutch):
- prefix = 'Clutch' if is_clutch else 'Dog'
+ def __init__(self):
self.drivetrain_low_low = VelocityDrivetrainModel(
- left_low=True, right_low=True, name=prefix+'VelocityDrivetrainLowLow', is_clutch=is_clutch)
- self.drivetrain_low_high = VelocityDrivetrainModel(left_low=True, right_low=False, name=prefix+'VelocityDrivetrainLowHigh', is_clutch=is_clutch)
- self.drivetrain_high_low = VelocityDrivetrainModel(left_low=False, right_low=True, name = prefix+'VelocityDrivetrainHighLow', is_clutch=is_clutch)
- self.drivetrain_high_high = VelocityDrivetrainModel(left_low=False, right_low=False, name = prefix+'VelocityDrivetrainHighHigh', is_clutch=is_clutch)
+ left_low=True, right_low=True, name='VelocityDrivetrainLowLow')
+ self.drivetrain_low_high = VelocityDrivetrainModel(left_low=True, right_low=False, name='VelocityDrivetrainLowHigh')
+ self.drivetrain_high_low = VelocityDrivetrainModel(left_low=False, right_low=True, name = 'VelocityDrivetrainHighLow')
+ self.drivetrain_high_high = VelocityDrivetrainModel(left_low=False, right_low=False, name = 'VelocityDrivetrainHighHigh')
# X is [lvel, rvel]
self.X = numpy.matrix(
@@ -392,34 +390,22 @@
def main(argv):
- dog_vdrivetrain = VelocityDrivetrain(False)
- clutch_vdrivetrain = VelocityDrivetrain(True)
+ vdrivetrain = VelocityDrivetrain()
if len(argv) != 7:
print "Expected .h file name and .cc file name"
else:
dog_loop_writer = control_loop.ControlLoopWriter(
- "VDogDrivetrain", [dog_vdrivetrain.drivetrain_low_low,
- dog_vdrivetrain.drivetrain_low_high,
- dog_vdrivetrain.drivetrain_high_low,
- dog_vdrivetrain.drivetrain_high_high])
+ "VDogDrivetrain", [vdrivetrain.drivetrain_low_low,
+ vdrivetrain.drivetrain_low_high,
+ vdrivetrain.drivetrain_high_low,
+ vdrivetrain.drivetrain_high_high])
if argv[1][-3:] == '.cc':
dog_loop_writer.Write(argv[2], argv[1])
else:
dog_loop_writer.Write(argv[1], argv[2])
- clutch_loop_writer = control_loop.ControlLoopWriter(
- "VClutchDrivetrain", [clutch_vdrivetrain.drivetrain_low_low,
- clutch_vdrivetrain.drivetrain_low_high,
- clutch_vdrivetrain.drivetrain_high_low,
- clutch_vdrivetrain.drivetrain_high_high])
-
- if argv[3][-3:] == '.cc':
- clutch_loop_writer.Write(argv[4], argv[3])
- else:
- clutch_loop_writer.Write(argv[3], argv[4])
-
cim_writer = control_loop.ControlLoopWriter(
"CIM", [drivetrain.CIM()])