Universal_Robots_ROS_Driver icon indicating copy to clipboard operation
Universal_Robots_ROS_Driver copied to clipboard

"/ur_hardware_interface/script_command" stops program on controller

Open kimanton opened this issue 1 year ago • 0 comments

Affected ROS Driver version(s)

Latest

Used ROS distribution.

Noetic

Which combination of platform is the ROS driver running on.

Linux without realtime patch

How is the UR ROS Driver installed.

Build the driver from source and using the UR Client Library from binary

Which robot platform is the driver connected to.

UR E-series robot, Real robot

Robot SW / URSim version(s)

SW 5.16.0

How is the ROS driver used.

Through the robot teach pendant using External Control URCap

Issue details

Summary

This issue is similar to many others, but they are old so I decided to open a new one I have UR10e with Onrobot RG6 gripper. I want to control its width and force. The only solution seems to be /ur_hardware_interface/script_command. However, when I publish "rg_grip(100, 100, 0, False, False)" nothing happens. When I try to send a test hello like was suggested here. I made sure I am in Remote Control mode, and I updated robot software and urcaps to latest available versions just in case.

Issue details

I need to be able to control the gripper width and force. And I also need to robot program always running because I need External Control to control joint velocities. As was said before, I want to control gripper through /ur_hardware_interface/script_command. In my case the command I want to send looks like this rg_grip(width, force, 0, False, False). I use simple Python publisher script to publish the message. When I send the command, there is no reaction at all. pkowalsk1 mentions here in EDIT section that they also couldn't send anything when using External Control

I then followed sequence presented in #131 here, but still there is no reaction. Logs also don't have any new messages

Then I tried to see if anything will work at all. I created a program variable var1=10 and an installation variable var2=10, and tried to change assign them a new value like described in #536 here and here,p5. The message goes through, but the variables are not updates. Instead, the program on controller stops and I have to restart the sequence from #131.

Then I tried to send a hello popup as was suggested in #77. The popup appears on TP screen, but it also stops program and I have to go thought the sequence from #131

Finally, I updated robot software and URCaps for external control and for gripper to the latest available versions and tried all previous step again with no success

Steps to Reproduce

  1. Make sure physical connection is not established between robot and host computer (ethernet unplugged)
  2. Enable Remote control mode from TP.
  3. Establish physical connection between robot and host computer (ethernet plugged in)
  4. Run UR_ROS_Driver.
  5. Run program on controller rosservice call /ur_hardware_interface/dashboard/play
  6. Run script to send message
import rospy
from std_msgs.msg import String
def main():
    node_name = "rg6_node"
    rospy.init_node(node_name, anonymous=True)
    rg6_pub = rospy.Publisher('/ur_hardware_interface/script_command', String, queue_size=1, latch=True)
    cmd = String()
    rate = rospy.Rate(1)
    while not rospy.is_shutdown():        
        # width, force, tool_index, blocking, depth_comp
        data = "rg_grip(100, 100, 0, False, False)"
        # data = "global var2 = 50"
        # data = "var1 = 50"
        # data = "popup(\"hello\")"
        cmd.data = data
        rg6_pub.publish(cmd)
        rate.sleep()
        print(data)
if __name__ == "__main__":
    main()

Expected Behavior

Gripper moves, or variable changes value, or "hello" popups, and TP will show that the program is still running

Actual Behavior

Gripper never moves, variables never change values, "hello" popups. However, when sending new variables values or sending "hello" TP shows that program stopped.

Workaround Suggestion

I use digital outputs to trigger events which call rg_grip in robot program. But there are only eight digital outputs, so there is only eight combinations of (force,width) I can use. This is not feasible as a longterm solution

pkowalsk1 presents here another possible solution by using analog outputs

Relevant log output

No response

Accept Public visibility

  • [x] I agree to make this context public

kimanton avatar May 15 '24 10:05 kimanton