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

rosmsg can't find message in my catkin workspace

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

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

Hi all—

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

http://www.ros.org/wiki/ROS/Tutorials/CreatingPackage http://www.ros.org/wiki/ROS/Tutorials/CreatingMsgAndSrv

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:

/home/mikepurvis/catkin_ws/install/share:/home/mikepurvis/catkin_ws/install/stacks:/opt/ros/groovy/share:/opt/ros/groovy/stacks
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

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

William gravatar image

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

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:

http://answers.ros.org/question/49143/problems-with-rqt-groovy-ubuntu/?answer=49153#post-id-49153

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:

william@dosa:~
% rosmsg packages
actionlib
actionlib_msgs
bond
diagnostic_msgs
driver_base
dynamic_reconfigure
geometry_msgs
nav_msgs
roscpp
rosgraph_msgs
rospy_tutorials
sensor_msgs
shape_msgs
std_msgs
stereo_msgs
tf
tf2_msgs
trajectory_msgs
turtlesim
visualization_msgs

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

Comments

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 -0600 )edit

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

William gravatar image William  ( 2013-04-12 13:57:23 -0600 )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 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 10,554 times

Last updated: Apr 12 '13