Home Programming

Discussion

Left ArrowBack to discussions page
vladvlad Posts: 5 Apprentice
Hello to all, 

Could you please explain to me in simpler terms how RTDE communication with Universal Robots works?
I want to use this protocol of communication in an URCap to set a digital output ON or OFF and also set de speed slider to a value. 

I understand how to open a socket communication but from this step I have issues. 
I already have read the guide from the Universal Robot website but I cannot figure it how it works. 
If I test with socket master the connection to the RTDE server but I did not receive anything. 

Thank you very much and have a nice day! 

Comments

  • bcastetsbcastets Vacuum Beta tester Posts: 457 Expert
    Maybe you could have a look to this python package which should make RTDE more accessible ?
    https://pypi.org/project/ur-rtde/

    It is well documented:
    https://sdurobotics.gitlab.io/ur_rtde/
  • vladvlad Posts: 5 Apprentice
    Hello bcastets, 

    Thanks for providing me the link and the info. I have read them but honestly I am still far away of understanding how it works. What I saw there is that there are some libraries which can be used in a Python or C++ app. This is very nice but I cannot understand how this files can be handled in Java which is the URCap language. The URCap example from the documentation from the link is just used to set the IP and the port for the PC which is doing the commands. I would like to do the commands from the URCap. 
    Maybe you can explain to me how RTDE works step by step and then I can handle this steps in Java. 

    Thank you in advance!
  • bcastetsbcastets Vacuum Beta tester Posts: 457 Expert
    I am sorry that I don't know enough to explain this better than UR documentation. I will let other people of the forum give you some guidance.
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,247 Handy
    RTDE will need to be ran in a daemon which your URCap starts up. Then you can just use the python libraries and examples that UR uses. This is really not something you use in a URCap directly unless all you are trying to do is capture poses to use to build the script from. It’s mainly used for control and recording data while the system is running.

    Even to use it to capture data you would need to have a server running. You could do this in Java, it’s all controlled through a TCP/IP server instance. Your best bet is to look up TCP/IP client server communications in Java. The other thing you could do if all you want is to record data to convert to script is listen to port 30001 and decode the streaming positional data from that port. This might be easier to do from Java. 

    What is your use case?
  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,247 Handy
    BTW, you can set the speed slider through plain tcp/ip socket communications, there’s examples on here. You can set a digital output using a secondary program served over port 30001 or 30002
  • tytytyty Posts: 11 Apprentice
    RTDE will need to be ran in a daemon which your URCap starts up. Then you can just use the python libraries and examples that UR uses. This is really not something you use in a URCap directly unless all you are trying to do is capture poses to use to build the script from. It’s mainly used for control and recording data while the system is running.

    Even to use it to capture data you would need to have a server running. You could do this in Java, it’s all controlled through a TCP/IP server instance. Your best bet is to look up TCP/IP client server communications in Java. The other thing you could do if all you want is to record data to convert to script is listen to port 30001 and decode the streaming positional data from that port. This might be easier to do from Java. 

    What is your use case?
    Hi,

    I'm currently working on rtde for just path recording. What I need now is just capturing the relevant informaton (position, rotation...) as you described above. I have installed ur_rtde but don't know how to use it... Thank you for your help in advance!

    ty
  • vladvlad Posts: 5 Apprentice
    Thank you very much for all the help. I will try the secondary port and in the meantime I will try somehow to use the Python files from UR website. 
    Thanks!
  • vladvlad Posts: 5 Apprentice
    Hello bcastets

    Thanks for providing me the link and the info. I have read them but honestly I am still far away of understanding how it works. What I saw there is that there are some libraries which can be used in a Python or C++ app. This is very nice but I cannot understand how this files can be handled in Java which is the URCap language. The URCap example from the documentation from the link is just used to set the IP and the port for the PC which is doing the commands. I would like to do the commands from the URCap. 
    Maybe you can explain to me how RTDE works step by step and then I can handle this steps in Java. 

    Thank you in advance!
  • vladvlad Posts: 5 Apprentice
    Hello bcastets

    Thanks for providing me the link and the info. I have read them but honestly I am still far away of understanding how it works. What I saw there is that there are some libraries which can be used in a Python or C++ app. This is very nice but I cannot understand how this files can be handled in Java which is the URCap language. The URCap example from the documentation from the link is just used to set the IP and the port for the PC which is doing the commands. I would like to do the commands from the URCap. 
    Maybe you can explain to me how RTDE works step by step and then I can handle this steps in Java. 

    Thank you in advance!
Sign In or Register to comment.
Left ArrowBack to discussions page