I'm running hydro and switching over from new rosbuild to using catkin. I read through the catkin conceptual overview and tutorials but have trouble implementing.
I'm trying to get the tilting hokuyo set up. I 'catkinized' the hrl_hardware_drivers but having trouble with the hrl_lib. It wasn't included in the package so I found it externally. When I run:
rosrun hrl_hokuyo hokuyo_processing.py
It goes me the error:
src/hrl_hokuyo/hokuyo_processing.py", line 43, in import hrl_lib.transforms as tr ImportError: No module named hrl_lib.transforms
I believe the cmakelist and package.xml file was edit appropriately to include hrl_lib. I want to do it right and not just add the hrl_lib folder into the directory.
Thanks!
Heres is the cmake
cmake_minimum_required(VERSION 2.8.3)
project(hrl_hokuyo)
find_package(catkin REQUIRED COMPONENTS hokuyo_node sensor_msgs rospy hrl_lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
catkin_package(
DEPENDS hokuyo_node sensor_msgs rospy hrl_lib
CATKIN_DEPENDS # TODO
INCLUDE_DIRS # TODO
LIBRARIES # TODO
)
Here is the package.xml
<package>
<name>hrl_hokuyo</name>
<version>1.0.0</version>
<description>Python class that uses hokuyo_node from ros-pkg to get scans from
UTMs and player to get scans from URGs.</description>
<maintainer email=""></maintainer>
<license>New BSD</license>
<url type="website"></url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>hokuyo_node</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>rospy</build_depend>
<build_depend>hrl_lib</build_depend>
<run_depend>hokuyo_node</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>rospy</run_depend>
<run_depend>hrl_lib</run_depend>
</package>
Edit #1
I'm still having trouble with it. Is the hrl_lib package just a folder with the python files in it? This doesn't feel right since there are other folders with the library as well. Here is my structure:
/path_to_workspace/
/src
/hrl_hokuyo
/setup.py
/src
/hrl_hokuyo
/hrl_lib
Thanks for the quick response and breaking it down for me.
Edit#2
I didn't edit it much except just setting the path.
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['hrl_lib'],
package_dir={'/path_to_directory_containing_hrl_lib/': 'src'}
)
setup(**d)
Originally posted by pwong on ROS Answers with karma: 447 on 2013-10-22
Post score: 0
Original comments
Comment by pwong on 2013-10-22:
Thanks for the comment and telling me the preferred method to posting responses!
Comment by William on 2013-10-22:
Can you post your setup.py? It is likely that you are not declaring your packages correctly.
Comment by William on 2013-10-22:
Another option is for you to push this to github (or something similar) and point me to it.
Comment by pwong on 2013-10-22:
I'll work on putting this onto github
Comment by William on 2013-10-22:
I think you have the package_dir
wrong, see my edit to my question and this: http://docs.python.org/2/distutils/setupscript.html#listing-whole-packages