IronPython inspect.py

Hello!

I am trying to use open_abb (https://github.com/robotics/open_abb) in GH_Python however whenever I try to send a message to an ABB robot I recieve this error:

Runtime error (KeyNotFoundException): main

Traceback:
line 456, in getsourcefile, "C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\inspect.py"
line 1030, in getouterframes, "C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\inspect.py"
line 1052, in stack, "C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\inspect.py"
line 307, in send, "C:\Users\user\Desktop\RobArch\abb.py"
line 141, in set_tool, "C:\Users\user\Desktop\RobArch\abb.py"
line 506, in getmodule, "C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\inspect.py"
line 1001, in getframeinfo, "C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\inspect.py"
line 36, in init, "C:\Users\user\Desktop\RobArch\abb.py"
line 16, in script

My only idea is that I am not properly loading the abb.py module into IronPython.

Hi @bdn29

can you get this to work in the _EditPythonScript editor?

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

No, I have not been able to get it working in the Rhino Python script editor.

Can you try activating these two options in the _EditPythonScript editor Tools -> Options dialog, restart, and see if it helps?

I have a feeling that the ABB Python driver really might be a CPython module, but maybe it’s not the case.

It is a CPython module: https://github.com/robotics/open_abb/tree/fuerte-devel/abb_node/src

Yeah @nathanletwory but the .py file does not seem to use that file:

but maybe I am missing something. I am really not an expert on that part.

Did you try that @bdn29 ?

Enabling Frames and Tracing did not fix the error in GH_Python.

I’m not sure if abb.py uses any of the c++ files in the git. I am able to get past the error and connect to the Robot by using GH_CPython. However, GH_CPython forces Grasshopper + Rhino to crash when I send more than 9 poses to the robot :confused:

I did happen to find gh-python-remote which allows me to connect to an external instance of python. abb.py has worked flawlessly in my native python so I think this will work!

Thanks for all of the help!

1 Like

It would be great to know if you get it to work with gh-python-remote.

Thanks @bdn29!