sintefmanufacturing / python-urx Goto Github PK
View Code? Open in Web Editor NEWPython library to control a robot from 'Universal Robots' http://www.universal-robots.com/
License: GNU Lesser General Public License v3.0
Python library to control a robot from 'Universal Robots' http://www.universal-robots.com/
License: GNU Lesser General Public License v3.0
Hello,
I am trying to get this working with our new UR5e running URSoftware 5.0.5.30612
Any ideas? I will keep digging into it too.
teal_robot_1@teal-robot-1-laptop:~/python-urx/examples$ python3 simple.py
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 68
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1092
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1444
robot tcp is at: [-0.1920632364955505, 0.015287737270173504, 0.9737677686073115, -2.0645150325986665, 0.38708977551397505, 1.2446845282632593]
absolute move in base coordinate
Traceback (most recent call last):
File "simple.py", line 20, in <module>
rob.movel(pose, acc=a, vel=v)
File "/home/teal_robot_1/.local/lib/python3.6/site-packages/urx/urrobot.py", line 284, in movel
return self.movex("movel", tpose, acc=acc, vel=vel, wait=wait, relative=relative, threshold=threshold)
File "/home/teal_robot_1/.local/lib/python3.6/site-packages/urx/robot.py", line 180, in movex
return self.set_pose(t, acc, vel, wait=wait, command=command, threshold=threshold)
File "/home/teal_robot_1/.local/lib/python3.6/site-packages/urx/robot.py", line 105, in set_pose
pose = URRobot.movex(self, command, t.pose_vector, acc=acc, vel=vel, wait=wait, threshold=threshold)
File "/home/teal_robot_1/.local/lib/python3.6/site-packages/urx/urrobot.py", line 316, in movex
self._wait_for_move(tpose[:6], threshold=threshold)
File "/home/teal_robot_1/.local/lib/python3.6/site-packages/urx/urrobot.py", line 217, in _wait_for_move
raise RobotException("Robot stopped")
urx.urrobot.RobotException: Robot stopped
teal_robot_1@teal-robot-1-laptop:~/python-urx/examples$
simple.py works fine on a UR10 that is running UR Software 3.4.4 but the Python script exits after the first motion command on a UR10 that is running 3.5.3, showing the following:
`Traceback (most recent call last):
File "./simple.py", line 22, in
rob.movel(pose, acc=a, vel=v)
File "/usr/local/lib/python2.7/dist-packages/urx/urrobot.py", line 284, in movel
return self.movex("movel", tpose, acc=acc, vel=vel, wait=wait, relative=relative, threshold=threshold)
File "/usr/local/lib/python2.7/dist-packages/urx/robot.py", line 180, in movex
return self.set_pose(t, acc, vel, wait=wait, command=command, threshold=threshold)
File "/usr/local/lib/python2.7/dist-packages/urx/robot.py", line 105, in set_pose
pose = URRobot.movex(self, command, t.pose_vector, acc=acc, vel=vel, wait=wait, threshold=threshold)
File "/usr/local/lib/python2.7/dist-packages/urx/urrobot.py", line 316, in movex
self._wait_for_move(tpose[:6], threshold=threshold)
File "/usr/local/lib/python2.7/dist-packages/urx/urrobot.py", line 217, in _wait_for_move
raise RobotException("Robot stopped")
urx.urrobot.RobotException: Robot stopped
`
Hello,
This simple program in the simulator always throws an urx.urrobot.RobotException: Robot stopped
exception. I am currently using URSoftware 3.72.40245 (Oct 05 2018), but it happened with my previous version (I think that it was 3.3)
rob = RobotClass()
ts = rob.start("10.0.0.207")
sleep(3)
rob.rob.movej((radians(90), radians(-70), radians(115), radians(-45), radians(90), radians(180)), acc=1, vel=1)
sleep(1)
rob.stop()
INFO:urx:Sending program: movej([1.570796,-1.22173,2.007129,-0.785398,1.570796,3.141593], a=1, v=1, r=0)
Traceback (most recent call last):
File "RobotClass.py", line 332, in <module>
test.rob.movej((radians(90), radians(-70), radians(115), radians(-45), radians(90), radians(180)), acc=1, vel=1)
File "/usr/local/lib/python3.7/site-packages/urx/urrobot.py", line 277, in movej
self._wait_for_move(joints[:6], threshold=threshold, joints=True)
File "/usr/local/lib/python3.7/site-packages/urx/urrobot.py", line 217, in _wait_for_move
raise RobotException("Robot stopped")
urx.urrobot.RobotException: Robot stopped
When calling the movejs
function in urrobot.py
, the code calls self.movexs
which references the movexs
function in robot.py
which does the following with the pose_list parameter:
new_poses = []
for pose in pose_list:
t = self.csys * m3d.Transform(pose)
pose = t.pose_vector
new_poses.append(pose)
The content of the pose_list being joint angles, this leads to unwanted behaviour of the last three joints.
Hi,
I want to try the speedj function by the following code:
import urx
import time ``if __name__ == '__main__':
rob = urx.Robot('192.168.1.103')
while True:
rob.speedj([0.2,0.3,0.1,0.05,0,0], 0.5, 0.5)
time.sleep(0.5)
rob.close()
However, the teach pad gives this error:
I have tried different t_min in the speedj but did not make any difference.
Is there any solution for this issue? Any suggestion would be grateful.
Hi, I'm new to UR,Below is my code.sometime it works,but sometime it doesn't work.and terminal always output "No handlers could be found for logger "ursecmon" ",how to fix it?
code:
import sys
import urx
from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
import time
if __name__ == '__main__':
rob = urx.Robot("192.168.0.5")
time.sleep(0.2)
try:
l = 0.1
v = 0.07
a = 0.1
r = 0.05
print rob.getl()
rob.movel((0.01,0,0,0,0,0),a,v,relative=True)
print rob.getl()
finally:
rob.close()
print "true"
sys.exit()
terminal
No handlers could be found for logger "ursecmon"
('Other: ', 0.9999559698671492)
('Other: ', 0.9999559698671492)
[-0.4806430498593199, 0.27958388855573424, 0.20536912110394498, -2.8349255747274125, -1.3087049374899002, -0.05021175565849725]
('Other: ', 0.9999559698671492)
('Other: ', 0.9999559698671492)
('Other: ', 0.9999559698671492)
true
I have tried to get urx working with the new e-series and have been able to read packets and robot joints, but am unable to send move commands. Has anyone gotten this working with the new e-series?
This is just opinion and I am unaware of the reason why you made this design choice.
Since the math3d is a dependency in the setup script does there need to be a safe guard against it not being installed for the Robot class, and by extension can't the Robot classes use of math3d transforms be directly done in the URRobot class?
I am trying to control cartesian velocity and do collision detection before executing. As for the code I can URScript commands. Is it integrated with collision detection and as far my understanding it doesn't do planning with this package just communicates the command to universal robot.
Trying to get started with this project but the the link as step 1 is broken and Robotiq don't seem to know anything about it.
Any chance someone can send it to us OR know where else it may be found
|
| You must install the driver first and then power on the gripper from the
| gripper UI. The driver can be found here:
|
| http://support.robotiq.com/pages/viewpage.action?pageId=5963876
|
| FAQ
Further, there's another fork of the project here, which is best maintained now?
https://github.com/poproulx/python-urx/blob/master/urx/robotiq_two_finger_gripper.py
Whenever I execute a blocking command (e.g. Robot.translate
), the library throws a RobotException
, claiming the robot stopped.
The command, however, gets executed just fine (the robot moves to the right position).
>>> rob.translate((0.1, -0.1, 0), 0.7, 0.9)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\urx\urrobot.py", line 432, in translate
return self.movex(command, p, vel=vel, acc=acc, wait=wait)
File "C:\Python27\lib\site-packages\urx\robot.py", line 174, in movex
return self.set_pose(t, acc, vel, wait=wait, command=command, threshold=threshold)
File "C:\Python27\lib\site-packages\urx\robot.py", line 105, in set_pose
pose = URRobot.movex(self, command, t.pose_vector, acc=acc, vel=vel, wait=wait, threshold=threshold)
File "C:\Python27\lib\site-packages\urx\urrobot.py", line 322, in movex
self._wait_for_move(tpose[:6], threshold=threshold)
File "C:\Python27\lib\site-packages\urx\urrobot.py", line 211, in _wait_for_move
raise RobotException("Robot stopped")
urx.urrobot.RobotException: Robot stopped
Can we add *.pyc to the .gitignore file? The files generated in the urx folder by setup.py create a bit of a headache in git (especially when using the repository as a submodule). Thanks!
hi everyone.
i have an UR10 CB1.8 / 2.1 and i need to send long codes line by line.
i want to use this library written by @oroulet (https://github.com/oroulet).
someone can help me to understand how to modify and adapt it?
thanks a lot
Francesco
In the file urrobot.py the function set_payload (line 121) need to have '[' instead of '('
Before
if cog:
cog = list(cog)
cog.insert(0, weight)
prog = "set_payload({}, ({},{},{}))".format(*cog)
After
if cog:
cog = list(cog)
cog.insert(0, weight)
prog = "set_payload({}, [{},{},{}])".format(*cog)
I need to move it in a trajectory and have it not slow down every-time it reached a point. Is there a way to set a final velocity at a point?
Thanks
Hi
I encountered the following error on executing the get_robot.py
robot.close()
NameError: name 'robot' is not defined
Here is the code:
import urx
from IPython import embed
import logging
if name == "main":
try:
logging.basicConfig(level=logging.INFO)
#robot = urx.Robot("192.168.1.6")
robot = urx.Robot("192.168.1.100")
#robot = urx.Robot("localhost")
r = robot
print("Robot object is available as robot or r")
embed()
finally:
robot.close()
Any leads are highly appreciated
Thanks
Hi, I and my friends are working on a project with your bibliothek. Our robot is UR3 with OnRobot RG2 Gripper. We want to move the robot's arm to some pose (coordinate), but the movep function is not working and movep function's def is not the same with UR Script. For Example, even your example code fails. :( I think still this bibliothek is being developed by you. When this bibliothek will be done? Or can you help us this problem?
Hello all,
I am running URX to control a mix of UR10s and UR5s, and so far it has been easy and to interface with to control the robots.
The movejs and movel commands work as expected and I can control the digital outs. I am now trying to read an analogIn from the robot, that I can clearly see on the pendant changing as expected from the sensor, but when I use rob.get_analog_in(0, wait = False)
....I am getting wonky numbers. Is it the robot's firmware? I saw in another issue someone mentioned it could be because the firmware someone was running was too new. Would rolling back solve this issue?
I checked the secmon.get_all_data()....it's showing the same wonky number that I get when I try and use get_analog_in...
If it is an issue with the with firmware version I am running, can you confirm which versions work for the UR10 and UR5?
Or maybe there's a work around? Other than this hiccup, this library is fantastic!
Thanks!
Hi,
I am trying to read the digital output from a UR5e (running 5.1.1.40229). The get_digital_returns always 0 even if the output is 1.
Did anybody tried with the e series so far?
Thanks in advance!
Hello,
First, let me thank you for this python UR wrapper it is honestly a blessing given how easy it is to program in Python !
I recently got a UR3 arm and before asking I tested this wrapper with my arm. The get_robot.py example seems to work and when I print the robot object I get this :
Robot object is available as robot or r Robot Object (IP=192.168.0.149, state={'isSecurityStopped': False, 'speedScaling': 1.0, 'isProgramPaused': True, 'timestamp': 2766576000, 'isRealRobotEnabled': True, 'isRobotConnected': True, 'robotMode': 7, 'isProgramRunning': False, 'isPowerOnRobot': True, 'isEmergencyStopped': False, 'speedFraction': 1.0, 'type': 0, 'controlMode': 0, 'size': 46}) INFO:urx:Closing sockets to robot
As specified in the title of this "issue" I am using a UR3 arm with Polyscope 3.3.3.292. Testing other examples like test_all.py moves the arm but I get a urx.urrobot.RobotException: Robot stopped
on the python script and on the UR itself I get a C153A2: Protective stop : position deviates from path : Elbow
.
The question here is : is this wrapper compatible with an UR3 or with Polyscope 3.3.3.292 (release October 2016). If yes, is there something I am doing wrong ? I also tried the urxui no problem to connect but always failing to control.
I looked a bit for this question before asking, if the answer is already somewhere here I really apologize for that.
Thanks.
I'd like to use the object detection feature of the Robotiq Gripper from python script.
When the gripper grasps some object, I want to get the OBJ value (and POS).
I executed bellow script, but the last POS and OBJ are both the values when the gripper was fully close despite grasping object.
UR5 + Robotiq 2F-85
import socket
import time
import urx
from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
rob = urx.Robot("192.168.0.100")
robotiqgrip = Robotiq_Two_Finger_Gripper(rob)
PORT = 63352
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.0.100", PORT))
s.send(b"socket_send_string("GET POS", "gripper_socket")")
data = s.recv(1024)
print(data)
robotiqgrip.open_gripper()
time.sleep(2.)
s.send(b"socket_send_string("GET POS", "gripper_socket")")
data = s.recv(1024)
print(data)
robotiqgrip.close_gripper()
time.sleep(2.)
s.send(b"socket_send_string("GET POS", "gripper_socket"")
data = s.recv(1024)
print(data)
s.send(b"socket_send_string("GET OBJ", "gripper_socket")")
data = s.recv(1024)
print(data)
Thank you for your help.
Currently, math3d is a hard-dependency for the library, as it is imported without a check in urrtmon.py, which - in turn - is imported by urrobot.
hey,
I try to run the following code:
`from math import pi
import urx
import logging
if __name__ == "__main__":
rob = urx.Robot("192.168.1.113")
#rob = urx.Robot("localhost")
rob.set_tcp((0,0,0,0,0,0))
rob.set_payload(0.5, (0,0,0))
try:
l = 0.05
v = 0.05
a = 0.3
j = rob.getj()
print("Initial joint configuration is ", j)
t = rob.get_pose()
print("Transformation from base to tcp is: ", t)
print("Translating in x")
rob.translate((l, 0, 0), acc=a, vel=v)
pose = rob.getl()
print("robot tcp is at: ", pose)
print("moving in z")
pose[2] += l
rob.movel(pose, acc=a, vel=v)
print("Translate in -x and rotate")
t.orient.rotate_zb(pi/4)
t.pos[0] -= l
rob.set_pose(t, vel=v, acc=a)
print("Sending robot back to original position")
rob.movej(j, acc=0.8, vel=0.2)
finally:
rob.close()`
it moves one time the robot but than i receive the following errors:
>
> tried 11 times to find a packet in data, advertised packet size: -2, type: 3
> Data length: 44
> 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: 1419
> File "/home/arl_ubuntu/PycharmProjects/Yasmin_new/venv/lib/python3.5/site-packages/urx/urrobot.py", line 217, in _wait_for_move
> raise RobotException("Robot stopped")
> urx.urrobot.RobotException: Robot stopped
> `
I am able to manipulate robot using movel, movej commands via urx.send_message
Example.
robo = urx.Robot("IP of the robot")
robo.send_message("movej([0,-1.5707,1.5707,0,0,0],a = 0.05,v = 0.05)")
Likewise, i am interested in knowing the values of get_actual_tcp_pose(), get_inverse_kin() etc through urx. Can someone help me on this
Hello! I have been using URX for a while and it is really great code. I really appreciate the clean interface to the robot, as opposed to some other wrappers interacting with universal robots.
I was wondering if it is possible to continuously servo the robot to a pose using URX. I have tried sending a sequence of movel commands using urx, but it seems that the rate is limited by how long it takes to upload the program to the robot. Is there a better way of commanding the robot at say, 50-100Hz? I have an application where I would like to have the robot follow the pose of a Razer Hydra, and with the method I mentioned above I seem to only get about 4Hz communication rate to the robot. I would not be surprised if I am doing it wrong, but I figured I would ask.
I have seen other (bad) implementations that load a program to the robot and communicate with that program over a socket to rapidly send a sequence of movel commands, but it seems that URX was written in sort of a one-program-per-command paradigm (which I like and which makes sense for discrete commands).
If there is no way to do this with the current implementation, I would be happy to contribute this feature, I just wanted to make sure that I wasn't missing something first.
Thanks for the help and the great software!
Cheers,
Kel
Hi all,
The following is my test code
import urx
import logging
if __name__ == "__main__":
logging.basicConfig(level=logging.WARN)
rob = urx.Robot("192.168.50.50")
#rob = urx.Robot("localhost")
while True:
try:
pose = rob.get_pose()
print(pose)
print("============================")
finally:
rob.close()
I found that the pose is fixed all time eventhough I changed the position of the tcp.
How do I get the realtime position data of the tcp?
thanks!!
Is this library compatible with polyscope version 3.9.1 running on a UR3/CB3? When I run the urx.Robot('{ROBOT_IP}')
, I get a timeout error saying it did not receive valid data packet. I can ping the robot IP successfully though so the connection itself is fine.
Hi,
I'm now using this driver to control UR3, and I also need joint speed data. The joint position data can get fromget_joint_data
function in ursecmon.py
, but seems there is no method to get the joint velocity. Could anyone help with this?
Thanks
First of all, please let me know if this is not the proper forum for my problem (and where I might go instead). This is in regards to a UR 10 running 3.5.3.10825. For the script urx_get_robot.py
import urx
import logging
if __name__ == "__main__":
try:
logging.basicConfig(level=logging.INFO)
robot = urx.Robot("192.168.1.106")
finally:
robot.close()
When I run the command python3 urx_get_robot.py, here is what I get.
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 68
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1092
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1418
INFO:ursecmon:Remove 79 bytes of garbage at begining of packet
INFO:urx:Closing sockets to robot
It's unknown to me whether this is a problem with the robot version and urx or if the UR 10 is behaving abnormally, because when I run the following script
import socket
HOST = "192.168.1.106" # The remote host
PORT = 30002 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
for i in range(2):
data = s.recv(32768)
print ("Received", data)
s.close()
This is what prints:
Received b'\x00\x00\x007\x14\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x03\tURControl\x03\x05\x00\x00\x00\x03\x00\x00\x00\x0015-02-2018, 13:17:59\x00\x00\x00\x18\x14\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x0c\x00\x00w$\x00\x00w$\x01'
Received b"\x00\x00\x05F\x10\x00\x00\x00/\x00\x00\x00\x00\x00]\xdbX\x00\x01\x01\x01\x00\x00\x00\x00\x07\x00?\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfb\x01\xc0\x07\x89e\x88\x88Z0\xc0\x07\x89r\x08\x88Z0\x00\x00\x00\x00\x00\x00\x00\x00\xbeR\xf0\x01B@/\x1bA\xd7\xeb\x81A\xde\x9e'\xfd\xc0\x00xWh\x88Z0\xc0\x00xc\xe8\x88Z0\x00\x00\x00\x00\x00\x00\x00\x00@\xa2\x99\x01B@\x00\x00A\xe2\xcc\xc8A\xf6\xbd\xb3\xfd\xbf\xf9\xd2\xecQ\x10\xb4`\xbf\xf9\xd3\x11\xd1\x10\xb4`\x80\x00\x00\x00\x00\x00\x00\x00@K\x97\x9fBA\x85\x1fA\xea\x14vA\xfb\x14\xdd\xfd\xc0\x04\xff'\xe8\x88Z0\xc0\x04\xff'\xe8\x88Z0\x00\x00\x00\x00\x00\x00\x00\x00=\xd3P\x01B@]/A\xecz\xddB\x13\xf9I\xfd\xbf\xf43\xb6Q\x10\xb4`\xbf\xf43\xdb\xd1\x10\xb4`\x00\x00\x00\x00\x00\x00\x00\x00<\xee\xe0\x02B@|\xeeB\x04\n9B\x08\x12B\xfd\xbf\xf9[#\xd1\x10\xb4`\xbf\xf9[=Q\x10\xb4`\x00\x00\x00\x00\x00\x00\x00\x00>\x1e|\x01B@|\xeeB\x02O\xcfB\x14\xf3\xe1\xfd\x00\x00\x00e\x04\xbf\xecW9\xf6v8~?\x86E\xben\xda\x1d\xcf?\xd0\xb5\x01\x13\xf0\xdd\x9a\xc0\x01r\xf8\xc5\xdf\xe30?\xbb\xe0\x81\x1c\xd0=.@\x01)\x90m\ni\xdc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe1\x05l\xe9\xb4/\xac(\xcf\x8b\x8b\x06\xfewZ\xee\x8f\x80\xab\xa6\r\x05\x96\x94]w?+\xdetTHF)\xbf\xcf\x91\xe94i$\x17?\xd2\x95\xf0\xc7\x04\xe8f\xbf\xa6:\x9fBx7\x9b\xbf9\xb66k\xf0\x19\xd2\xbfG\x1c\x80\xb58>K?\x01E,o7#\x19\xbf\xe3\x00$r\x96\xbc\xb0\xbf\xe2A\x05\xca\xf2Ps?\x05\xcf\xe3\x81\x92^\xbc\xbe\xea\x12\x1cX\xca^\xe7\x00\x00\x00\x00\x00\x00\x00\x00?\xc0f\xabF\xba\xab,@68\xe3%\x06l\xbf\xc08\xf3\x0f\xa6\x14\x87\xdf@\x07\x1f\xde*\xa2b3?\xbd\x9a\xdb\xa4\\\xaez?\xb7\x98\x92\x06\xcd,\xc1?\xf9!\x81\tW\xbfd\xbf{\x94\xb1\xdb\xc5\x7fp\xbf\x82yTQk\x119?\xf9 \xa3\xb7-\xdd\xe7\xbf\xf9$\xafS\xac\xb9\x9a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x005\t@\nC\x04\xe3\xe50\x19\xbf\xf0ZE\x81R\xb3a\xc0\x0e\xf4'\xe1N\x07b\xbf\xe8\x01/\xef\x00v?\xbf\xd7\xfb\xe9:\x88\xf3\xd1\xc0\x00\x0fi\x90'}[\x00\x00\x00J\x03\x00\x00\x00\x00\x00\x00\x00\x04\x01\x01?p\x7f\xc0\x00\x00\x00\x00?p\x7f\xc0\x00\x00\x00\x00\x00\x00?pbM\xe0\x00\x00\x00?pbM\xe0\x00\x00\x00A\xfc \x00BA~>?\x80UD>\\\x82\xd3\x01\x00\x00\xc2D[d\x00\x00\x00\x00\x00%\x02\x01\x01?\xa7\x1b\xfd@\x00\x00\x00?\xa6\xa1\x96\xe0\x00\x00\x00C\xe5[2\x00\x00\x00\x00\x00B@\x00\x00\xfd\x00\x00\x01\xbd\x06\xc0\x19W\x99(,/c@\x19W\x99(,/c\xc0\x19W\x99(,/c@\x19W\x99(,/c\xc0\x19W\x99(,/c@\x19W\x99(,/c\xc0\x19W\x99(,/c@\x19W\x99(,/c\xc0\x19W\x99(,/c@\x19W\x99(,/c\xc0\x19W\x99(,/c@\x19W\x99(,/c@\x02Z\xeb\xd1\xc7\x0c\xff@D\x00\x00\x00\x00\x00\x00@\x02Z\xeb\xd1\xc7\x0c\xff@D\x00\x00\x00\x00\x00\x00@\n\xbb\x94\xed\xdd\xc6\xb1@D\x00\x00\x00\x00\x00\x00@\n\xbb\x94\xed\xdd\xc6\xb1@D\x00\x00\x00\x00\x00\x00@\n\xbb\x94\xed\xdd\xc6\xb1@D\x00\x00\x00\x00\x00\x00@\n\xbb\x94\xed\xdd\xc6\xb1@D\x00\x00\x00\x00\x00\x00?\xf0\xc1R8-se?\xf6W\x18J\xe7D\x87?\xd0\x00\x00\x00\x00\x00\x00?\xf3333333?\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbf\xe3\x95\x81\x06$\xdd/\xbf\xe2PH\x16\xf0\x06\x8e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xc0K]\xccc\xf1A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xc4\xfc\x04\xc8\xbc\x9c\xd4?\xbd\x9e\x83\xe4%\xae\xe6?\xb7\x9akP\xb0\xf2|?\xf9!\xfbTREP\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xf9!\xfbTREP\xbf\xf9!\xfbTREP\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00=\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xb1B\x92\x7fK\xe2\xea\x00\x00\x00\x08\x08\x00\x01\x00\x00\x00\x00+\n\xc2D[d\x00\x00\xbf\xd1\xff\xb4W\xae\x12[\xbf\xad\x1d5^\xed\xcae?\xe5_7\x1ff\x17\xd1\x00\x00\x00\x00\x00\x00\x00\x00"
No matter how many times the loop repeats there are always similar characters printed. Should the robot be continually sending data like that? Any help you can give would be so so appreciated.
Edit 1: From what I've read, it seems the robot is behaving normally by continually writing data to port 30002. The problem is that, after the warnings from ursecmon above, my urx script hangs at, for example, print("Current tool pose is: " + rob.getl())
Edit 2: The problem persists after updating the robot to 3.9.
I'm having problems finding out whether the gripper that is attached to the robot is open or closed.
I figured I could check rob.get_digital_out(8, wait=True)
to find out if the digital out 8 (tool out 1) is on or off.
However, that doesn't seem to work:
>>> rob.get_digital_out(8, wait=True)
0
>>> rob.get_digital_out(8, wait=True)
0
It returns 0 in both cases, although Polyscope shows that the output is on when the gripper is closed.
I checked that that's the correct output by using it to open/close the gripper with python-urx
(which works great!).
How about releasing a new version to PyPI?
The the changes to make urx compatible with UR software version 3.5+ are not in version 0.11.0 on PyPI.
UR software version 3.8 was recently released and the current state of the urx repo works fine with 3.8 as well.
In urrobot.py the movex-helper-function movex sets a radius: (l 307)
prog = self._format_move(command, tpose, acc, vel, prefix="p", radius=0.02)
This stops the execution (the UR is probably waiting for the next pose to blend. Only f I remove the radius, functions like back do work.
Thanks for working on this library, it makes programming my UR5 much easier.
I'm having an issue when I try use the movel()
command. I get a dialog showing up on my teach pendant:
Security Stopped
SECURITY CHECK: Position change too large
I can move the robot without issue using movej
. I tried setting a pose that was 1-2mm away from its current location, and it still displays the same error.
I tried running /examples/simple.py
, and I get the same error.
I've got an older CB2 model with PolyScope and URControl 1.8.23117.
Any ideas?
Hello,
Just a note that I was having timeout issues and lost connections with my UR5 (not sure if the same one that you point in your 55ccfe7 commit).
I have been using @martinbjerge 's branch and have not had those issues yet. I have not done an extensive testing, but they should have appeared already.
I don't know if those issues are widespread or only I had them. If they are common, maybe you can get a solution from his fork.
Very useful package! Thanks!
When I use RobotiqScript._get_gripper_status(), there is an error "TypeError: _socket_send_string() takes exactly 3 arguments (2 given)".
I have no idea what is the message I should give in the function _socket_send_string(self, message, socket_name), which is inside the function_rq_get_var(self, var_name, nbytes).
Please help me.
It seems that any commands to the robot (via send_program
) can only be sent at 10Hz.
I have spoken at length with the support team at Universal Robot, and they tell me that commands can be sent to the secondary interface at 30002 at near 125Hz. I am not sure what rate the robot broadcasts its information over 30002. I will ask them tomorrow morning.
I looked fairly deep into the code, and it looks like you are using a blocking socket.recv
call. I tried setting the timeout of the socket to .01 seconds, but this causes several problems with other functions timing out. Would it make sense to have a shorter timeout, and have handling for when the socket doesn't receive anything? That would then allow commands to be sent to the robot faster than 10Hz, because the socket wouldn't be blocking and thus restricting the command rate.
Conversely, would it be easier to put the command code (`send_program') on a different client that the receive code, so that you don't have to mess around with that code?
This is related to Ticket #1, because (also from UR support) the best way to send smooth continuous commands to the robot is via speedl
, because it is the only command that does not impose a velocity profile, which causes sequences of other commands (such as movel
) to be jittery (as the robot is repeatidly command zero velocity in between commands).
I have written a PID velocity controller which can do this, but it requires fast (~100Hz) commands to the robot, as well as equivelently fast updates from the robot about its current pose. I will continue to discuss this with the UR support team.
I am happy to try and resolve this issue, I would just like to know what your design decisions were.
Cheers,
Kel
Environment:
UR5 + Robotiq 2-Finger Gripper Version 85
(Polyscope 3.7)
I tried to execute bellow script.
import sys
import urx
from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
rob = urx.Robot("192.168.0.100")
robotiqgrip = Robotiq_Two_Finger_Gripper(rob)
robotiqgrip.close_gripper()
rob.close()
The robot's finger once opened, and closed after that.
My ideal action is to close its finger from the current position.
How can I make a robot work like that?
Thank you.
I tried to add a function that could use to activate force mode of UR, but the UR force mode cannot be activated by using send_program() to send the command.
prog = "def myProg():\n\tforce_mode(tool_pose(), [{},{},{},{},{},{}], [{},{},{},{},{},{}], {}, [{},{},{},{},{},{}])\nend".format(*tpose)
self.send_program(prog)
I also tried with
prog = "force_mode(tool_pose(), [{},{},{},{},{},{}], [{},{},{},{},{},{}], {}, [{},{},{},{},{},{}])".format(*tpose)
self.send_program(prog)
too. It doesn't work neither.
Hey!
Thanks a lot for making the interface commercially usable by changing the license to LGPL. Math3d (GPL) is however needed, even for basic functions like get_pose. Is there a plan to improve the LGPL-parts?
HI,
I used movexs and make the " joint position list",
but I want to change "joint position list" to the "pose list"
So how to still move by movej and use "pose list" to reaches a point?
thanks.
Hi, I'm working with a UR5, trying to put it into freedrive mode. URRobot.set_freedrive(True) does not seem to be working. Reading the urx code it looks like it's sending set robotmode freedrive
, however in reading the v3.2 of the URScript Programming Language guide, I don't see any mention of a robotmode
command. Am I missing something?
(Note: I'm new to this so my apologies if I'm overlooking something obvious.)
Cc: @markwsilliman
When I was receiving data of tcp_force, I found that data would stop update after around 30 second.
import urx
import time
rob = urx.Robot("192.168.50.60")
rob.set_tcp((0, 0, 0.1, 0, 0, 0))
rob.set_payload(2, (0, 0, 0.1))
time.sleep(0.2)
a= rob.get_realtime_monitor()
while 1:
print a.tcf_force()
time.sleep(0.001)
Hi,
Since urx 0.10.0 in PiPI, many useful changes have been added. Now some APIs are incompatible.
Could you release 0.11.0?
If issues remain for release, I would like to support.
Thanks,
Hi all,
I'm trying to use urx on ur5e.
After connected to ur5e, I can get pose info with get_pose(), but I got error when make a movement.
Heres' the log when using test_all.py.
(base) C:\Users\flyma\Workspace\python-urx\examples>python test_all.py
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 68
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1092
WARNING:ursecmon:tried 11 times to find a packet in data, advertised packet size: -2, type: 3
WARNING:ursecmon:Data length: 1452
INFO:ursecmon:Remove 79 bytes of garbage at begining of packet
INFO:urx:Sending program: set_tcp(p[0, 0, 0, 0, 0, 0])
INFO:urx:Sending program: set_payload(0.5, (0,0,0))
Digital out 0 and 1 are: 0 0
Analog inputs are: (-0.0, -0.0)
Initial joint configuration is [0.6105999946594238, -1.6691738567748011, -1.823420524597168, -1.0123685163310547, 1.2770352363586426, -0.3833544890033167]
Other: 0.9999649302353388
Transformation from base to tcp is: <Transform:
<Orientation:
array([[ 0.76535692, -0.55404422, 0.32751151],
[-0.54811748, -0.82781846, -0.11951497],
[ 0.33733666, -0.08804317, -0.9372579 ]])>
<Vector: (0.52478, 0.17089, 0.37743)>
>
Translating in x
Click enter to continue
Other: 0.999965036514653
Other: 0.999965036514653
Other: 0.9999650365146528
Other: 0.9999650365146528
INFO:urx:Sending program: movel(p[0.574788,0.170909,0.377446,2.93583,-0.916521,0.552896], a=0.3, v=0.05, r=0)
INFO:urx:Closing sockets to robot
Traceback (most recent call last):
File "test_all.py", line 45, in <module>
rob.translate((l, 0, 0), acc=a, vel=v)
File "C:\Users\flyma\Anaconda3\lib\site-packages\urx\urrobot.py", line 477, in translate
return self.movex(command, p, vel=vel, acc=acc, wait=wait)
File "C:\Users\flyma\Anaconda3\lib\site-packages\urx\robot.py", line 180, in movex
return self.set_pose(t, acc, vel, wait=wait, command=command, threshold=threshold)
File "C:\Users\flyma\Anaconda3\lib\site-packages\urx\robot.py", line 105, in set_pose
pose = URRobot.movex(self, command, t.pose_vector, acc=acc, vel=vel, wait=wait, threshold=threshold)
File "C:\Users\flyma\Anaconda3\lib\site-packages\urx\urrobot.py", line 318, in movex
self._wait_for_move(tpose[:6], threshold=threshold)
File "C:\Users\flyma\Anaconda3\lib\site-packages\urx\urrobot.py", line 228, in _wait_for_move
raise RobotException("Goal not reached but no program has been running for {} seconds. dist is {}, threshold is {}, target is {}, current pose is {}".format(timeout, dist, threshold, target, URRobot.getl(self)))
urx.urrobot.RobotException: Goal not reached but no program has been running for 5 seconds. dist is 0.05000164173087566, threshold is 0.04000117092575268, target is [ 0.57478806 0.17090917 0.37744602 2.9358298 -0.91652062 0.55289619], current pose is [0.5247864573384649, 0.1708926988697655, 0.37746655271448765, 2.9358392252682255, -0.9165734334429806, 0.5529469145878091]
What should I do?
just found this below in example code, is it possible to get a message to know whether the robot has successfully moved to the defined position, because the robot move sometimes 2s and sometimes 6s, but i don't want the robot always wait for a long time.
print("Waiting 2s for end move")
time.sleep(2)
Thanks a lot!
This error appears on the teach pendant. Is there a way to blend movej commands?
Deal all,
I come up with an issue that when I tried to connect python to real robot, I checked the status if robot is running and I got 'False'. But I ping to robot and found that it is connected. I run the program and found that the robot sent status that is not connected so my program is not working.
Did I miss something or do anything wrong. Please clarify me. Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.