Defining Pallets Programmatically

In previous robots I’ve worked with pallets could be defined and referenced throughout the code. For example,

pallet 1, p1, p2, p3, p4, 10, 10

would create a pallet with 10 rows 10 columns using features point p1, p2, p3, p4 as the corners, while

pallet(1,13)

would return the point coordinates at position 13 of pallet 1 to be used with motion commands. Is something like this achievable out of the box with polyscope? I have an application where I’m using multiple pallets and trying to reuse code as much as possible, but using the pallet wizard I can’t see how I would share the “At Each Item” loops. Each pallet has essentially the same operation (approach at some z distance, go to pallet point, return approach).

I realize I could code the above solution, but just wanted to check if this functionality exists already.

I think I’ve worked through this by not using the generated movements section of the pallet template but instead assigning the generated referencePoint feature to another variable which is then used outside of the pallet template. Using this method also allows me to adjust the pose of referencePoint for variable heights.

To anyone trying this, don’t comment out the “Generated Movement” Folder. It seems that the creation of the referencePoint feature is tied to the folder and after restarting the controller you’ll get an error that the referencePoint doesn’t exist. What I ended up doing was creating a pose variable of the current pose from get_actual_tcp_pose() and using that for the generated movement waypoints so the arm doesn’t move at all and then setting the moves outside the template. You’ll need to switch the MoveJ MoveL feature to base inside the generated movement folder in order to avoid errors.

This all feels kind of hacky, is there a better way to break the actual pallet point pose out of the pallet template?