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

rosmsg can't find message in my catkin workspace

asked 2013-04-12 13:22:01 -0500

updated 2013-04-12 13:59:39 -0500

Hi all—

Just getting started with a catkin workspace and package, based on the following tutorials:

When I run catkin_make, I see that Python, C++, and lisp code is being generated from the msg file in my nnn_msgs package. And when I run catkin_make install, it looks like the Python sources get copied into the appropriate dist-packages directory. I've sourced the workspace/install/setup.bash file, so my PACKAGE_PATH and PYTHONPATH are correct. Indeed, I can pop open the Python REPL and import the message, so it's definitely being built, and is seems like the workspace is set up correctly.

However, rosmsg show xx can't find it, and rosmsg list gives no output either:

Unable to load msg [nnnn_msgs/Nnnn]: Cannot locate message [Nnnn]: unknown package [nnnn_msgs] on search path [{}]

How do I resolve this search path issue? How come it only seems to be affecting rosmsg?

Edit: Okay, looks like I've found another thing affected by this problem: rosversion won't run correctly, which means I can't run roscore. I thought this might have been because my .bashrc was sourcing a Fuerte setup.bash prior to me manually sourcing the Groovy one, but I removed that and it made no difference.

My ROS_PACKAGE_PATH looks okay:

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-04-12 13:42:10 -0500

William gravatar image

updated 2013-04-12 14:32:55 -0500

EDIT: Make sure you have the latest version of rospkg:

sudo apt-get update && sudo apt-get install python-rospkg

If that doesn't work then see this answer:

You might need to clear out a previous version installed by pip.

You must not have your ROS_PACKAGE_PATH set?

I can get output from rosmsg list and rosmsg packages locally:

% rosmsg packages

Your ROS_PACKAGE_PATH is not required for python importing to work, but it is required for tools like rosmsg to find .msg files which have been installed.

You can also ensure that your message files are getting installed by looking in path/to/install/share/nnnn_msgs/msg/ for the Nnnn.msg file.

edit flag offensive delete link more


My $ROS_PACKAGE_PATH seems like it's correct: /home/mikepurvis/catkin_ws/install/share:/home/mikepurvis/catkin_ws/install/stacks:/opt/ros/groovy/share:/opt/ros/groovy/stacks

mikepurvis gravatar image mikepurvis  ( 2013-04-12 13:56:16 -0500 )edit

What about rospack profile && rospack find nnnn_msgs does that work?

William gravatar image William  ( 2013-04-12 13:57:23 -0500 )edit

python-rospkg was the issue. Does this hit everyone upgrading from Fuerte, or was there something particular about my setup which triggered it?

mikepurvis gravatar image mikepurvis  ( 2013-04-12 16:55:49 -0500 )edit

This happens when you installed rospkg from pip at some point in the past. We used to recommend this method, but we have since reverted to using apt-get because pip does not upgrade with apt-get so people were getting mismatching versions. Unfortunately pip override apt python packages.

William gravatar image William  ( 2013-04-13 13:25:29 -0500 )edit

Question Tools


Asked: 2013-04-12 13:22:01 -0500

Seen: 10,415 times

Last updated: Apr 12 '13