Universal Robots Forum

Resetting wrist3 joint value from URScript


I am using a dual configuration with 2 UR3e robots. At some point, I am using one of the robots to rotate a pipe, so I make it rotate several revolutions using the wrist3 joint. Because of this, the joint value can quickly become quite large. The thing is that I want to keep the robot joint values within the limits of [-2pi, 2pi] for compatibility with ROS MoveIt that I also use for motion planning.

I notice that using the Polyscope option to set a specific value of the Wrist3 joint, the wrist3 joint just moves less than a revolution and the value of the joint angle resets to the requested joint angle.

My question is then, can this behavior be achieved using URScript? can I reset the joint value of the wrist3 joint? or at least is there a way to execute the same function that the Polyscope has to move the wrist3 to a desire joint angle that does the minimal motion needed to achieve the requested position and then resets the joint angle?

Hi @cristianbehe,

Welcome to the UR community!

You can use the URScript reset_revolution_counter() for this purpose. I you are giving a cartesian target the controller will also find a joint solution that is not making the wrist3 move the long way.

1 Like

Hi @Ebbe,

Sorry for the late reply.

That was exactly what I needed. Thank you!

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