Universal Robots Forum

Is there a way to go to a waypoint directly from a URscript?

Lets say I have waypoint A

From, URScript, is there a way to say movej(A)?

Yes - that’s exactly how you would do it. Is it not working how you would expect? You can see the URScript manual for optional arguments, but if you just pass a waypoint it will use default speed/accelleration values.

@vayalur

Your question is a bit disambiguate. So the answer could be both No and Yes and Yes.

If your situation looks like:

Then this can both work, and could not.

If you simply “write” WptA then it will NOT work.
This would be alike for both a script line and script file program node.
Script would look like:

movej([j0, j1, j2, j3, j4, j5], ...)
movej(WptA)

That means that PolyScope simply parses the value of the position WptA as the joint angles in the waypoint definition.
Hence, the variable, WptA would not have been defined.


If you on the other hand are using a “script line” and select the Waypoint from the Pose dropdown, then it will work.
The expression editor simply parses the waypoint positions to the actual script.


And your script would look like:

movej([j0, j1, j2, j3, j4, j5], ...)
movej([j0, j1, j2, j3, j4, j5])

Hence, your WptA would never be defined as a variable here either. But this would work execute fine.


What @ajp is referring to, is the solution where you did it all in script, in which case you might write:

WptA = [j0, j1, j2, j3, j4, j5]
movej(WptA)

And that would work as well.

Thank you. Although these are a step closer, they don’t solve my problem. The problem with the solution is if I want to change the WptA by moving it a little bit, I have to do it through the teach console, note the joint positions or tcp position and update script. I was trying to find a way where the script goes through a set of positions but each position can be updated simply through the UI.

Have you tried get_actual_joint_positions() or get_actual_tcp_pose()?

Yes, thats a workaround I am using. Have a routine that goes through all waypoints and converts them into variables. Then use those variables to make the movement from script.

Thanks again for the suggestion.

1 Like

I would also love it if we could modify way-points by adjusting numbers, in addition to the current possibility to move the robot to a pose first and then update the waypoint.

I do think there are some risks involved with allowing users to enter numbers. Having to move the robot to a pose first means you have seen the pose and should be (reasonably) sure it is a safe motion. But I still think that allowing to edit the numbers directly can be a huge time-saver for more advanced users. Maybe it could be an option that is hidden by default or something along those lines.

@de-vri-es
The Pose Editor feature already allows for you to just edit the Cartesian or joint space parameters of waypoint, without moving there beforehand.

On a Waypoint node just tick “Show advanced options” and select “Edit pose”.

1 Like

Ah, that is very useful. Thanks!