Author Topic: Using current position to create virtual lines  (Read 1931 times)

kratzsci

  • Forum User
  • *
  • Posts: 10
    • View Profile
Using current position to create virtual lines
« on: May 13, 2021, 04:08:05 PM »
Good morning,

 I'm trying to get the arm to detect an object and create its outline virtually based on the position of the tool tip (detecting by button touches). Is it possible to use the current position of the tool tip to generate virtual boundaries within kukaprc?

Thank you for any help!

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1341
    • View Profile
    • Robots in Architecture
Re: Using current position to create virtual lines
« Reply #1 on: May 13, 2021, 07:09:48 PM »
Hello,
Technically that's not a problem, the question is probably mostly the communication interface and the way of interaction.
Do you have access to KUKA mxAutomation or alternatively KUKA EthernetKRL? They are both paid software addons by KUKA.
Best,
Johannes

kratzsci

  • Forum User
  • *
  • Posts: 10
    • View Profile
Re: Using current position to create virtual lines
« Reply #2 on: May 13, 2021, 07:26:05 PM »
Dear Johannes,

Unfortunately I currently do not have access to KUKA mxAutomation or KUKA EthernetKRL. Would it be possible to do it without them or should I look into acquiring one of the above mentioned software before proceeding?

Thank you

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1341
    • View Profile
    • Robots in Architecture
Re: Using current position to create virtual lines
« Reply #3 on: May 13, 2021, 07:48:54 PM »
Hello,

Do you have a bit of experience working with .Net / Visual Studio? I could send you a utility for the communication.

Best,
Johannes

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1341
    • View Profile
    • Robots in Architecture
Re: Using current position to create virtual lines
« Reply #4 on: May 13, 2021, 07:59:03 PM »
Irrespective of the communication, that's the way to go towards stopping when a button is pressed:
https://www.robot-forum.com/robotforum/thread/31649-kuka-interrupts/?postID=146700#post146700
I would first do those changes by hand and then if you need them done automatically in KUKA|prc, you can either use Custom KRL components or edit the code pattern in Settings/Advanced/Code so that e.g. the interrupt is always declared. Probably you would need to use both.
Best,
Johannes

kratzsci

  • Forum User
  • *
  • Posts: 10
    • View Profile
Re: Using current position to create virtual lines
« Reply #5 on: May 13, 2021, 08:26:11 PM »
Johannes,

Yes, I have some experience with .NET/VisualStudio. I have been able to get the robot to stop it's movement when the button is pressed, that is not the issue I'm facing. I'm trying to get the robot to determine the boundaries of an object and then move to known locations within those boundaries.

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1341
    • View Profile
    • Robots in Architecture
Re: Using current position to create virtual lines
« Reply #6 on: May 14, 2021, 08:50:42 AM »
Hello,

I've uploaded some code on GitHub that you can run on the Windows side of your KUKA robot, it can access KUKA variables through two DLLs that you need to get in the right version from your robot:
KukaRoboter.Common.XmlResources.dll
KukaRoboter.LegacyKrcServiceLib.dll

Make sure those DLLs are next to the EXE after building it. You could modify to also e.g. send the status of a digital input as well, so that you only save data when the button is pressed. If you are querying the Cartesian position (e.g. $POS_ACT.X, see commented out parts) note that a tool and base need to be set.

I did that a couple years ago and don't quite remember if you need to open ports in the KUKA's NAT settings for it. Could be.

In any case, do NOT change any network settings (firewall, IP etc.) on the Windows side of the robot, you've got a good chance of breaking things.

In Grasshopper, the plugin Firefly contains a UDP listener (note that it needs an attached Timer component to check for new data), though any other socket implementation will work as well. You could also use PacketSender to check if any data is arriving.
KUKAVarProxy does something very similar, it's just a bit more effort to get to the data: https://github.com/ImtsSrl/KUKAVARPROXY

Just note that this is beyond the standard scope of Grasshopper and you will see that it can be challenging dealing with real-time data in Grasshopper. We had to do quite a few workarounds for mxAutomation in how it handles incoming, cyclical data.

https://github.com/jbraumann/KUKA-UDP-Sender

Best,
Johannes

singline

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 77
    • View Profile
Re: Using current position to create virtual lines
« Reply #7 on: May 14, 2021, 10:57:46 AM »
Nice work, Johannes

kratzsci

  • Forum User
  • *
  • Posts: 10
    • View Profile
Re: Using current position to create virtual lines
« Reply #8 on: May 14, 2021, 03:43:04 PM »
Thank you Johannes, I will look into that and will start working with the GitHub code you provided. Thank you so much for all your help!