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

Having problem with message file and building the package

asked 2018-03-20 05:07:46 -0500

Ibrahim_aerospace gravatar image

updated 2018-03-20 07:37:54 -0500

gvdhoorn gravatar image

Hello respected members! I am having trouble with building the package. First i created the package. and then modified CMakelist.txt and Package.xml files. as required. But when I build the package, it gives me this error

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:224 (message):
  catkin_package() DEPENDS on the catkin package 'message_generation' which
  must therefore be listed as a run dependency in the package.xml

I can't understand this message. My TXT and XML files are given bellow. Please help me. Thanks in advance

<?xml version="1.0"?>
<package format="2">
  <description>The ros_tutorials_topic package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="">Jane Doe</maintainer> -->
  <maintainer email="ibrahim@todo.todo">ibrahim</maintainer>

  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->

  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website"></url> -->

  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="">Jane Doe</author> -->

  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!-- Use build_export_depend for packages you need in order to build against this package: -->
  <!--   <build_export_depend>message_generation</build_export_depend>  -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use exec_depend for packages you need at runtime: -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- Use doc_depend for packages you need only for building documentation: -->
  <!--   <doc_depend>doxygen</doc_depend> -->

  <!-- The export tag contains other, unspecified, tags -->
    <!-- Other tools can request additional information be placed here -->



## DEPENDS: system dependencies of this project that dependent projects also need
  #INCLUDE_DIRS include
 #LIBRARIES ros_tutorials_topic
  CATKIN_DEPENDS message_generation roscpp std_msgs
  #DEPENDS system_lib

## Build ##

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include

## Declare a C++ library
add_library(${PROJECT_NAME} src/${PROJECT_NAME}/ros_tutorials_topic.cpp

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
 add_executable(${PROJECT_NAME}_node src/ros_tutorials_topic_node ...
edit retag flag offensive close merge delete


Please fix the formatting of your question.

Use the Preformatted Text button for that (the one with 101010 on it).

Please also then remove all the comments from your package.xml and CMakeLists.txt, they are not needed.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-20 05:23:52 -0500 )edit

can you please have a look again ? bunch of thanks

Ibrahim_aerospace gravatar image Ibrahim_aerospace  ( 2018-03-20 06:56:09 -0500 )edit

Did you just completely rewrite your question?

Please don't do that. If you solved your earlier problem, then accept the answer you received and open a new question for your new problem.

I'm going to leave my answer as-is and hope expect you will revert your edit to your question.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-20 07:11:08 -0500 )edit

I've undone the changes you did to your question and reopened it.

Please click on the checkmark (in the circle) next to the answer to properly mark your question as answered.

We don't close questions here on ROS Answers if/when they're answered.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-20 07:34:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-20 05:29:07 -0500

gvdhoorn gravatar image

updated 2018-03-20 05:30:40 -0500

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:224 (message):

catkin_package() DEPENDS on the catkin package 'message_generation' which must therefore be listed as a run dependency in the package.xml

This error message is not that difficult actually, but I can understand you may not be familiar with the terminology that is being used.

The issue is that you have message_generation listed in your catkin_package(.. CATKIN_DEPENDS ..) statement. That is incorrect, it should be message_runtime.

Please carefully review the Catkin documentation on Building messages, services or actions where this is shown. It is also discussed in the Creating a ROS msg and srv tutorial, specifically in the Creating a msg section.

edit flag offensive delete link more

Question Tools



Asked: 2018-03-20 05:07:46 -0500

Seen: 1,561 times

Last updated: Mar 20 '18