Problems connecting to UR5e robot

asked 2021-07-27 00:49:22 -0500

horvath.daniel gravatar image

updated 2021-07-27 06:28:05 -0500

Hello guys! I'm trying to connect to an e-series robot arm from Universal Robots using the ur_robot_driver. So far, I've installed the urcap for external control and I've setup the connection between my laptop and the robot. Everything seems fine, although I can't seem to find any URP programs in the robot to load and run so when I try to run any programs I run them from the "Program" tab from the small button with an arrow from the bottom of the screen, but I can't seem to get a "Robot ready to receive commands" message, so I'm stuck with:

[ INFO] [1627295507.279741482]: Robot requested program
[ INFO] [1627295507.279906055]: Sent program to robot

As I've said, I can't find the program for external control in the "Run" tab on the polyscope and I have tried before to reinstall the urcap, but to no avail. How can I overcome this problem? Is the robot already connected and I shouldn't be expecting the "Robot ready to receive commands" message? Also, here is a pastebin with the entire output from ROS: https://pastebin.com/Qukyuwaw

edit retag flag offensive close merge delete

Comments

In order to run programs from the "run" tab you'll have to create and save them using the "Program" tab first.

As you get the Robot requested program and Sent program to robot output, it seems that you have been successfully creating a program containing the External Control program node. However, directly following there should be the output Robot ready to receive commands, so there's definitely something going wrong.

You could try to save your generated program and have a look at the generated script code. See this post how to do that.

You can also make sure that there is no firewall disturbing the connection to the ReverseInterface part of the driver (by default running on port 50001). However, as the script sender port (50002) seems to be working correctly, I would not assume that this is the problem.

fexner gravatar image fexner  ( 2021-07-27 03:15:13 -0500 )edit

I've created a pastebin with the script data from my ExternalControl program from the robot: https://pastebin.com/dzZDkXdA

Also, I've placed the additional files such as .urp or .installation files in an archive, but I'm not sure which of the default.installation files corresponds to my program as there were more programs and scripts used on the same robot before: https://easyupload.io/qnwng4

The weird thing is that below where I'm supposed to load my program to run, on the "Run" page, it says "Status Stopped" and I don't understand how the program is stopped when I try to run it.

Every time I run the program the output on the terminal repeats as:

[ INFO] [1627295507.279741482]: Robot requested program
[ INFO] [1627295507.279906055]: Sent program to robot

But it never allows me further control.

horvath.daniel gravatar image horvath.daniel  ( 2021-07-27 05:55:52 -0500 )edit

Just to verify: Your ROS machine is reachable from the robot via the IP address 192.168.1.103? I assume, the answer is yes, as your robot's IP seems to be 192.168.1.101.

Is there something inside the log view on the teach pendant? In a "normal" execution is should state

ExternalControl: steptime=0.002
ExternalControl: External control active
ExternalControl: Starting servo thread

And finally (when you stop the ROS driver):

ExternalControl: Stopping communication and control
ExternalControl: servo thread ended
...

If I setup a firewall to block port 50001, I get Not able to open socket reverse_socket to host: <my.ip.address> at port 50001 : Connection timed out right after ExternalControl: steptime=0.002. In that case I only see the two lines as in the ROS side, as posted from you. Could you check whether you get similar log output on the panel and check ...(more)

fexner gravatar image fexner  ( 2021-07-27 08:10:52 -0500 )edit

I will check all of the above, but at the moment I can tell you that my firewall is inactive.

horvath.daniel gravatar image horvath.daniel  ( 2021-07-27 09:56:50 -0500 )edit

@fexner I've checked the logs in the "Log" tab on the teach pendant at the moment I ran the External control program on the robot and it said:

Polyscope Program ExternalControlROS starting...
RTMachine Program ExternalControlROS started
RTMachine Program ExternalControlROS stopped

So, for some reason, the program on the robot keeps shutting itself down every time I run it and I guess that is the main problem. Is it possible that another urcap is interfering with how this one should work? The other urcap installed is called OnRobot. Is it possible that these urcaps are incompatible?

I've also downloaded the log files from the robot and placed them here: https://files.fm/u/4hxgxrjp9

horvath.daniel gravatar image horvath.daniel  ( 2021-07-28 04:24:10 -0500 )edit

Uh, I missed that line when looking at your script file. But clearly, if you look at line 35, the OnRobot URCap stops the program by calling halt.


Edit: To add some explanation: Each installed URCap can contribute code to the preamble of each program being created / started on the robot. And this particular URCap seems to contribute the halt line. It might be that you can change the URCap's settings to prevent that.

fexner gravatar image fexner  ( 2021-07-28 04:55:13 -0500 )edit

Oh ok. Any idea how I could do that? Is it possible for me to delete that line on my ros machine in the script file and then replace the one from the robot with the changed one? @fexner

horvath.daniel gravatar image horvath.daniel  ( 2021-07-28 05:02:46 -0500 )edit

No, that can't be done. The ExternalControl URCap requests code from the ROS side and inserts that piece of code into the script. In your example program, that is line 43 until line 183. Anything outside of that is out of scope for the ROS driver.

fexner gravatar image fexner  ( 2021-07-28 05:36:41 -0500 )edit