Modi1987 / KST-Kuka-Sunrise-Toolbox

A ToolBox for controlling KUKA iiwa robot from matlab:
https://youtu.be/eh5s8PTe5VM
MIT License
164 stars 70 forks source link

Matlab Toolbox Server applications didn't run #4

Open Andy1897M opened 5 years ago

Andy1897M commented 5 years ago

Hi,

I‘ve already synchronized the MatlabToolboxServer .But when I run it,the program doesn't work and the error is about lbrExampleApplications-BackgroundTask.java in line 79 196 and some Unknown Source.I just add the KST_1.6_iiwa7R800_Universal_noFlange in the old lbrExampleApplication in an old sunrise project,because my classmate says create a new project would cover other's program.And when I copy the KST_1.7_iiwa_universal_noFlange_LTS and choose the software Direct and Smart,the PTPmotionClass.java has some problems that can't synchronize. And when I establish the connection in Matlab,it works and show the 'Connection established',but the next line show that 'Could not attach the tool to the Robot'. Someone says maybe the Java program has some problems,but I watch the tutorials that you could work.So I just wanna seek some advice if it is our iiwa's problems or I should change some softwares or so on.

Thanks a lot.

Modi1987 commented 5 years ago

Hi Andy: Regarding the issue,

I‘ve already synchronized the MatlabToolboxServer .But when I run it,the program doesn't work and the error is about lbrExampleApplications-BackgroundTask.java in line 79 196 and some Unknown Source.<

I was checking the MatlabToolboxServer class, line 79 contains the code-line: while((soc.isConnected())) The cause of the error could be a loss of connection. The fact that the program progressed through up to line 79 means that you could establish a connection with iiwa, but for some reason the connection is lost. On the other-hand the line 196 contains a comment: // MatlabToolboxServer.printMessage(MatlabToolboxServer.daCommand); I need more info. Can you show a photo of the error?

I just add the KST_1.6_iiwa7R800_Universal_noFlange in the old lbrExampleApplication in an old sunrise project,because my classmate says create a new project would cover other's program.<

It is perfectly OK if you use an old sunrise project or if you create a new project. Both ways shall work given that your project contains the Direct and Smart Servo packages.

And when I copy the KST_1.7_iiwa_universal_noFlange_LTS and choose the software Direct and Smart,the PTPmotionClass.java has some problems that can't synchronize.<

Can you list the lines where you have the error? if you can provide a photo, or a print screen of the error.

And when I establish the connection in Matlab,it works and show the 'Connection established',but the next line show that 'Could not attach the tool to the Robot'.<

Again the fact that you get the message 'Connection established', means a connection was established with the robot. On the otherhand the fact that you get the message 'Could not attach the tool to the Robot', means the message for the tool data is not being received correctly (with right length) at the robot side. I am not quite sure as to what the real reason is, but it seems to me kind of a connection problem. PS: Make sure that you disabled the firewall on the PC side.

Cheers

Andy1897M commented 5 years ago

I’m really appreciate you can give me some advice.I am sure that I had something wrong when I did this.I will try once when I go to the laboratory the next time. Once again,thanks for your advice.

Andy1897M commented 5 years ago

I'm really sorry to bother you again,but there are some problems or warnings we can not solve. First,our iiwa can't run the 'Matlab Application Server' in the automatic mode.Choosing that mode and click 'run',nothing happened and the button on the screen is grey.Maybe this iiwa need to be fixed. IMG20190312173025

And I try the T1 mode,it works. IMG20190312173251

But when I try to establish in Matlab,something gets wrong,and another warning it shows on the screen.I use two methods learned from the tutorial. Is that the 'RecordStatus: off' cause this?For the first time I try to establish, it showed ‘Status: off’,and it didn't show the 'Connection established'.Once I ran in the T1 mode,it turned 'Status: on',and we could see the 'Connection established'. And this time,it shows a new warning 'a timeout occured before the terminator was reached',in the pictures. IMG20190312171526 IMG20190312161256

This old photo doesn't have this warning. IMG20190306141626

And the sunrise OS gives these warnings. IMG20190312173755 IMG20190312173916

Because some people use the iiwa together,and the software in Sunrise Workbench is more than the software in the tutorial.Can this affects the connection?I'm not really sure,just some reasons I guess.

Modi1987 commented 5 years ago

Hi Andy,

I am going to ask you to synchronize the code in (KST_1.6_iiwa7R800_Universal_noFlange) into the robot, and then follow the steps as I tried to explain to you what to do in the following video:

Answer to issue #4

Regards

Andy1897M commented 5 years ago

I’m going to try it,thank you for answering these questions :)

Munrel commented 5 years ago

Hi, Thank you very very much for your help. Our robot can run as your video above by following those steps. I'm Andy's senior. Thanks for your help again.