Discussion

Left ArrowBack to discussions page
manjunath13manjunath13 Posts: 1 Recruit
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.

Comments

  • mbanerjeembanerjee 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
  • matthewd92matthewd92 Posts: 508Founding Pro, Tactile Sensor Beta Testers Handy
    edited October 12
    @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
             var_1≔pose_add(A,p[i*columnDistance,j*rowsDistance,0,0,0,0])
             MoveL
               var_1
             j≔j+1
           i≔i+1
           j≔0
         i≔0
         j≔0



    Here is a gif of the program executing





Sign In or Register to comment.
Left ArrowBack to discussions page