Skip to content
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

Unable to use ur_kin_py in Python 3.6 #461

Open
hemanthsarabu opened this issue Oct 22, 2019 · 10 comments
Open

Unable to use ur_kin_py in Python 3.6 #461

hemanthsarabu opened this issue Oct 22, 2019 · 10 comments
Assignees

Comments

@hemanthsarabu
Copy link

hemanthsarabu commented Oct 22, 2019

I am trying to build and run ur_kin_py for a python 3 catkin workspace but have not been successful so far. I followed instructions from here, and replaced the line in the CMake file from find_package(PythonLibs 2.7 REQUIRED)
to find_package(PythonLibs 3.6 REQUIRED) and ran
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so.

When I then try to run test_analytical_ik.py , I get :Segmentation fault (core dumped)
And when I try to run import ur_kinematics.ur_kin_py.inverse in a python session, I see ImportError: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1: undefined symbol: PyClass_Type . I suspect I am building the library against boost for python 2 and not 3 and I'm not sure how to fix that. Has anyone dealt with this before?

Any help would be greatly appreciated!

Thanks!

@chinakwy
Copy link

chinakwy commented Jul 5, 2020

I'm stuck at this problem :( , did you fix it?
hopefully can get some help
Thanks!

@tungkw
Copy link

tungkw commented Mar 15, 2021

when I met the first problem Segmentation fault (core dumped), what I do is changing the path related to 'pyconfig.h'. In my case is from "/usr/include/python2.7/" to "/usr/include/python3.6/". And I edit the 'ur_kin_py.cpp' from

#include <boost/numpy.hpp>
#include <boost/scoped_array.hpp>
#include <boost/scoped_array.hpp>

namespace p = boost::python;
namespace np = boost::numpy;

to

#include <boost/python.hpp>
#include <boost/python/numpy.hpp>

namespace p = boost::python;
namespace np = boost::python::numpy;

For the second problem, I think it would be good to try somethings like -lboost_python3 -lboost_numpy3 when linking in cmake file.

@ipa-nhg ipa-nhg added the wrid21 label Sep 23, 2021
@dhled
Copy link

dhled commented Sep 29, 2021

Please assign this to me :)

@gavanderhoorn
Copy link
Member

While you're at it, you may want to take a look at https://github.com/ros-industrial/universal_robot/projects/1 as well.

There may be PRs there which affect this issue.

@dhled
Copy link

dhled commented Sep 29, 2021

So building using pybind as suggested in #453 seems to solve all python3 problems. I have tested on Python3.6 and 3.8, it seems to work fine.

The only problem is to fix the test_analytical_ik.py for python3 compatibility.

So how we should proceed ? I can try to fix/rebase the PR #453 and python3 compitibility but this might break other IK related PR.

@gavanderhoorn
Copy link
Member

Would you have an idea of how many of those PRs would get into trouble? All of them?

@dhled
Copy link

dhled commented Sep 29, 2021

This one #459 and maybe #358 (which combine 3 PR)

@gavanderhoorn
Copy link
Member

gavanderhoorn commented Sep 29, 2021

What about getting those merged first?

Would that be an option?

@dhled
Copy link

dhled commented Sep 29, 2021

Yes for #358.

For #459 it's pretty much useless if we merge #453 (or the rebased / updated version)

@gavanderhoorn
Copy link
Member

I'd be ok with merging #358 into melodic-devel-staging.

The rest of the IK related PRs should then also go into that branch.

Could you 'review' #358 and post a thumbs up there?

(you did test it, didn't you ? ;) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants