#### Discussion

Back to discussions page
Posts: 12 Apprentice
Hi,
how do i define or generate motions similar to palletizing function without using it,
it is help full when i have a tray defined wrt to a feature variable, otherwise which is not available with polyscope programming

lets say i have a tray with 10 rows and 5 columns,
i know coordinates of corners ABCD,
any suggestions and workaround for the above requirement.

• Posts: 4Partner Apprentice
I think you could probably use nested loops with variable waypoints.

So for example, if you have a feature that your pallet pattern is offset against (and I hope my pseudocode makes sense):

featureOffset = (x,y)
loop1(i = 0, i<=10)
loop2(k=0,k<=5)
Go to waypoint (i+x,k+y)
Do whatever
end loop
end loop
• Posts: 660Founding Pro, Tactile Sensor Beta Testers Handy
edited October 2017
@manjunath13 here is a sample program that I put together showing how to use the points A,B,C and D to calculate your step size based on the number of columns and rows that you have.  You actually only need three of the points, A,B and D in the method that I put together.  The code calculates the distance between points and then uses the number of rows and columns minus 1 to calculate the step size that is required.  This code is then using point A as the feature that the pallet is built around.  You could just as easily use another feature that you have predefined and have the pallet calculated against that feature by simply changing the feature used in the pose_add section.

Here is the text of the program that I wrote.

Program
BeforeStart
Set
var_2≔Tool
MoveJ
var_2
If  False
MoveJ
A
B
C
D
columns≔5
rows≔2
columnDistance≔pose_dist(A,D)/(columns-1)
rowsDistance≔pose_dist(A,B)/(rows-1)
i≔0
j≔0
Robot Program
Loop i<columns
Loop j<rows
MoveL
var_1
j≔j+1
i≔i+1
j≔0
i≔0
j≔0

Here is a gif of the program executing

• Posts: 12 Apprentice
Hi @matthewd92,

thank you for your suggestion, yes i tried it and your suggestion works very well.

what if my pallet axis is at angle to the robot axis, does the program remain the same at any installation angle wrt to the pallet, how do i consider this challenge,
• Posts: 39 Apprentice
@manjunath13