due to the missing function of saving a position in a variable in Polyscope V3.15 I am trying to solve this for an easy setup later.
I thought to use global variables, so the main program can use those variables also. They are all the same syntax. An example is pos_xx. xx is the variable which defines the position.
By asking the user which pos he wants to change I have the pos as an variable. But how can I use this variable to save a position on this variable?
local pActualTCP = p[0,0,0,0,0,0] xTargetPos = request_boolean_from_primary_client("Is the TCP on point?") if xTargetPos: iPosToChange = request_integer_from_primary_client("Which Position do you want to change?") sPosToChange = to_str(iPosToChange) sPosToChangeValue = "pos_" + sPosToChange popup("Is " + sPosToChangeValue + " right?") get_actual_tcp_pose(pActualTCP) global 'HERE IS THE PROBLEM' = pActualTCP popup("That went smooth", title = "Success") halt else: popup("The program will be terminated", title = "Error", error = True, blocking = True) halt end
Create an array to store the positions and use the operator’s input as the index.
Now you just get to struggle with the fact that UR still hasn’t implemented a way to initialize an array of a set size easily, nor do they have a dynamically sizable array.