-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does KDL have python3 binding? #115
Comments
If you compile python_orocos_kdl with |
@ahcorde I complie it with py3.5, but when import the module PyKDL, segmentfault will appear. Then I wrapper it with boost.Python https://github.com/foolyc/PyKDL |
I think it needs a standalone release package for python3. |
@zchen24 I cannot install PyKDL for python 3 as you described. If I try it for the Master branch, PyKDL does not even compile as multiple functions want to access "‘updateInternalDataStructures’", which is not a member function for multiple classes (e.g. class KDL::ChainIkSolverPos_LMA, class KDL::ChainIkSolverVel_wdls) If I try it for the Release 1.3 branch , I can compile PyKDL and create the *.so. However, if I import the module using python 3.6, I get the following error: "ImportError: dynamic module does not define module export function (PyInit_PyKDL)" Do you have any idea what causes the problem? |
@MichaelLutter I can reproduce your error. Please try this commit 6fe130a "ImportError: dynamic module does not define module export function (PyInit_PyKDL)" |
@MichaelLutter Can you try the master branch again? Make sure you have a clean build directory for python_orocos_kdl. (e.g. remove your existing build folder and create a new one) |
@zchen24 Thanks for the fast answer. When I try to compile 6fe130a, I get compilation errors. I copied the compilation errors below. Regarding the Master Branch, this branched has not changed recently. However, I deleted the build folder and built PyKDL from scratch and it still fails with 'updateInternalDataStructures'. "The compiled version is for Python 2, which does not have this PyInit_PyKDL function." What do you mean by that? Can one make PyKDL work under Python3? 6fe130a Compilation Errors: |
Sorry, that was my bad, I compiled the PyKDL with the Version shipped in ROS Lunar. When I adapted the KDL location, I can compile 6fe130a without any errors. However, if I copy the resulting *.so to the python packages, I still get the Python Error: "ImportError: dynamic module does not define module export function (PyInit_PyKDL)" Is there any way to solve this error? |
This error happens when python 3 tries to load a python 2 module. Try cd to
your python_orocos_kdl build directory (where the PyKDL.so file is), then
run python and try to import PyKDL
…On Sun, May 13, 2018 at 11:01 AM Michael ***@***.***> wrote:
Sorry, that was my bad, I compiled the PyKDL with the Version shipped in
ROS Lunar. When I adapted the KDL location, I can compile 6fe130a
<6fe130a>
without any errors. However, if I copy the resulting *.so to the python
packages, I still get the Python Error:
"ImportError: dynamic module does not define module export function
(PyInit_PyKDL)"
Is there any way to solve this error?
[image: ccmake_pykdl]
<https://user-images.githubusercontent.com/10160295/39970213-05b6fdd6-56e8-11e8-99ef-4f03618af225.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACpvTzblZ5_K7Ehf-7jTU_28AnTfhpyAks5tyHRXgaJpZM4QdJz3>
.
|
So I figured out, why python 3 wanted to import the python 2 module. I needed to unset my PYTHONPATH as PYTHONPATH did still point to python 2. However, if I now import the correct PyKDL.so, I get a new error: ImportError: /.../orocos_kinematics_dynamics/python_orocos_kdl/build/PyKDL.so: undefined symbol: _ZNK3KDL20ChainIkSolverPos_LMA8strErrorEi |
Pretty sure this means that PyKDL.so is linking to the wrong orocos_kdl.so
file. Check your library path.
…On Sun, May 13, 2018 at 12:15 PM Michael ***@***.***> wrote:
So I figured out, why python 3 wanted to import the python 2 module. I
needed to unset my PYTHONPATH as PYTHONPATH did still point to python 2.
However, if I now import the correct PyKDL.so, I get a new error:
ImportError:
/.../orocos_kinematics_dynamics/python_orocos_kdl/build/PyKDL.so: undefined
symbol: _ZNK3KDL20ChainIkSolverPos_LMA8strErrorEi
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACpvT4N5rZK0EIDX6fxCxfWmgWIY7TO6ks5tyIYOgaJpZM4QdJz3>
.
|
@zchen24 Thanks for the awesome help. It was a problem with the Library Path. However, I noticed that PyKDL causes a segmentation fault, if you input a string to any PyKDL function. E.g. kdl.Tree('HelloWorld') causes a segmentation fault for me. I guess it has to do with the change from byte strings to unicode strings in Python 3. Did you ever get PyKDL to completely work under Python3? |
@foolyc I assume this issue can be closed? |
i just tried to follow instructions of building python3 version.
|
actually, realised there was pip-installed sip of wrong version. removed it and the problem is gone |
You could check the travis config file. As both python 2 as python 3 versions are build and tested in travis. There should be no difference in available API between PyBind11 and sip. To be honest I have no idea which one has better performance. I recommend the PyBind11 version. As some sip version have a bug which caused #41. By using PyBind11 you are sure you don't have this bug. |
@MatthijsBurgh Great! Thank you, worked like a charm (when I run this in a clean environment, without all the variables created by the ROS setup file which I had sourced in my .zshrc). |
Hello I am trying to read a urdf file but I get error as
It never used to happen on melodic with python2.7. I am not sure whether its a problem with the package urdf_parser_py or is it with PyKDL?. I get the error when i try to execute,
I think my problem is similar to this, #115 (comment) and I think this is the solution, #145 (comment) But I am not sure how should I edit and incorporate the changes mentioned above. My urdf file is,
|
@Murtaza786-oss Please open a new issue. It is completely not related to the original issue. |
In python3, how to use KDL? or any other recommended tools?
The text was updated successfully, but these errors were encountered: