-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending urscript in remote control mode while UR_Driver running #982
Comments
Update from working on this problem: I have used what here in this link given: https://www.universal-robots.com/articles/ur/programming/secondary-program/
Note: something strange happened to the teach pendant, it froze partially, like i change from remote control to local control to be able to stop and restart the urcaps program, but i was not able to stop the program, then i restarted the robot from teach pendant. (this freeze situation only happen when using the "sec")
|
Hi, to control IOs, you don't need to send URScript. You can directly use the services from the
If you want to include the gripper to your URDF you'll need a description for that and a ROS driver for it. |
I will close this issue, since there was a solution proposed roughly a month ago. Feel free to comment / reopen if there is still any issue persisting. |
Affected ROS2 Driver version(s)
ROS2
Used ROS distribution.
Iron
Which combination of platform is the ROS driver running on.
Ubuntu Linux with realtime patch
How is the UR ROS2 Driver installed.
From binary packets
Which robot platform is the driver connected to.
UR E-series robot
Robot SW / URSim version(s)
polyscope
How is the ROS driver used.
Through the robot teach pendant using External Control URCap
Issue details
Summary
I have installed the ROS2 ur_driver and the URCaps and both running fine with testing them using the MoveIt, but i have only in rviz just the ur5e without the gripper, so i have read from an issue that it is not easy to configure the gripper in the ur_description and be able to control it, so i have chosen to use the urscript to be able to control the gripper, but till now i have only succeded to control the digital output and be able to move the robot using the urscript by running a python code as the following:
`import socket
def send_urscript(ip, port, script):
try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((ip, port))
s.sendall(script.encode('utf-8'))
print("Command sent successfully.")
except Exception as e:
print(f"An error occurred: {e}")
robot_ip = '10.130.1.100' # Replace with your robot's IP
port = 30002 # Standard port for URScript commands
urscript_command = '''
def secondaryProgram():
set_digital_out(1, False)\n
sleep(5)\n
set_digital_out(1, True)\n
sleep(10)\n
end\n
secondaryProgram()
'''
send_urscript(robot_ip, port, urscript_command)
`
after running the ur_driver and running my urcaps external control, i also used the remote control to be able to send urscripts, but when i run the the python code i get what i have written in the code, but after that the urcaps external control will be stopped automatically alone, i have thought of primary and secondary programms and using the information of this site [https://www.universal-robots.com/articles/ur/interface-communication/remote-control-via-tcpip/] i did not get any other response using port like 30001, 30002 or 30003, the other ports did not work for remote control (I could not receive the true digital output by using 30004, 30011, etc).
Another problem is that i tried in this way to control the gripper (2F Adaptive gripper) that is connected to the wrist of the roboter with these type of commands e.x. "rq_open()" in urscript, but it didn't work (I have only activated the gripper from the teach pendant after i turned on the device).
One more thing that is maybe be important to say is that while running the ur_driver a two repeated message is shown that about 0.5 - 1 ms the connection to reverse interface dropped as shown
Finally when the python code is executed then the "connection to reverse interface dropped" message is only received.
Thanks for all your help and support.
Relevant log output
No response
Accept Public visibility
The text was updated successfully, but these errors were encountered: