Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pick up one box from a grid of boxes, at runtime
#1
I have an 8x8 grid of blocks on a tray. I want to use a UR3 with a Robotiq gripper to pick up one of these blocks and move it elsewhere. I could naively make 64 separate programs to pick up any of the blocks, then at runtime select which program to execute. But it would be smarter to have a single program, with a variable target. What is the best way to make this happen?

For example, I'd like a program where I could input the row and column of the block I want, i.e. pickupBlock(3,7). Picture attached

[Image: AO3X2SE.png]
#2
Is your goal only to simulate or do you want to generate the program from RoboDK?

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#3
@Jeremy - I want to generate the program, which will be integrated into a larger automation system. A separate Python program will control the logic for which block to choose, then needs to send a command to the robot to grab and move that block. I'm not sure if this is better automated with Python API or maybe somehow with the Palletization plugin
#4
If you do it with Python it will work, but the issue is that it will only really work if RDK is connected to the robot.
Was that your plan?

What is supposed to send the command to the robot in the real environment?

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#5
@Jeremy - I was not expecting to keep RoboDK connected to the UR3 while running. Is there a way to use a Python program so that move commands can be called while disconnected?

The UR3 is connected to an EPICS network (epics.anl.gov), that can tell it to execute a script command.

I am trying to understand how to feed a variable through this process to the robot. The variable would ultimately tell the robot which block to pick up.
#6
This may seem easy but it's not.

We don't really support post-processing (generating) variable-based code.
That's a can of worm we did not open yet as it would be a mess to implement on the 40+ brands we support (each one having 1 or more different programming languages and ways of handling variables.)

You can do some python variable base programs but it will only work if you are connected to RDK.
Otherwise, RoboDK will generate a list of positions.

So what you could do is generate your array of position using RDK, but you would need to create the variable-based condition that calls each moves on the controller.

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#7
Does this mean I must create 64 separate programs? i.e. one for each block? Then just call the program that corresponds to the block I want? Isn't there an easier way @Jeremy?
#8
That's also a valid option. I know it sounds awful, and I've been preaching for us to have a variable-based way of programming, but it won't happen tomorrow. 

One thing you can do is to use Python to automatically create your 64 programs though. 
Something like that:

Code:
from robodk import robolink    # RoboDK API
from robodk import robomath    # Robot toolbox

# Link to RoboDK
RDK = robolink.Robolink()

column = 8
row = 8
distance_x = 10
distance_y = 10
app_height = 100

RDK.Command("AddFolder", "Folder Pick Programs")

ref_target = RDK.Item("My_Reference_Target",robolink.ITEM_TYPE_TARGET)
ref_frame = RDK.Item("My_Reference_Frame",robolink.ITEM_TYPE_FRAME)
gripper = RDK.Item("My_Gripper",robolink.ITEM_TYPE_TOOL)
folder_prog = RDK.Item("Folder Pick Programs",robolink.ITEM_TYPE_FOLDER)

for i in range(column):
   for j in range(row):
       new_target = RDK.AddTarget("Pick_Target_"+str(i)+"_"+str(j),ref_frame)
       new_target_pose = robomath.Offset(ref_target.Pose(),i*distance_x,j*distance_y,0)
       new_target.setPose(new_target_pose)
       new_target_app = RDK.AddTarget("App_Target_"+str(i)+"_"+str(j),ref_frame)
       new_target_app_pose = robomath.Offset(new_target.Pose(),0,0,app_height)
       new_target_app.setPose(new_target_app_pose)

       new_prog = RDK.AddProgram("Pick_"+str(i)+"_"+str(j))
       new_prog.setParent(folder_prog)
       new_prog.setTool(gripper)
       new_prog.setFrame(ref_frame)
       new_prog.MoveJ(new_target_app)
       new_prog.MoveL(new_target)
       new_prog.MoveL(new_target_app)


Attached Files
.py   Create array Prog.py (Size: 1.6 KB / Downloads: 8)
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


  




Users browsing this thread:
1 Guest(s)