surgical-robotics-ai / surgical_robotics_challenge

Interactive Robot Assisted Suturing Simulation
59 stars 45 forks source link

Error running gui_based_control.py #82

Closed sunshineinsandiego closed 1 year ago

sunshineinsandiego commented 1 year ago

Hi - I am trying to run gui_based_control.py but am receiving the error:

$ python3 gui_based_control.py 
Traceback (most recent call last):
  File "surgical_robotics_challenge/scripts/surgical_robotics_challenge/examples/gui_based_control.py", line 45, in <module>
    from surgical_robotics_challenge.kinematics.psmIK import *
  File "surgical_robotics_challenge/scripts/surgical_robotics_challenge/kinematics/psmIK.py", line 46, in <module>
    from PyKDL import Vector, Rotation, Frame, dot
ModuleNotFoundError: No module named 'PyKDL'

The AMBF simulator is running fine with the suture challenge launch file. But when I try to run gui_based_control.py, I receive that error.

I tried installing to the system:

$ sudo apt-get install python3-pykdl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pykdl is already the newest version (1.4.0-7ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

I also re-installed the modules:

$ pip3 install -e .
Obtaining file:///surgical_robotics_challenge/scripts
  Preparing metadata (setup.py) ... done
Installing collected packages: surgical-robotics-challenge
  Attempting uninstall: surgical-robotics-challenge
    Found existing installation: surgical-robotics-challenge 1.0
    Uninstalling surgical-robotics-challenge-1.0:
      Successfully uninstalled surgical-robotics-challenge-1.0
  Running setup.py develop for surgical-robotics-challenge
Successfully installed surgical-robotics-challenge-1.0

And I located the PyKDL shared object file:

/usr/lib/python3/dist-packages$ find -type f -name "PyKDL*.so"
./PyKDL.cpython-38-x86_64-linux-gnu.so

So it exists, but:

$ python3 -c "import PyKDL"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyKDL'

Any thoughts would be appreciated, thanks!

sunshineinsandiego commented 1 year ago

Ah, this is fixed! Lots of workarounds which I will document later in case anyone also needs help!

alfassyn commented 1 year ago

Ah, this is fixed! Lots of workarounds which I will document later in case anyone also needs help!

Hi @sunshineinsandiego
How did you resolve the problem of PyKDL? I got the same problem.