KUKA_IIWA_Digital_IO_Error

Started by avishek, July 26, 2021, 01:57:15 PM

Previous topic - Next topic

avishek

Hello Johannes,

I was trying to send out a digital output signal to KUKA IIWA 14 R820 through grasshopper and encountered an error ( DIGOUT Error.PNG).
Can you please tell me how to resolve this error? Do I need to declare the iogroup at some place in the RunXML or RunUDP file ?

I have attached the screenshots from grasshopper and the error from the pendant.

thanks
Avishek

Johannes @ Robots in Architecture

Hello,

Sorry, there is no way to troubleshoot it from the screenshot, it just says that there is an object is null.
Did you reference your IO Group when setting up the communicator in Sunrise? If that is null, it would explain the error.

Best,
Johannes

avishek

Hi,

I did not know that IO Group had to be referenced. Now I have added this line to the communicator setup :
MediaFlangeIOGroup iogrp = new MediaFlangeIOGroup(kuka_Sunrise_Cabinet_1);
that seems to solve the problem for now. Is that all ?

Thanks

Johannes @ Robots in Architecture


avishek

Hi Johannes,

In the present scope of KUKA|prc, is there any way to read the current state of IOs of iiwas ?

Thanks

Johannes @ Robots in Architecture

Hello,

Not at the moment, though technically it's of course no problem at all.
If you look into the UDPSender.java you see that what it sends is basically...
return (new Integer(CmdQueue.size()).toString()) + "," + posstr + "," + cartstr + "," + forcevector;

The least needed data here is probably the forcevector string, which consists of...
String forcevector = df.format(force.getX()) + "," + df.format(force.getY())+ "," + df.format(force.getZ());

So instead of force.getX() you could get an IO state - just take care to turn it into a number, not "TRUE" or "FALSE" as a string.
In Grasshopper you could then just translate it back.

Best,
Johannes

avishek

Hi Johannes,

I have tried to take in account your suggestion and facing some trouble to get the IO States as force vector outputs. I have put a placeholder boolean and converted to a double and that value can be read in Grasshopper, so that works.
But when I am trying to pass/store the boolean value, read from the media flange, the program does not seem to work. I have followed the code structure in the UDPSender.java to modifiy the CollectPayload() function but the error is coming there. I am attaching a modified UDPSender.java file in the post. Could you please have a look and tell me where is it going wrong?

Thank you

Johannes @ Robots in Architecture

I haven't worked with an iiwa properly in a while, but my guess would be that you are instantiating the IO-Group once when the program starts and once in your thread.
Rather construct it once in the base program and then pass a reference to the thread through its constructor.
Also, maybe IOs just aren't threadsafe. What error message are you getting?

Best,
Johannes

avishek

Hi,

If I am using line 83, then I am getting this. Please see the attached image.

Thanks

Johannes @ Robots in Architecture

I guess that's the same problem as before, right?
Maybe try stepping through the code to see whether the entire IOGroup is null or just that method is causing problems. Also, try to run your code in the main program to see whether it's thread-related.
Best,
Johannes

avishek

In this case, the problem looks the same but last time RunUDP was running and when I was trying to pass a Digital IO then I was facing the problems. But now after enabling the line 83, I am getting the error while running RunUDP itself and the program is shutting down. I will try to run it in the main code and see what happens then.

Avishek

avishek

Hi Johannes,

With limited knowledge of Java and threading we have tried whatever we could to get the state of IO in the vector list. But with all the modifications we have done so far, we could not make it work and runUDP always gives an erros.
If you get some time, would you be kind enough to have a look at the issue?

Thank you
Avishek

Johannes @ Robots in Architecture

Hello,

Have you asked KUKA whether you can read/write outputs from a separate thread? If it's a fundamental limitation, then we cannot do anything anyway and need to move the logic into the main thread.
If you post your current code (both the main .java file where you initialize everything as well as the RunUDP.java file) I can of course also take a look at the code.

Best,
Johannes

avishek

Hi Johannes,

I am attaching the two files here the UDPSender and the RunUDP. In the RunUDP @ line 74 I have declared the default MediaFlange IO and in UDPSender @ line 83 I have tried to read one of the pin. In this state if I run the RunUDP, it fails and gives the error I had posted last time.
It will be great if you have a look and help us to find a way to read the IOs in Grasshopper. Meanwhile we will try to talk to KUKA.
Thank you

Avishek

Johannes @ Robots in Architecture

Hello,

Did you try passing the IO group via the constructor? So that UDPSender looks a bit like that:


public UDPSender(InetAddress externaladdress, int externalport, BlockingQueue<PRC_CommandData> UDPQueue, MediaFlangeIOGroup iogrp) throws SocketException {
socket = new DatagramSocket(30001);
address = externaladdress;
port = externalport;
CmdQueue = UDPQueue;
flangeIO = iogrp;
}


Currently you always recreate the IO group in the while loop:
flangeIO = new MediaFlangeIOGroup(cabinet);

Best,
Johannes