Palletizing when the first layer starts at different Z position

I used the wizard to program a palletizing routine that is working well. Unfortunately, the stand we use to palletize the parts can vary in height by 25mm. This will result in the robot pushing the part into the stand and damaging it or dropping it too far from the stand and damaging it. Teh parts are pressed ceramic powder, so they are very fragile, and the stands are very heavy.
How can I program a palletizing sequence where I can measure the stand height and enter the initial z axis of the palletizing and then have the Robot offset as it adds more layer?
I’m using a UR10e.

The pallet template has a “feature” reference. make a feature in the installation are of the GUI, say “myFeature”, and set your pallet to reference this feature. You can change this feature in the installation area, but you can also make program-local changes by overwriting the value, in this case, just the z-pos as myFeature[2] = z_offset

i can think of 2 options:

  1. does the operator know the precise offset each time prog is run? if so; you could assign a variable with an input from the user, then apply the offset inputted by the user with myFeature[2] = user_input

  2. If the user doesnt know the precise offset, you could use a direction command to have the robot move in the -Z direction until tool contact (with the offset surface), then do myFeature[2] = get_actual_tcp_pose[2]

Note: You will likely have to reteach your pallet after referncing your custom feature. I have never been successful at changing the feature of a pre-programmed pallet; i always set the feature of the pallet prior to programming

TLDR - use a custom feature as reference for the pallet. capture the offset when the program starts and apply it to the feature variable.

I have been using the get_actual_tcp_pose command but it has often been not taking the shortest route to the point even when I use get_inverse_kin command not sure how to fix this issue but I imagine you wont have this issue with your application.

@ryan3 - Your application is complicated by Robotiq’s copilot. They are doing some blackbox stuff in an xmlrpc server with the features; especially when using their apply contact offset node, but also generally.

AFAIK, OPs application is just using the built in palletizing node and should not have an issue.

Further, OP here is only concerned about Z which simplifies this application even more.