You can store a list of poses, just not a list of lists. You could predefine your list, but you would need to fill it with poses when it is created to have it be of the correct type and length. You could then just index through the list. Also, if you defined your initial pose as something unique, you could iterate until you reach the first un-altered pose, then you are done. I know we create lists that have I think up to 254 elements in them with an RPC call that we have created, we do this for being able to quickly generate the list and fill it how we want.
cwwstc
matthewd92 said:Yes, that is exactly what I meant. I have never tried creating large lists of poses but I know a regular list can hold somewhere around 254 elements before there are issues. If you get this working please let the community know so that we can see how you solved that problem.
Thank you so much! The test will be conducted next week. I will upload the result and follow ups of this program.
Hello,
I have a question about generate new variables automatically with UR5 robot while performing a path recording task.
Assume I have a starting position variable Var_start, and a variable get current position Var_now. From waypoint 1 to waypoint 2, I need to record the trajectory for each displacement of 0.1 m, and store the position in new variables starting from Var_1, Var2,...etc. However, I do not know the exact number of new variables needed to perform this task. Therefore, I am asking if there is a way the script can generate new variables with different names automatically?
The pseudo code is as following:
i = 1
Var_start = waypoint 1
While True:
Var_now = get_actual_tcp_pose()
if point_dist( Var_start,Var_now) > 0.1 then
(Var_) + i = Var_now
Var_start = Var_now
end if
Loop
Comments: I have few thoughts about achieving this, such as:
1) update new name of variables as in pseudo code.
Problem: UR script cannot combine string and integer together, which is able to be done in Python 3.0 but not here. And new name string cannot be accessed as new name of variable directly.
2) Create a long array of position variables and then use them in sequence.
Problem: position value itself is already an array of 6. I have not tried, but I do think I can create 2-D array for achieving this since UR script defines strickly on the format of its variables.
Thus, please let me know if there is a way or an alternative way can achieve to generate unknown number of new variables in a UR program.
Thank you very much in advance.
Regards,
Denis