Modi1987 / iiwaPy

A python package for controlling Kuka iiwa from an external PC
MIT License
35 stars 11 forks source link

PTP movements not working #2

Closed axkoenig closed 4 years ago

axkoenig commented 5 years ago

Hello,

thanks for this software! The real-time control tutorial works well. However, now I am trying to do a simple PTP movement with the iiwaPy toolbox. It seems that the toolbox waits for a response forever. How can I solve this?

This is my code:

from sunrisePy import sunrisePy
import time 

ip='172.31.1.147'
iiwa=sunrisePy(ip)
time.sleep(4)

pi = 3.1415
rel_vel = [0.15]
iiwa.movePTPJointSpace([0,0,0,-pi/2,0, -pi/2,0], rel_vel)
iiwa.movePTPHomeJointSpace(rel_vel)

iiwa.close()

And this the error message (I quit execution after a while with Ctrl + C):

python /home/USER/iiwaPy/python_client/test.py
^CTraceback (most recent call last):
  File "/home/USER/iiwaPy/python_client/test.py", line 19, in <module>
    iiwa.movePTPJointSpace([0,0,0,-pi/2,0, -pi/2,0], rel_vel)
  File "/home/USER/iiwaPy/python_client/sunrisePy.py", line 32, in movePTPJointSpace
    self.ptp.movePTPJointSpace(jpos,relVel)
  File "/home/USER/iiwaPy/python_client/PTP.py", line 255, in movePTPJointSpace
    self.send(command)
  File "/home/USER/iiwaPy/python_client/PTP.py", line 22, in send
    self.mysoc.receive()
  File "/home/USER/iiwaPy/python_client/mySock.py", line 33, in receive
    data = self.sock.recv(1)                     
KeyboardInterrupt

Has this python toolbox been tested and is ready to be used? Or do you recommend to stick with your Matlab Client for the KST for now?

Thanks for the help, Alex

wafflecat commented 4 years ago

Did you manage to find a solution? I'm experiencing the same problem.

axkoenig commented 4 years ago

Unfortunately I didn’t find a solution. I just used the Matlab Toolbox instead. But would much rather implement it in python...

Modi1987 commented 4 years ago

Hi guys:

The cod in here was not complete, I updated the PTP motion class, now it works fine, check Tutorial_PTPmotion.py for an example.

Cheers!