Author Topic: Weave different LIN commands?  (Read 1726 times)

Nicholas Ziglio

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 26
    • View Profile
Weave different LIN commands?
« on: March 19, 2020, 07:33:25 PM »
How do you weave commands that you do not want to duplicate? It says I need to have as many elements as Input 1 (32 elements).
As you can see each set has 8 lists, I'd like it to perform the commands in those 8 lists. So the LIN movements in the following fashion:
List1 CMD1, List1 CMD2, List 1 CMD 3
List 2 CMD1, List2 CMD 2, List 2CMD 3
List 3 CMD 1, ...

I'm not used to working with data in grasshopper, any help would be appreciated


Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1075
    • View Profile
    • Robots in Architecture
Re: Weave different LIN commands?
« Reply #1 on: March 20, 2020, 08:48:27 AM »
Hello Nicholas,

Basically you can use any of the many Grasshopper components to set the order of components, we just integrated the Command Weave to make some common applications easier.
In the default mode, it requires you to have the same number of items for each input. So if you've got 3 inputs with 2 items they will be output as follows...
Input 1, 1
Input 2, 1
Input 3, 1
Input 1, 2
Input 2, 2
Input 3, 2
That means that you might need to duplicate some commands. E.g. for a pick and place operation you might have three positions where elements are picked up and three positions where they are dropped off, but the Gripper Open and Gripper Close logic is always the same.

If you've got multiple commands there are some options. You can either Group them with the KUKA|prc Group component (not the Grasshopper standard Group component) or you can right-click the Command Weaver and enable the option to weave by tree branches. That way it will not take the first item, but the first tree branch. In that case, your data structure needs to have the same number of tree branches in order to work.

Hope that clears it up a bit!

Best,
Johannes

Nicholas Ziglio

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 26
    • View Profile
Re: Weave different LIN commands?
« Reply #2 on: March 20, 2020, 11:26:55 AM »
Thanks a million Johannes!  :D
If anyone finds this thread in the future, the flip matrix component and the partition list comonent were very valuable to sort the data as I needed.

Flip matrix basically swaps the lists rows with its columns.
Partition List can split duplicated data into branches (each duplication in its own branch).

I might mention this to Karl or make a tutorial on it myself :)

gavin20181001

  • Forum User
  • *
  • Posts: 4
    • View Profile
Re: Weave different LIN commands?
« Reply #3 on: April 20, 2020, 07:07:49 PM »
Hi Johannes,

I read the reply in discussion above,
I have a similar problem, I want to simulate the path of drawing different line segments
But the start point and the end point of the each line  can't  be  separated
My current approach is to raise the head and tail points before connecting
But my doubt is
If I want to set  breakpoints, is there a better way ?


Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1075
    • View Profile
    • Robots in Architecture
Re: Weave different LIN commands?
« Reply #4 on: April 20, 2020, 08:17:08 PM »
Hello,

Can you provide some more details on the process - are you getting a continuous curve and would like to have an offset movement at the start and end of each curve? If so there is probably a flatten somewhere that removes the structure. Let's say you've got 5 curves and then use the Divide Curve component. You will get 5 data branches - one for each curve - with a bunch of points. If you flatten them too early, there is no easy way of knowing which curve a point belongs to. So instead turn it into LIN movements, add a e.g. Tool Axis Offset, and only flatten it before you input it into the KUKA|prc Core component.
I've attached a quick variation of the Simple Path example.

If you want breakpoints, you could use a Custom KRL component and use "HALT" as the input. You could put it at the start or end of every toolpath and it will stop the physical robot until you press the green play button on the smartPad again. Note that the command will not be simulated in KUKA|prc.

Best,
Johannes

gavin20181001

  • Forum User
  • *
  • Posts: 4
    • View Profile
Re: Weave different LIN commands?
« Reply #5 on: April 21, 2020, 12:42:56 AM »
Hi Johannes,

Thanks for your  reply,

I have got the solution  from your attached file.

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1075
    • View Profile
    • Robots in Architecture
Re: Weave different LIN commands?
« Reply #6 on: April 21, 2020, 08:59:27 AM »
Excellent!

Best,
Johannes