def Shift3(): # 5 # Move All the Leg Backwards for i in range(1, PULLFRONT_Y): leg.goToXYZ(SPACING_X, Y2 - i, LEG_HEIGHT, leg.LEG_A) leg.goToXYZ(SPACING_X, Y3 - i, LEG_HEIGHT, leg.LEG_B) leg.goToXYZ(SPACING_X, -Y3 - i, LEG_HEIGHT, leg.LEG_C) leg.goToXYZ(SPACING_X, Y1 - i, LEG_HEIGHT, leg.LEG_D) time.sleep(PULLFRONT_DELAY)
def Step2(): # 3 readyStep2() # Pickup Leg D and Step Forward # Pickup leg.goToXYZ(SPACING_X, -Y2, PICKUP_Z, leg.LEG_D) time.sleep(ROTATION_DELAY) # Rotate To Location Above the Target Y leg.goToXYZ(SPACING_X, Y1, PICKUP_Z, leg.LEG_D) time.sleep(ROTATION_DELAY) # Drop off the Leg leg.goToXYZ(SPACING_X, Y1, LEG_HEIGHT, leg.LEG_D) time.sleep(ROTATION_DELAY)
def Step3(): # 4 # Pickup Leg A and Step Forward # Pickup leg.goToXYZ(SPACING_X, -Y1, PICKUP_Z, leg.LEG_A) time.sleep(ROTATION_DELAY) # Rotate To Location Above the Target Y leg.goToXYZ(SPACING_X, Y2, PICKUP_Z, leg.LEG_A) time.sleep(ROTATION_DELAY) # Drop off the Leg leg.goToXYZ(SPACING_X, Y2, LEG_HEIGHT, leg.LEG_A) time.sleep(ROTATION_DELAY) Shift3()
def Step1(): # 1 readyStep1() # Pickup Leg B and Step Forward # Pickup leg.goToXYZ(SPACING_X, -Y1, PICKUP_Z, leg.LEG_B) time.sleep(ROTATION_DELAY) # Rotate To Location Above the Target Y leg.goToXYZ(SPACING_X, Y3, PICKUP_Z, leg.LEG_B) time.sleep(ROTATION_DELAY) # Drop off the Leg leg.goToXYZ(SPACING_X, Y3, LEG_HEIGHT, leg.LEG_B) time.sleep(ROTATION_DELAY) Shift1()
import pablo as arm import time as e if __name__ == "__main__": arm.init() t = 0 while (1): while (t < 4): arm.goToXYZ(2, t, -8, 0) t += 0.5 print(t) input() while (t > 0): arm.goToXYZ(2, t, -8, 0) t -= 0.5 print(t) input()
def readyStep2(): # Ready For the Next Step leg.goToXYZ(SPACING_X, -Y1, LEG_HEIGHT, leg.LEG_A) leg.goToXYZ(SPACING_X, Y3, LEG_HEIGHT, leg.LEG_B) leg.goToXYZ(SPACING_X, -Y3, LEG_HEIGHT, leg.LEG_C) leg.goToXYZ(SPACING_X, -Y2, LEG_HEIGHT, leg.LEG_D)
def readyStep1(): # 7 ----->Home Position leg.goToXYZ(SPACING_X, Y3, LEG_HEIGHT, leg.LEG_A) leg.goToXYZ(SPACING_X, -Y1, LEG_HEIGHT, leg.LEG_B) leg.goToXYZ(SPACING_X, Y1, LEG_HEIGHT, leg.LEG_C) leg.goToXYZ(SPACING_X, -Y3, LEG_HEIGHT, leg.LEG_D)
def goToInitialPosition(): leg.goToXYZ(SPACING_X, Y3, LEG_HEIGHT, leg.LEG_A) leg.goToXYZ(SPACING_X, -Y1, LEG_HEIGHT, leg.LEG_B) leg.goToXYZ(SPACING_X, Y1, LEG_HEIGHT, leg.LEG_C) leg.goToXYZ(SPACING_X, -Y3, LEG_HEIGHT, leg.LEG_D)