# catkin_make is looking for package.xml in wrong directory?

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:

cd
source /opt/ros/hydro/setup.bash
mkdir -p ROS_TUTORIALS/actionlib_ws/src
cd ROS_TUTORIALS/actionlib_ws/src
catkin_init_workspace
cd ..
catkin_make
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:
# http://wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionServer%28ExecuteCallbackMethod%29
cd ../..
catkin_make


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
src/
CMakeLists.txt
learning_actionlib/
package.xml
CMakeLists.txt
...
src/
...
devel/
...
build/
...


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 close merge delete

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

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

Sort by » oldest newest most voted

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.

more

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.)

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.

( 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...

( 2014-09-14 10:54:47 -0500 )edit