Universal Robots Forum

RTDE sends Servoj control problem

Dear UR+ development support, I still have some questions when using RTDE and I would like to ask you all. Thanks in advance!
Requirement: Send a dense trajectory for the robot to perform Servoj movement
Question 1: Directly call the servoj function in RTDE to control the movement of the robot. As shown in the following code, I use simulation mode to check that the robot walks 600 points and takes more than 20 seconds. This is not enough for 125hz. Is this method infeasible?

Question 2: I use RTDE to read and write registers and cooperate with the urp program to control the movement of the robot. I set it to send once in 8ms, but in the end the test robot failed to follow the trajectory I sent, and moved about half of it. My code and The procedure is as follows, do I have any questions?


Looking forward to your reply!

I hope someone will be able to assist you with that question, but in the meantime feel free to check this video which is part 1 of a full example of implementation trajectory following using servoj and RTDE (using python) . I am just a student working with the robot as well and by no means an expert, so maybe the presented way is not the most professional and correct, but it works

I will make another video showing robotic implementation soon

For Question 1:

The issue is that you use the getInverseKinematics() function, which is not to be used in an online servo loop, since the function awaits a confirmation from the controller (which takes some time). Try to use the servoL function instead, which will perform the inverse kinematics on the controller side, then it should be working as intended.

For Question 2:

You should remove the sync() command from your servo loop, this should help.

In the future remember to post issues related to ur_rtde on the issue tracker here.