Universal Robots Forum

URSIm with ROS package ur_robot_driver

I am trying to develop an application to control the UR using ROS. I am in the process of purchasing the manipulator but want to validate the functionality before I get an access to the hardware. To replicate the workflow I am using the following

  • URSim simulator for e series robot, running on Virtual Machine

  • Linux machine with Ubuntu 18.04, ROS melodic and ur_robot_driver ROS package

I have followed all the steps mentioned here to configure the simulator to connect with ROS driver. I am able to connect to the simulator via ROS, however soon after connecting to the simulator using ROS, the following error appears (continuously) on the terminal.

  • [ERROR] Could not get fresh data package from robot

And as the error suggest, there is not data coming from the simulator (I don’t see anything if I echo any of the ROS topics like /joint_states).

I referred few discussions in the forum regarding the similar error and it seems people have faced this error due to high latency between ROS computer and hardware, or due to heavy load on the ROS computer.

It will be really great if someone can provide a workaround which allows me to test the functionality I am developing using URSim and ROS. I can afford a bad / discontinuous movement of the robot as it is just for verification. I just need a workaround which prevents the communication drop between ROS and URSim.

I’ve seen this happening when developing with URSim from time to time, but not constantly. However, if this isn’t happening too much (if you only get one line of this and not a wall of those errors) the driver should be keeping the connection.

The error is persistent in my case. Basically, I am not receiving any data at ROS driver. I don’t get anything if I echo any of the topics.

Can you please share the system configuration / setup you used ? Like a VM for the simulator and a host computer with Ubuntu for ROS or you installed the linux version of URSim in the host computer itself ? Also did you modify any parameters like keepalive timeout etc in the files provided by UR ?

Hi @dparikh,

If it is due to performance issue you can try to modify starturcontrol.sh

SCRIPT_DIR=$(dirname $(readlink -f $0))
HOME=$SCRIPT_DIR $SCRIPT_DIR/URControl -d 2000 -r &>$SCRIPT_DIR/URControl.log &

defualt value for -d|--sim-cycle-period Sets the cycle time used for simulation. is 2000us for the e-Series if you increase the number you will lower the load, but also slow down robot execution time/movement.

Hope it helps you for the verification.

That’s a nice addition, thanks @ebbe! I am, however, unsure what kind of implications for the ROS driver follow by that. Without modifications, it expects to get data packages by the robot with 500Hz in case of an e-Series.

So, I would expect to get the [ERROR] Could not get fresh data package from robot always in that case. This is basically setup here inside the ur_client_library.

Thank you for the suggestions @mauch and @Ebbe. I am able to establish a reliable connection now by installing the Linux version of URSim in Ubuntu 18.04 and UR ROS drivers in the same Linux host computer. Hence, we can safely ascribe this issue to the use of VM.

However the install script for URSim is strange in a way that it actually removes lot of ROS packages from the Ubuntu. So I had to install the ROS and also redo the UR ROS driver installation process. I understand the JDK dependency but I am not able to completely understand a need to remove packages while installing a simulator.

It will be really great if UR can somehow improve the install script of the UR simulator so that it does not break the existing ROS installation.