RTDE Help understanding

Hello,

I have an issue understanding how RTDE Communications works.
I have established a connection of Real Time on 30001, 30002, and also the Dashboard server, and all of them are working and I understand how they work (except the fact that I do not receive any answer from the Dashboard, I already have a post on the forum for this subject).
What I understood until now is the following:
-first you need to establish a socket- this I understand
-then you will need to send RTDE_REQUEST_PROTOCOL_VERSION-here I start to have issues because I do not receive anything.
From this point I do not understand how this works.
I am currently developing a URCap and I want to set the speed and an digital output through RTDE.
I want to use this protocol because I think that if I understand this I can apply it to more complex things.
I have searched through the forum but I cannot find any example of RTDE used from Java. I cannot see how I can use the Python files from the Real-Time Data Exchange (RTDE) Guide - 22229 because the URCAP is based on Java. If I want to connect from an external PC I suppose that the files are useful but for Java I cannot see how it works.
There is an example which uses some classes but again I do not understand how this protocol works so I cannot use them.
My question is if it is possible maybe someone can provide a short example of an URCAP which uses this RTDE in Java and sets something on the robot or maybe better yet can explain it how it works step by step?

With the URCap you would use a daemon to control the RTDE server and then you can use python to write the server in.

Hello mbush ,

Thanks for the reply.
Could you please explain it in greater detail?
So for example can I use a thread from Java and not a daemon?
What that daemon/thread needs to do?
Do you have a simple example just with a digital output so I can understand. Just something basic.
I have to mention that I am a beginner in URCap Development and because of that I have a harder understanding of these concepts and how they work.

Thank you!

I am not a URCap developer either, I have developed RTDE running on separate servers from the robot. If you wanted to use it in Java I am not sure it would work but you would need to setup a TCP/IP server instance and perform the communication from there. I’m just not certain that it would work without it being in a daemon as I do not know that the server would say alive for instance.

Maybe that video will be of any help.

1 Like

Thank you for the video. I already saw it and I also saw that there are part 2 and 3 uploaded but I did not have the time to check them.

Thanks!

Probably more videos will be coming out soon

Good afternoon. I can’t figure out how to use this forum at all. Why is it simply impossible to ask a specialist a question on the site? I’m trying to get MyFirstURCAP training. At the third stage (Creation of the service) There was a problem ( screenshot image ) Tell me what’s wrong?

Hello @svarka48

there is the option reaching out to the UR+ Team Contacts directly, if you have specific questions. But it is highly beneficial for the community and future developers to discuss topics directly in the forum.

From the picture you have posted it seems, that you have not imported the package needed for the correspondent interface to be available. Have you tried pressing ctrl + space while typing to trigger the autocomplete suggestions? There should be the option to import the right package. Alternatively, you can import it yourself or copy and past it from a different sample.

The RTDE examples I found look way too complicated to me, so how would this simple TCP/IP example look like with/in RTDE?

import socket
import time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('169.254.63.28', 30002))

while True:
    s.send(("movej([-1.200691048298971, -1.6863962612547816, -1.206042766571045, \
                    -1.8198558292784632, 1.5693081617355347, 1.914101481437683], \
                    a=1.200691048298971, v=1.200691048298971)" + "\n").encode('utf8'))
    time.sleep(2)
    s.send(("movej([-1.2551572958575647, -1.7164651356139125, -1.762454628944397, \
                    -1.2335349184325715, 1.5693681240081787, 1.859632134437561], \
                    a=1.200691048298971, v=1.200691048298971)" + "\n").encode('utf8'))
    time.sleep(2)

I can’t run the rtde_control_loop example, because of a failing path sanity check