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

Message generation fails after JADE update

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

Borob gravatar image

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

Hello.

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.

//EDIT:

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

package.xml:

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

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

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>roscpp_serialization</build_depend>
  <build_depend>geometry_msgs</build_depend>
  <build_depend>message_generation</build_depend>

  <run_depend>roscpp</run_depend>
  <run_depend>std_msgs</run_depend>
  <run_depend>roscpp_serialization</run_depend>
  <run_depend>geometry_msgs</run_depend>
  <run_depend>message_runtime</run_depend>
  <export>

  </export>
</package>

CMakeList.txt:

cmake_minimum_required(VERSION 2.8.3)
project(my_package)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  geometry_msgs
  roscpp_serialization
  hector_quadrotor_gazebo
  message_generation
)

add_message_files(
  FILES
  CustomMessage.msg
)

generate_messages(
  DEPENDENCIES
  geometry_msgs
)

catkin_package(
CATKIN_DEPENDS roscpp_serialization message_runtime
)

include_directories(
  ${catkin_INCLUDE_DIRS}
)

add_executable(my_package src/MyProgramm.cpp)

target_link_libraries(my_package
  ${catkin_LIBRARIES}
)

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

Preparing to unpack .../python-oneconf_0.3.7.14.04.1_all.deb ...^M
Unpacking python-oneconf (0.3.7.14.04.1) 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 ...
(more)
edit retag flag offensive close merge delete

Comments

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

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

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

1 Answer

Sort by ยป oldest newest most voted
2

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

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

Comments

Thanks a lot, I will try it out. But why the hell is that not featured on the tutorials: http://wiki.ros.org/ROS/Tutorials/Cre... or http://wiki.ros.org/ROS/Tutorials/Def... ??

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

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

ahendrix gravatar image ahendrix  ( 2016-01-20 19:52:17 -0600 )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 -0600 )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 -0600 )edit

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

ahendrix gravatar image ahendrix  ( 2016-01-21 15:40:24 -0600 )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: http://docs.ros.org/hydro/api/catkin/... It hasn't always been there, it has been since before Jade.

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

It's also covered in the catkin_create_pkg template: https://github.com/ros-infrastructure... 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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 291 times

Last updated: Jan 20 '16