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

Message generation fails after JADE update

asked 2016-01-20 17:51:50 -0500

Borob gravatar image

updated 2016-01-20 18:40:57 -0500


This morning I apt-get update and upgrade my Linux (14.04 Xubuntu). After this, catkin_make is not able to generate header files for a custom message of mine anymore. It worked before and I have all the necessary dependencies and message-generations set up.

After googling around here is what I tried but what was unsuccessful:

catkin_make clean #of course

catkin_make -j1 #Some reported that it would help to build one "jobbed"

Looking for my CustomMessage works:

rosmsg show my_package/CustomMessage

When I search in the devel/include/my_package I find no headerfile.

My Error that I get while building is, because the header file was not generated:

In file included from /home/username/catkin_ws/src/my_package/src/MyProgramm.cpp:1:0:
/home/username/catkin_ws/src/my_package/src/MyProgramm.h:5:37: fatal error: my_package/CustomMessage.h: No such file or directory
 #include "my_package/CustomMessage.h"

I want to stress out that this worked before. I even reverted the git repo of my catkin_ws to a previous state (where the header files were build correctly) and it does not work anymore.

Somehow the update of JADE is responsible for this, which is why I now show you, what was updated. Please help me.

Note: The only message that my custom message depends on is geometry_msgs/Pose.


So before the update log here my package.xml and CMakeList. I changed my packagename (my_package), my message (Custom_Message.msg) and my cpp file (MyProgram):


<?xml version="1.0"?>
  <description>The my_package package</description>

  <maintainer email="blabla">name</maintainer>







cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS



CATKIN_DEPENDS roscpp_serialization message_runtime


add_executable(my_package src/MyProgramm.cpp)


I am sorry for this mess, but I don't know any other way.

Preparing to unpack .../python-oneconf_0. ...^M
Unpacking python-oneconf ( over (0.3.7) ...^M
Preparing to unpack .../ros-jade-cv-bridge_1.11.9-0trusty-20151130-0054-+0000_amd64.deb ...^M
Unpacking ros-jade-cv-bridge (1.11.9-0trusty-20151130-0054-+0000) over (1.11.8-0trusty-20151110-1415-+0000) ...^M
Preparing to unpack .../ros-jade-image-geometry_1.11.9-0trusty-20151130-0101-+0000_amd64.deb ...^M
Unpacking ros-jade-image-geometry (1.11.9-0trusty-20151130-0101-+0000) over (1.11.8-0trusty-20151110-0900-+0000) ...^M
Preparing to unpack .../ros-jade-camera-calibration_1.12.14-0trusty-20151130-2000-+0000_amd64.deb ...^M
Unpacking ros-jade-camera-calibration (1.12.14-0trusty-20151130-2000-+0000) over (1.12.14-0trusty-20151110-1420-+0000) ...^M
Preparing to unpack .../ros-jade-camera-calibration-parsers_1.11.8-0trusty-20151130-0157-+0000_amd64.deb ...^M
Unpacking ros-jade-camera-calibration-parsers (1.11.8-0trusty-20151130-0157-+0000) over (1.11.7-0trusty-20151110-0900-+0000) ...^M
Preparing to unpack .../ros-jade-image-transport_1.11.8-0trusty-20151130-0226-+0000_amd64.deb ...^M
Unpacking ros-jade-image-transport (1.11.8-0trusty-20151130-0226-+0000) over (1.11.7-0trusty-20151110-1410-+0000) ...^M
Preparing to unpack .../ros-jade-camera-info-manager_1.11.8-0trusty-20151130-0237-+0000_amd64.deb ...^M
Unpacking ros-jade-camera-info-manager ...
edit retag flag offensive close merge delete


I know you think this is a update issues, but the most common cause for issues like this is missing dependencies in your CMakeLists. Can you please edit your question to include your CMakeLists.txt, so that we can rule out any issues there?

ahendrix gravatar image ahendrix  ( 2016-01-20 18:04:46 -0500 )edit

I updated my post to include my CMakeList and package.xml

Borob gravatar image Borob  ( 2016-01-20 18:41:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-20 18:51:38 -0500

ahendrix gravatar image

Your CMakeLists.txt is missing the dependency which tells cmake that it needs to do message generation before it tries to compile your program.

Add the following to your CMakeLists.txt, to inform CMake that your program needs the generated messages in order to compile:

add_dependencies(my_package my_package_generate_messages_cpp)

Have a look at this question for a more detailed discussion of how this works and why it is necessary.

edit flag offensive delete link more


Thanks a lot, I will try it out. But why the hell is that not featured on the tutorials: or ??

Borob gravatar image Borob  ( 2016-01-20 19:12:29 -0500 )edit

Feel free to update the tutorials if you think they're lacking.

ahendrix gravatar image ahendrix  ( 2016-01-20 19:52:17 -0500 )edit

The use of add_dependencies() is mentioned in the C++ publisher tutorial), section 1.3

ahendrix gravatar image ahendrix  ( 2016-01-21 13:35:59 -0500 )edit

So it is stated somewhere, but not in the documentation which sole purpose it is to describe exactly this. I don't want to sound ungracious, but that's the problem with ros: Poorly documented and/or outdated docs while stuff actually is pretty simple (if you could read about it in the docs).

Borob gravatar image Borob  ( 2016-01-21 14:52:00 -0500 )edit

Feel free to update the other tutorials if you think they're lacking.

ahendrix gravatar image ahendrix  ( 2016-01-21 15:40:24 -0500 )edit

@Druff I understand your frustration, as this issue is particularly opaque due to the nature of the problem. It is also mentioned in the catkin documentation: It hasn't always been there, it has been since before Jade.

William gravatar image William  ( 2016-01-21 15:56:22 -0500 )edit

It's also covered in the catkin_create_pkg template: The ${${PROJECT_NAME}_EXPORTED_TARGETS} will contain any message generation targets like my_package_generate_messages_cpp.

William gravatar image William  ( 2016-01-21 15:59:22 -0500 )edit

Thank you @William, I appreciate your efforts. I don't want to get into a big fundamental argument. But e.g. for your first link, why is that on a different site than the other ros docs (from the wiki). I don't want to diminish the communities efforts, but the documentation is so spotty.

Borob gravatar image Borob  ( 2016-01-21 16:18:08 -0500 )edit

Question Tools

1 follower


Asked: 2016-01-20 17:51:50 -0500

Seen: 261 times

Last updated: Jan 20 '16