Unable to control I/O states on UR10 (python) [closed]

asked 2020-01-16 10:05:54 -0600

SSar gravatar image

Hi. I'm working on a project where I need to pick up objects using a Universal Robots UR10 robot and a vacuum gripper. So far I am seeing positive results in executing move commands using movegroup python interface. I am, however, experiencing some problems in controlling digital output states using my script. I am using universal_robots package and the official Universal Robots ROS Driver.

Here's my import list:

import sys
import copy
import rospy
import tf2_ros
import tf
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
#from math import pi
import math
from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list
from ur_msgs.msg import SetIO

My function which I'm calling in the main function:

  def apply_vacuum(self):
        set_io = rospy.ServiceProxy('/ur_hardware_interface/set_io',SetIO)
        set_io(fun = 1,pin = 2,state = 1)
    except rospy.ServiceException, e:
        print "Something went wrong: %s"%e

I'm getting no ServiceException. On my ur10_bringup.launch terminal I'm getting this error whenever I run the script above:

[ERROR] [1579178138.697529807]: Could not get fresh data package from robot

I can do a rosservice call (results in True):

rosservice call /ur_hardware_interface/set_io 1 2 1
success: True

I'm probably missing something. Any help is much appreciated. I'm running ROS Kinetic on Ubuntu 16.04 LTS with Lenovo Thinkpad X260.

EDIT: Seems like I'm trying to call a service that is present in the driver within universal_robots package, not the driver I am using. Am I correct? Running $rosservice list still yields /ur_hardware_interface/set_io.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by gvdhoorn
close date 2020-01-16 15:15:48.829352


I would suggest to post an issue on the UniversalRobots/Universal_Robots_ROS_Driver issue tracker, as I have the impression the usage of the service is correct, but there is something else going wrong (ie: inside the driver itself). The "could not get fresh data package from robot" is suspicious.

If you do post on the tracker, please post a comment here with a link to your issue there, so we keep things connected.

gvdhoorn gravatar imagegvdhoorn ( 2020-01-16 11:00:21 -0600 )edit
SSar gravatar imageSSar ( 2020-01-16 12:30:07 -0600 )edit

Closing as a duplicate then, with the duplicate being the issue on the tracker.

Summarising the discussion there: there is a good chance this is caused by the fact that OP Is also using EtherNet/IP, and the UR controller (at least with the current version of system software) does not seem to support using both EtherNet/IP and RTDE at the same time in certain configurations and with certain usage patterns.

gvdhoorn gravatar imagegvdhoorn ( 2020-01-16 15:17:01 -0600 )edit