Modyfying only the z coordinate of a waypoint

I would like to program a depalletising and palletising manually on something quite complicated. I wish to set out the pick locations on the x and y and then modify the z for the different layes.

Something like assign variable to the layer number and then insert this z value into a position. This will save a huge amount of time programming.

Thanks sam

That’s not too tricky. :slight_smile: You can use the script function pose_add for example. which allows you to add a variable to the z coordinate.
You can read more about it in the script manual found on UR’s download page.

thank you. I have now done it by using the polyscope by having two variables at the beginning that represent the position on the pallet i.e. layer and position. Then i set a variable on a installation waypoint that is the payer position and another variable that is the layer height. I then assign the [2] position with a a variable that is a function of the layer to get the different height. I can copy and paste this whole script and then all i have to do is input all the positions with just two numbers and doesn’t take long to do 140 positions.

That sounds like a good solution. :ok_hand:

You can use a variable position.

Assigning “MyVariable ≔get_actual_tcp_pose()” will give you an array [X, Y, Z, Rx, Ry, Rz]

Then you can reference each part like so: MyVariable[0] for the x position MyVariable[1] for Y etc etc
So you could do:

CurrentPosition = get_actual_tcp_pose()

NewPosition = p[CurrentPosition[0], CurrentPosition[1], new z coordinate, CurrentPosition[3], CurrentPosition[4], CurrentPosition[5],]

MoveL to NewPosition