Universal Robots Forum

Reading double registers sent via RTDE

Hi,

I am implementing a robot control program via RTDE remote client.
I am writing into input_double_register_[24 to 31] as stated in the RTDE guide for input variables, since registers 0 to 23 are used internally ( Real-Time Data Exchange (RTDE) Guide - 22229 ). Through these registers I am passing joint values and other stuff.

For the Polyscope I am trying to access these values with a .script file but found no function for reading these double registers in the ur-script manual for SW 5.9 or later versions ( https://s3-eu-west-1.amazonaws.com/ur-support-site/77195/99405_UR10e_User_Manual_en_Global.pdf ). There are only functions for reading float registers (in the range of 0 to 23) but according to the RTDE guide there is no way to write into float registers.

A similar post is reporting some precision loss when handling double values withing the Polyscope, which implies that even though one is sending double values, they are interpreted as float values internally, if I am correct? ( RTDE precision lost from DOUBLE to FLOAT precision ). I tried sending double values into input_double_register_[24-31] and reading them from (not documented) float registers 24-31, but that did not work, as expected since these float registers do not exist.

How do you access the input_double_register values from a script command?

short example:
1.) set protocol version to V2
2.) asked to get actual_q and actual_qd in 500Hz
3.) requested access to input_double_register_24
4.) send a data package with the content: [Header] - [40 B4 24 9E C2 8E 24 62] representing 90degree in radian
5.) Define a function to assign this register to all the joints
def q_from_input_float_registers(register_index):
q = [0, 0, 0, 0, 0, 0]
q[0] = read_input_float_register(register_index)
q[1] = read_input_float_register(register_index)
q[2] = read_input_float_register(register_index)
q[3] = read_input_float_register(register_index)
q[4] = read_input_float_register(register_index )
q[5] = read_input_float_register(register_index )
return q
end
6.) Call this function inside the control loop
While True
q = q_from_input_float_registers(24)
velocity = 1
acceleration = 0.25
textmsg(“Target q:”)
textmsg(q)

        movej(q, a=acceleration, v=velocity)
        textmsg("movej done")

sync()
end

Best regards,
Max

The read input float register command you are using should give you access to those double registers, I don’t see a problem there. I assume you intend to read from 6 different registers (register_index+1, register_index+2 etc.) in your urscript function.

To ensure you are actually getting the data into the registers correctly you could set up a simple test in Polyscope before you start scripting. This would at least tell you the issue is in your urscript not your RTDE program:

Thank you for your reply.

I still don’t see why the RTDE requires double precision values, when only float values are transmitted, but due to this information and your great validation method, I found the problem in my RTDE client, where I simply forgot to add the byte about the recipe ID. The rest seems to be working fine now. I will have to look into the script and try to fix it.

Btw. using the same register for every joint was just to generate a simple example, but still thanks for your concern about this behavior!

Best regards,
Max

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

Glad to help! I just checked the bug report stemming from that other topic you quoted. It has been addressed and will be fixed in an upcoming release. As you stated everything internal seems to be single precision, so no need for RTDE to use double. Not sure what the nature of the fix will be, perhaps the register will be changed to single precision float, if this can be done as a non breaking change.

1 Like