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

Missed python module definition and setup.py script #364

Merged
merged 3 commits into from
Jul 29, 2018

Conversation

ipa-nhg
Copy link
Member

@ipa-nhg ipa-nhg commented Jul 11, 2018

Related to #293

@ipa-nhg ipa-nhg mentioned this pull request Jul 11, 2018
@@ -0,0 +1 @@
from ur_kinematics import *

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import is not required. An empty __init__.py file is sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, it is within the same package. The init file can be empty

@gavanderhoorn
Copy link
Member

Suggestion: can we please rebase as much as possible, instead of merging in kinetic-devel all the time? Let's try to keep the commit history sane.

@ipa-nhg
Copy link
Member Author

ipa-nhg commented Jul 26, 2018

@gavanderhoorn yes! sorry, I clicked the button "update branch" of the PR to verify the commit with Travis. But you are right, it is horrible for the history of the repo...

@gavanderhoorn
Copy link
Member

No need to apologise.

Let's just keep it in mind.

@Chamango90
Copy link

Reviewed and accepted

@gavanderhoorn gavanderhoorn merged commit f15aa40 into ros-industrial:kinetic-devel Jul 29, 2018
@gavanderhoorn
Copy link
Member

Thanks @ipa-nhg for fixing this.

AustinDeric pushed a commit to AustinDeric/universal_robot that referenced this pull request Nov 11, 2018
Merged commits:

* missed python module definition and setup.py script
* clean the __init__ file
dhled pushed a commit to dhled/universal_robot that referenced this pull request Dec 17, 2018
Merged commits:

* missed python module definition and setup.py script
* clean the __init__ file
@pidipidi
Copy link

pidipidi commented Feb 5, 2019

I cannot still find a python module, ur_kin_py when I run test_analytical_ik.py. Here is the message,

"ImportError: No module named ur_kin_py"

I am not an expert for the python wrapper, but I could not find any setup for ur_kin_py.cpp in CMakeList.

@cambel
Copy link

cambel commented Mar 13, 2019

@pidipidi Yeah I found the same error, after trying many things I manage to made it work.

Here is what I did:
First, make sure you have installed Boost.Numpy, if not you can install it from source:

sudo apt-get install build-essential python-setuptools libatlas-dev libatlas3gf-base

git clone https://github.com/ndarray/Boost.NumPy
cd Boost.NumPy
cmake .
make
make install

Then in the CMakeLists.txt file, you have to add the following

find_package(PythonLibs 2.7 REQUIRED)
... 
###########
## Build ##
###########
...
PYTHON_ADD_MODULE(ur_kin_py src/ur_kin_py.cpp)
target_link_libraries(ur_kin_py ur3_kin boost_python boost_numpy ${PYTHON_LIBRARIES} ${Boost_LIBRARIES} )

set_target_properties(ur_kin_py PROPERTIES 
                      LIBRARY_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_PYTHON_DESTINATION})
...
#############
## Install ##
#############
install(TARGETS ur_kin_py
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}
)
...

Note that I link the library just with the ur3_kin, if you need a different robot, you can change it.

Then you can test with the test_analytical_ik.py but you have to also fix the import line on this file:
from ur_kinematics.ur_kin_py import forward, inverse
then it should work fine.

Finally, if you encounter the problem of libboost_numpy.so: cannot open shared object file just update your LD_LIBRARY_PATH with the location of your library, in my case /usr/local/lib64

Hope it helps!

ipa-nhg added a commit to ipa-nhg/universal_robot that referenced this pull request Jul 2, 2019
Merged commits:

* missed python module definition and setup.py script
* clean the __init__ file
ipa-nhg added a commit to ipa-nhg/universal_robot that referenced this pull request Jul 2, 2019
Merged commits:

* missed python module definition and setup.py script
* clean the __init__ file
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

Successfully merging this pull request may close these issues.

5 participants