So, gripperOpen takes 0 or 2, then translates those to 1 or 3, then passes the translated value and 200 (arrived at by a series of convoluted translations) to self.gripperSetAngle, which is:
def gripperSetAngle(self, arm, angle, ramp=default_servo_ramp):
response = self.runCommand("servo {channel} {ramp} {angle}".format(channel=grippers[arm], ramp=ramp, angle=angle))
sleep(servo_delay) # wait here for servo to reach angle
return response.get('result', False)
This function takes the already translated arm value and then attempts to translate it again in the same way, which obviously fails with a KeyError.
In my opinion, this process is incredibly obtuse and needlessly complicated. I could fix this myself, but it really desperately just needs to be refactored completely, which I wouldn't want to do to someone else's package.
When Planner.py calls
in pickUpBlock, it passes an armId of 0 or 2. The function in comm is:
The relevant globals are:
So, gripperOpen takes 0 or 2, then translates those to 1 or 3, then passes the translated value and 200 (arrived at by a series of convoluted translations) to self.gripperSetAngle, which is:
This function takes the already translated arm value and then attempts to translate it again in the same way, which obviously fails with a KeyError.
In my opinion, this process is incredibly obtuse and needlessly complicated. I could fix this myself, but it really desperately just needs to be refactored completely, which I wouldn't want to do to someone else's package.