예제 #1
0
while True:
	ret = driver.isReady()
	if ret[0] and ret[1]:
		successes += 1
	if successes > 10:
		print("Dobot ready!")
		break
	if i > 100:
		raise Exception('Comm problem')

gripper = 480
toolRotation = 0

print('Accelerometer data returned', driver.GetAccelerometers())

steps1 = driver.stepsToCmdVal(27)
steps2 = driver.stepsToCmdVal(3)
steps3 = driver.stepsToCmdVal(14)
driver.SetCounters(0, 0, 0)

print("Executing 20 commands with steps 27, -3, -14. Expecting GetCounters() to return:", 27*20, -3*20, -14*20)
errors = 0
for i in range(20):
	ret = (5, 0)
	while not ret[1]:
		ret = driver.Steps(steps1, steps2, steps3, 1, 0, 1, gripper, toolRotation)
		print("ret 0: ", ret[0], " | ret 1: ", ret[1])

time.sleep(3)
print(driver.GetCounters())
예제 #2
0
successes = 0

i = 0
while True:
    ret = driver.isReady()
    if ret[0] and ret[1]:
        successes += 1
        print(successes)
    if successes > 10:
        print("Dobot ready!")
        break
    if i > 100:
        raise Exception('Comm problem')

gripper = 480
toolRotation = 0


steps1 = driver.stepsToCmdVal(20)
steps2 = driver.stepsToCmdVal(0)
steps3 = driver.stepsToCmdVal(0)
driver.SetCounters(0, 0, 0)

print("Executing 20 commands with steps 27, -3, -14. Expecting GetCounters() to return:", 27 * 20, -3 * 20, -14 * 20)
errors = 0
for i in range(20):
    ret = (0, 0)
    while not ret[1]:
        ret = driver.Steps(steps1, steps2, steps3, 0, 0, 0, gripper, toolRotation)
print(driver.GetCounters())
# exit(0)
while True:
	ret = driver.isReady()
	if ret[0] and ret[1]:
		successes += 1
	if successes > 10:
		print("Dobot ready!")
		break
	if i > 100:
		raise Exception('Comm problem')

gripper = 480
toolRotation = 0

print('Accelerometer data returned', driver.GetAccelerometers())

steps1 = driver.stepsToCmdVal(27)
steps2 = driver.stepsToCmdVal(3)
steps3 = driver.stepsToCmdVal(14)
driver.SetCounters(0, 0, 0)

print("Executing 20 commands with steps 27, -3, -14. Expecting GetCounters() to return:", 27*20, -3*20, -14*20)
errors = 0
for i in range(20):
	ret = (0, 0)
	while not ret[1]:
		ret = driver.Steps(steps1, steps2, steps3, 1, 0, 1, gripper, toolRotation)

time.sleep(3)
print(driver.GetCounters())

# exit(0)