Implementation of RTDE into C#

Hello,
I am working on a programm were i need the current coordinates of the tool (x,y,z,xr,yr,zr).
As recommended I am trying to use RTDE also because the Robot-Programm should not be touched.
Sice i want he current coordinates i want, as described on the RTDE guide, “actual_TCP_pose”. Can someone help with that topic.

The part of the code i have trouble with is:

                byte[] sbuffer = new byte[1024];
                byte[] buffer = new byte[1024];
                
                sbuffer = Encoding.UTF8.GetBytes("actual_TCP_pose");
                s.Send(sbuffer);
                s.Receive(buffer);
                txt = Encoding.ASCII.GetString(buffer);
                s.Close();

For Explenation:
s = my socket --> Connection is Working. I am using Port 30004 (the RTDE port).
sbuffer = my "Send-Buffer
buffer = recieve Buffer
txt = string with is suposed to contain the Coordinates

Thanks for Help

2 Likes

Hi,

.NET library done here:

https://sourceforge.net/p/firsttestfchaxel/code/HEAD/tree/trunk/Ur_Rtde/

Gets back only the fields your want (all or a part of), you just have to define two class with the RTDE fields requested.

Bye.

4 Likes

Tried using your code and it always fails on Ur_ControlStart. Why might this be happening?

Hi,

Yes … the code was not up to date (a small bug inside).

Now it’s OK, get back it on Sourceforge.

Bye.

Is there an existing command in your implementation to send a command to move the robot to a position using the six axis values? I am looking through and trying to find a send command that allows input of a six double long array.

adds for instance

public double input_double_register_24;
public double input_double_register_25;

and so on in UniversalRobot_Inputs class.

See also this .NET C# RTDE implementation