Ask Your Question

Installing a catkin package without work space

asked 2013-12-04 07:17:08 -0500

florent-lamiraux gravatar image

updated 2013-12-04 17:09:50 -0500

Thomas gravatar image

To my understanding, catkin provides 2 different functionalities:

  1. a way to handle dependencies between packages in the installation process and
  2. a tool to create ROS services and messages.

As I am already using appropriate tools for 1, I wish to use catkin only for 2. In other words, I use catkin macros add_message_files, add_service_files to generate the source code relative to my services and topics, but I want to install my package in the standard way:

mkdir build
cd build
make install

I use CATKIN_PACKAGE_BIN_DESTINATION cmake macro as defined by REP 122 to install package relative executable and scripts.

As expected, cmake installs my executables in myprefix/lib/pkg-name with execution rights for everyone.

However, when I type rosrun pkg-name executable, i.e. rosrun dynamic_graph_bridge run_command I get the following message:

[rosrun] Couldn't find executable named run_command below /home/florent/devel/ros/install/share/dynamic_graph_bridge

when as explained before run_command is in /home/florent/devel/ros/install/lib/dynamic_graph_bridge.

my ROS_PACKAGE_PATH contains /home/florent/devel/ros/install:/opt/ros/groovy/share:/opt/ros/groovy/stacks

What did I wrong? Why does the error message seem inconsistent with REP 122?

I run groovy on ubuntu-12.04 32bits. The package can be found at

edit retag flag offensive close merge delete



Catkin itself actually doesn't provide the macros for message and service creation—it provides the mechanism by which those other packages may inject CMake functions in at the find_package point.

mikepurvis gravatar image mikepurvis  ( 2013-12-05 00:50:14 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2013-12-05 06:20:39 -0500

Dirk Thomas gravatar image

updated 2013-12-05 06:23:27 -0500

The ROS_PACKAGE_PATH is not sufficient to find scripts in a workspace with FHS layout.

The setup files in a catkin workspace are also defining the CMAKE_PREFIX_PATH which lists all workspace root folders. And those folders contain an empty .catkin marker file. rosrun uses these paths to identify locations where executables may be located.

edit flag offensive delete link more

answered 2013-12-05 00:55:46 -0500

Catkin also manages the workspace setup file. Are you opposed to using the provided workspace setup?

source /home/florent/devel/ros/install/setup.bash
rosrun dynamic_graph_bridge run_command

Also, for more insight into what's going on, try checking the output of catkin_find as well.

edit flag offensive delete link more


Thank you for your answer. I tried to source /home/florent/devel/ros/install/setup.bash without modifying any ROS_ environment variable and I get the following environment:

student@student-virtualbox:~$ env | grep ROS

Unfortunately, /home/student/devel/sot/install/lib is not in ROS_PACKAGE_PATH and rosrun dynamic_graph_bridge run_command still fails.

florent-lamiraux gravatar image florent-lamiraux  ( 2013-12-05 04:32:44 -0500 )edit

It is nearly impossible to read your comment above. If you edited your question to format that information, it would be easier to help. A common cause of failures like this is having failed to source the ROS distro setup properly *before* creating the workspace. People often skip that step.

joq gravatar image joq  ( 2013-12-05 04:39:18 -0500 )edit

Hmm, not sure what else to suggest. Maybe first check that you can build the package as usual with `catkin_make` before attempting this alternative approach? Consider also updating your question with clarification about what it is you're trying to avoid and why; there may be an easier way.

mikepurvis gravatar image mikepurvis  ( 2013-12-05 07:20:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-12-04 07:17:08 -0500

Seen: 1,118 times

Last updated: Dec 05 '13