erazor83 / libdynamixel

a speedy C library for accessing Dynamixel AX servos
GNU General Public License v2.0
1 stars 1 forks source link

SWIG bindings... #4

Open erazor83 opened 11 years ago

erazor83 commented 11 years ago

Well, in theory it's possible to add swig bindings for python.

I did this with libmodbus some time ago, so anyone feel free to implement it ;-) The most complicated part would be the definiton of the interface which is more or less already given in my pylibmodbus: svn://ed-solutions.de/e-design/pub/pylibmodbus

Personally I don't think such a binding would make sense since in the future there'll be a usermode service which you can directly access via ZeroMQ ( https://github.com/erazor83/dynamixel_zmq )

TobiasSimon commented 11 years ago

OK, but so far it's only a library. We can have bindings for it and later on we can create a service which does the zmq stuff. So the user has basically multiple options to use the library.

erazor83 commented 11 years ago

I've added an example and also some minor changes to the cmake files. Calling "cmake . && make " should build everything correctly.

Still there seems to be an error which I couldn't fiddle out. I've looked at the output of my python-libmodbus and there is indeed a defined init function. But the stuff SWIG did here does not contain any.

Traceback (most recent call last):
  File "ping.py", line 8, in 
    import dynamixel
  File "../dynamixel.py", line 26, in 
    _dynamixel = swig_import_helper()
  File "../dynamixel.py", line 22, in swig_import_helper
    _mod = imp.load_module('_dynamixel', fp, pathname, description)
ImportError: dynamic module does not define init function (init_dynamixel)
TobiasSimon commented 11 years ago

I get: tobi@gauss:~/libdynamixel/contrib/python-swig/examples$ python ping.py Traceback (most recent call last): File "ping.py", line 13, in ctx=dynamixel.dynamixel_t() AttributeError: 'module' object has no attribute 'dynamixel_t'

erazor83 commented 11 years ago

Well, it seems to throw out different errors for python2 and python3. Normally SWIG should create functions like new_dynamixel_t() or something similar. No idea why it doesn't at the moment.