The robot moves to the previous pose sent via RTDE instead of the current position sent via RTDE

Hello!

I have made a program that allows to move the UR10 robot to the central position (leaving a distance in Z) of an ArUco marker placed in the robot’s workspace.

To transmit the position of the ArUco to the robot, first of all I have defined the reference system of the camera with respect to the robot’s base, in order to move the robot according to that reference system (the one of the camera). The robot behaves relatively well (I get some error when moving the ArUco away from the camera, but it is not relevant right now).

The problem is the following: When I send the ArUco pose via RTDE, I notice how in polyscope the ArUco_Pose variable is updated to the one currently sent but, the robot moves to the pose sent in the previous cycle. For that reason, I have to run the program twice to get it to go to the sent pose (firstly it moves to the previous pose and secondly it moves to the desired pose).

I think that the problem may come from some misplaced “sync()” command, since I imagine that the robot starts to do the “movej” movement before the ArUco_Pose variable is updated, even though I can see how it is updated in the variable inspector. The problem is that I don’t know how to solve it.

Thanks in advance and in case you need any extra information don’t hesitate to contact me.

P.S. I attach the polyscope program as the error must be there (the vision system and the communication via RTDE has been implemented using Python)


Comunication_Thread

How are you telling when to update the pose and when the pose is updated? You could wait for confirmation the pose has been updated before performing the move or compare the current pose to the previous pose used and if it hasn’t been updated, wait until it has been. Though if the Pose could possibly be the same as the previous cycle; I would recommend a way to notify the program that the pose has been updated before performing the move.

Hello again,

I am running the program once for each movement of ArUco. That is, I run my vision system (Python program), press CTRL+C to stop it when the ArUco has been detected and from there I send that pose to the UR10 via RTDE.

Every time I move the ArUco, I run the Python program again and follow the same procedure. The sent pose is updated in polyscope but for some reason I still don’t know, the robot moves to the position sent in the previous execution.

Thanks anyway for your answer,
Best regards.

Hello.

I have fixed the problem. The issue was that the UR controller was not able to synchronise the transmitted data so I have added a delay between line 12 and 13.

Thanks for the support,
Daniel.