Pick up one box from a grid of boxes, at runtime- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: General questions about RoboDK (//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK) +--- Thread: Pick up one box from a grid of boxes, at runtime (/Thread-Pick-up-one-box-from-a-grid-of-boxes-at-runtime) |
Pick up one box from a grid of boxes, at runtime-bfdavis-03-23-2022 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 RE: Pick up one box from a grid of boxes, at runtime-Jeremy-03-23-2022 Is your goal only to simulate or do you want to generate the program from RoboDK? Jeremy RE: Pick up one box from a grid of boxes, at runtime-bfdavis-03-23-2022 @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 RE: Pick up one box from a grid of boxes, at runtime-Jeremy-03-24-2022 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 RE: Pick up one box from a grid of boxes, at runtime-bfdavis-03-24-2022 @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. RE: Pick up one box from a grid of boxes, at runtime-Jeremy-03-25-2022 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 RE: Pick up one box from a grid of boxes, at runtime-bfdavis-03-30-2022 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? RE: Pick up one box from a grid of boxes, at runtime-Jeremy-03-30-2022 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
|