ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Automatic installation of rosbridge_library

asked 2016-05-01 15:19:01 -0600

SimonB gravatar image

Hi,

I'm working on a ROS Package that includes various dependencies, including Python libraries like ws4py and bson, as well as the ROS Package rosbridge_library. I've managed to configure CMakeLists.txt and package.xml to install the Python dependencies no problem, but for the life of me I can't get catkin_make to install rosbridge_library.

If I manually install the dependency with

sudo apt-get install ros-indigo-rosbridge-server

then catkin_make, my code works fine. If not, I get:

CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "rosbridge_library"
  with any of the following names:

    rosbridge_libraryConfig.cmake
    rosbridge_library-config.cmake

  Add the installation prefix of "rosbridge_library" to CMAKE_PREFIX_PATH or
  set "rosbridge_library_DIR" to a directory containing one of the above
  files.  If "rosbridge_library" provides a separate development package or
  SDK, be sure it has been installed.

But I was under the impression that if I defined the dependency correctly then catkin_make should automatically download and install rosbridge_library without me having to do it manually. Now I'm starting to doubt it! Am I correct?

I'm using CircleCI to build on a new machine every time. Here is the exact sequence that I run:

 sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
 sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
 sudo apt-get update
 sudo apt-get install ros-indigo-ros-base
 sudo rosdep init
 rosdep update
 echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc

 mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src && catkin_init_workspace
 mkdir -p ~/catkin_ws/src/luxagent && cp -r ~/luxagent/* ~/catkin_ws/src/luxagent
 pip install 'gevent==1.0.2'
 echo "export PYTHONPATH=/usr/lib/python2.7/dist-packages:${PYTHONPATH}" >> ~/.bashrc
 cd ~/catkin_ws/ && catkin_make

If after, the first block of commands I run

sudo apt-get install ros-indigo-rosbridge-server

then it all works fine.

Here are the relevant lines in package.xml:

  <build_depend>python-catkin-pkg</build_depend> 
  <build_depend>rosgraph</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>python-gevent</build_depend>
  <build_depend>python-ws4py-pip</build_depend>
  <build_depend>rosbridge_library</build_depend>

  <run_depend>python-catkin-pkg</run_depend> 
  <run_depend>rosgraph</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>python-gevent</run_depend>
  <run_depend>python-ws4py-pip</run_depend>
  <run_depend>python-bson</run_depend>
  <run_depend>rosbridge_library</run_depend>

Here are the relevant lines in CMakeLists.txt:

find_package(catkin REQUIRED COMPONENTS
  rosbridge_library
  rosgraph
  raspy
)

and

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES luxagent
   CATKIN_DEPENDS rosgraph rospy rosbridge_library
#  DEPENDS system_lib
)

I've tried substituting rosbridge_suite for rosbridge_library but the effect is the same. I would love to make the installation of this library automatic for the end user.

Any suggestions appreciated!

Thanks

Simon

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-05-01 15:24:32 -0600

gvdhoorn gravatar image

updated 2016-05-01 15:27:24 -0600

But I was under the impression that if I defined the dependency correctly then catkin_make should automatically download and install rosbridge_library without me having to do it manually. Now I'm starting to doubt it! Am I correct?

No, that is not correct. Installing dependencies is rosdeps responsibility. Finding dependencies is catkins task.

I don't see a

rosdep install --from-paths /path/to/your/catkin_ws --ignore-src

anywhere in the sequence of commands that you listed. You should add it before trying to catkin_make your workspace.


Edit: also, for Python-only projects, you don't actually need any of your Python libraries / components listed as COMPONENTS in your find_package(catkin REQUIRED ..) command. Python libraries are not build_depends, so you should not try to find them at build/configuration time.

Unless of course there are some native parts in them that need to get build, but I don't have any direct experience with that.

edit flag offensive delete link more

Comments

That worked! Thanks so much! Every time I think I've got a handle on what Catkin does, I find I'm still in the dark. Your comment has cleared it up, at least for now.

SimonB gravatar image SimonB  ( 2016-05-01 16:00:32 -0600 )edit

catkin == cmake (more or less). CMake doesn't install any dependencies either. For some more howto-like documentation on it, see catkin 0.6.18 documentation.

gvdhoorn gravatar image gvdhoorn  ( 2016-05-02 00:57:14 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-01 15:19:01 -0600

Seen: 1,366 times

Last updated: May 01 '16