-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Code:
from urx import Robot
from time import sleep
from math import radians
import sys
rob = Robot("192.168.100.10")
base,shouder,elbow,wrist1,wrist2,wrist3,ja,jv = 68.95,-61.30,128.65,10.62,87.54,85.48,1.2,0.25 #Jointspace asetukset
x,y,z,rx,ry,rz,la,lv = 3.74,-323.51,-497.28,1.782,-2.389,0.227,1.4,1.05 #Toolspace asetukset
def DegToRad(degree): #Muunnetaan asteet radiaaneiksi jotta helpotetaan koodausta
return radians(degree)
def MilToM(mil): #Muunnetaan millimetri metreiksi
return mil / 1000
#print("Tässä on asteet radiaaneiksi",DegToRad(90))
#print("Tässä on millit metreiksi",MilToM(100))
rob.set_tcp((0, 0, 0.1, 0, 0, 0))
rob.set_payload(2, (0, 0, 0.1))
sleep(0.2) #leave some time to robot to process the setup commands
rob.movej((DegToRad(base), DegToRad(shouder), DegToRad(elbow), DegToRad(wrist1), DegToRad(wrist2), DegToRad(wrist3)), ja, jv,wait=True) #Jointspace
rob.movel((MilToM(x), MilToM(y), MilToM(z), rx, ry, rz), la, lv,wait=True) #Toolspace
print(rob.getj())
rob.close()
#rob.exit
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 68
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 1092
tried 11 times to find a packet in data, advertised packet size: -2, type: 3
Data length: 1420
Traceback (most recent call last):
File "c:\Users\OMISTAJA\OneDrive - Oulun ammattikorkeakoulu\Harjoittelu 2022 oamk\Koodit python\Demo_robotti.py", line 25, in
rob.movej((DegToRad(base), DegToRad(shouder), DegToRad(elbow), DegToRad(wrist1), DegToRad(wrist2), DegToRad(wrist3)), ja, jv,wait=True) #Jointspace
File "C:\Users\OMISTAJA\AppData\Roaming\Python\Python39\site-packages\urx\urrobot.py", line 277, in movej
self._wait_for_move(joints[:6], threshold=threshold, joints=True)
File "C:\Users\OMISTAJA\AppData\Roaming\Python\Python39\site-packages\urx\urrobot.py", line 217, in _wait_for_move
raise RobotException("Robot stopped")
urx.urrobot.RobotException: Robot stopped
When movel and movej wait=False it works normaly.