Relative waypoint with URscript

Hi guys,
In my current project robot has to repeat movements, but from different positions/starting points. I’ve been using Relative Waypoints and copy/pasted for different starting points. Now I need to send robot commands with script, primary interface.
Can you suggest me please how to send the robot, kind of, relative waypoints, but via Script?
Possibly there will work changing Base Feature to Tool Feature and adding value at X, Y, Z.

Hi Giorgi,

If I understood you properly, you will need to use pose_trans(). For example, if you want to move the robot to the point (0.1,0.1,0,0,0,0) relatively to a certain frame, you will need to do insert this: pose_trans(coordinates_of_frame, p[0.1,0.1,0,0,0,0])
Best regards,

Thanks for response.
Previous time I tried to send command MoveL with script, I had to write Base, Shoulder, Elbow and wrists coordinates (degrees to radians). Possibly because I set waypoint while didn’t hint view Base.
I will try what you suggested.
Thanks a lot.

I checked it with URSim.
So, when you send command movel(pose, a=1.2, v=0.25, t=0, r=0), in the pose you have to write joint position (Base, Shoulder, Elbow and wrists coordinates (degrees to radians))
If you write tool position (X, Y, Z, rX, rY, rZ) it goes absolutely another direction.

Hi Giorgi,

Could you provide some sample script so we can have a better idea of what you’re looking for?

Hi Giorgi,
I find that very strange because I’ve used that script and I’ve placed [X,Y,Z,RX,RY,RZ] instead of joint coordinates. Could you give a short sample of your code so I could have a better idea of what you are looking for. In what language are you writing your script (I use C# and then send it via port 30003)

Currently I use Underautomation - Universal Robot communication SDK. It’s kind of socket where I send script, for example MoveL, set_payload, etc. So, I don’t write a script yet.
Anyways, here are screenshots of program written in URSim. I’ll try to explain.


Here is movements required for one compartment. Waypoint_0901 is starting point. Waypoint_2, Waypoint_3, Waypoint_4, Waypoint_5 are relative waypoints. So Waypoint_2, Waypoint_3, Waypoint_4 and Waypoint_5 always make the same movement, but at different coordinates, which is upon Starting Waypoint (Waypoint_0901 in this case).


Here are movements required for second compartment. Waypoint_0902 is starting waypoint and the rest (Waypoint_2, Waypoint_3, Waypoint_4 and Waypoint_5) are relative waypoints. They make the same movement but at different coordinates, as Waypoint=0901 is not equal to Waypoint 0902.

So now, I wonder how can I send relative waypoints to the robot.
Herewith, I tried to send [X,Y,Z,RX,RY,RZ] coordinates with Underautomation - Universal Robot communication SDK app and it didn’t work. It worked when I send Base, Shoulder, Elbow, Writs1, Wrist2 and Wrist3 coordinates (radians).
Possibly I need to change something either in the script or in the robot. I send just simple one line script for example :
movel([-39.34,-900.92,749.1,0.214,-2.3,2.295],a=0.6, v=0.25, t=0, r=0)

Hi Giorgi,
Thank you for the info you sent.
I am going to give an example of a similar script I wrote. As far as having a waypoint relative to a certain frame, I found out this works:

movel(pose_trans(coordinate_of_frame, p[0.1,0.1,0,0,0,0]), a = 0.6, v = 0.25, t = 0, r = 0). Your frame coordinates should be inserted in coordinates_of_frame. Occasionally, I’ve had problems with having the coordinates of waypoint in the [X,Y,Z,RX,RY,RZ] form, but it is very rare. Try this out and if you still have any doubt, I’ll see if I can help you out

You were right.
It works! Thanks a lot.

P.S. Problem about coordinates was that in movel(pose, a=1.2, v=0.25, t=0, r=0) command when I wrote the pose this way:
movel([0.123456789, 0.123456789, 0.123456789, 0.123456789, 0.123456789, 0.123456789], a=1.2, v=1.)
Joint angles were expected.
If you write with p[…]
movel(p[-0.19691,-0.44720,0.73374,0.126,-2.058,1.925],a=0.6, v=0.25, t=0, r=0)
then cartesian coordinates are expected.

You’re welcome. You need to place the p before, otherwise it assumes it is joint positions. But if you notice I always placed the p before the coordinates on my previous replies. Glad I could be of help