Copy robot postion data into clipboard

Hello everyone,

This is what I want to do:

  1. Move the robot to a position using freedrive.
  2. Copy the robot position (preferably with an array p[x,y,z,rx,…])
  3. Paste the robot position into a variable.

It seems like something very basic, but I can’t find a way to do it. Does anyone know how I could do it?

The goal is to avoid typing manually the array.

Thanks a lot.

Additional note: I’m using a UR3e, with the latest polyscope FW.

I’m connected with the robot using VNC.

It is very basic, as you say yourself. :slight_smile: URScript has the built-in function which saves its current position in a variable.

Now, if you’re talking about doing this without running a program, then aren’t you simply talking about setting a waypoint?

Hi Efn, thank you for your answer.

But then how can I copy the var_1 position data to my clipboard?

What I want to do is:

  • Place the robot in the right position.
  • Copy this position data p[x,y,z,…].
  • Save this position data as a variable (posOpenMachineA)
  • Use this variable in a “waypoint” as a “variable position”.

The reason I want to do this is because I want to work on the variable before using it in a waypoint. I need to apply an offset in X and rotate (or not) the wrist 3.

So I want to create posOpenMachineA at the beggining of the program, as a kind of reference and then working on it depending some conditions.

I’m still not entirely sure, if all this is something you want to happen as part of your program sequence or something you want to do manually while programming?

You can retrieve the variables in an array (also position array) as shown here.

I have also added an offset to the Y coordinate.

Sorry, I’m not very clear

I want to do it manually while programming.

I want to set ~10 variables with pre-defined positions.

Basically this is my program (simplified):

For the real programme I will not have one variable, but ~40 So typing in all the positions will take quite some time. So if there is a way to copy a position to the clipboard it would be quite helpful.

Alright. :slight_smile: Well. I haven’t answered your question, either, so that’s my bad. There’s no way to copy a position to the clipboard.

You’ll have to find workarounds. For instance, read the coordinates from the move tab and write them down in Windows, now that you’re using VNC. Then you can paste with CTRL+V the coordinates as many times as you want to variables and edit them.

Have you thought about using fixed positions/waypoints instead? You can still retrieve the different pose array variables as before and you can use the Edit Pose function to edit the coordinates of the waypoint.
That should be the simplest solution for you, as far as I can tell. If I’m not missing something. :slight_smile:
You might have to do as I did in the last screenshot and make a new variable waypoint, where you add the offsets. I don’t think you can write directly to the array variable with script as you do.

No worries, thank you very much for your help ! Yes, I will find another way !

Oh okay, I will try and if it’s does not work I will make a new variable.

Here is a kind of walk around:
Make a program where you use “get_actual_tcp_pose()” to save the currant pose to a global variable.
Run this program from a USB stick.
When you have saved your 10 poses, close the program and take the USB stick to a PC
Open the *.variabels file with NotePad++
Copy-paste the variables to another document, eg. UR-pose.txt
Close the variables document without saving changes
Use NotePad++ to edit your UR-pose.txt document.
Remove unwanted information and find/replace to format the document as a csv file
Now you can import this document into Excel and play around with all the values

Thank you for the feedback. It’s good to know!

I also found out that I cant download my program .script using Filezilla and get the variables from there.