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

catkin_make is looking for package.xml in wrong directory?

asked 2014-09-11 20:03:49 -0500

T-R0D gravatar image

updated 2014-09-17 00:16:54 -0500

EDIT: I still haven't found a definitive answer (so I am not posting this as an answer), but I got frustrated, re-installed ROS, and took great care to update my ROS_PACKAGE_PATH environment variable as instructed here. I would still like to see a complete explanation of the solution if possible, but now I can let the community know that this question is not longer urgent for me.

Hi. I am trying to complete the actionlib tutorials. This issue is mostly unrelated to actionlib. Can someone please help me resolve this problem?

I am trying to create a new catkin package for the tutorial. My shell commands go like this:

source /opt/ros/hydro/setup.bash
mkdir -p ROS_TUTORIALS/actionlib_ws/src
cd ROS_TUTORIALS/actionlib_ws/src
cd ..
source devel/setup.bash
cd src
catkin_create_pkg learning_actionlib actionlib message_generation roscpp rospy std_msgs actionlib_msgs
# I add some files and change CMakeLists.txt as specified here:
cd ../..

The error I get is this:

CMake Error: File /home/<username>/ROS_TUTORIALS/actionlib_ws/src/package.xml does not exist.
CMake Error at /opt/ros/hydro/share/catkin/cmake/stamp.cmake:10 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  /opt/ros/hydro/share/catkin/cmake/catkin_package_xml.cmake:61 (stamp)
  /opt/ros/hydro/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)
  /opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:95 (catkin_package_xml)
  CMakeLists.txt:7 (catkin_package)

This is preceded by some success/status messages, and further error messages follow (they are dependent on the above error) .

I have reviewed the tutorials, and repeated them several times, and my directory appears to have the correct structure. For clarification:

actionlib_ws/        # the catkin workspace

Sorry if I wrote too much, I wanted to help whoever tries to answer my question as much as possible. Thanks in advance for any help!

edit retag flag offensive close merge delete


Thumbs up for providing that much information. Nowadays many new users simply say they have a problem and that's it.

BennyRe gravatar image BennyRe  ( 2014-09-12 00:15:33 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-17 18:28:10 -0500

Dirk Thomas gravatar image

I ran your commands with two little modification: no changes to the new package learning_actionlib after creation and the second last line must be cd .. (not cd ../..). And everything works fine - so the problem is likely something which you did not mention.

edit flag offensive delete link more

answered 2014-09-12 00:26:58 -0500

BennyRe gravatar image

If your command sequence is the one you executed, there's the error.

If I get it right you run your first catkin_make inside ROS_TUTORIALS/actionlib/src

This seems strange to me because this should complain, that the source space does not exist. Or did you just forgot to post a cd .. ?

Run catkin_make in the root of your workspace. (in your case ROS_TUTORIALS/actionlib)

Also you have to run source devel/setup.bash from your catkin root directory.

Your second catkin_make is also executed in the wrong directory.

Your directory structure is also not right. The pacakge.xml and CMakeLists.txt shouldn't be in the source dir of your package. They have to be in the root dir of your package. See this site for a correct catkin workspace structure.

(Side notice: I wouldn't name my workspace 'actionlib' as this is already the package name of the actionlib package. I would prefer actionlib_ws.)

edit flag offensive delete link more


There was a missing cd .., I have made edits to the question to show the appropriate sequence of commands (Sorry, I wrote the question from memory in class). I also updated the directory structure.

T-R0D gravatar image T-R0D  ( 2014-09-14 10:53:24 -0500 )edit

But the issue still remains. It's like catkin_make is refusing to look inside the learning_actionlib folder for package.xml. The top level CMakeLists.txt does have a line that says project(learning_actionlib) so I would think that the package should be find-able. I could be wrong though...

T-R0D gravatar image T-R0D  ( 2014-09-14 10:54:47 -0500 )edit

Question Tools

1 follower


Asked: 2014-09-11 20:02:23 -0500

Seen: 2,725 times

Last updated: Sep 17 '14