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

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">
  <name>ros_tutorials_topic</name>
  <version>0.0.0</version>
  <description>The ros_tutorials_topic package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">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 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/ros_tutorials_topic</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@example.com">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: -->
     <build_depend>message_generation</build_depend> 
  <!-- 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: -->
         <exec_depend>message_runtime</exec_depend>
  <!-- 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> -->
  <buildtool_depend>catkin</buildtool_depend>   
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>std_msgs</exec_depend>


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

  </export>
</package>

CMakelists:

## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
  #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_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

## 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
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## 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 ...
(more)
edit retag flag offensive close merge delete

Comments

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
1

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
1

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
1

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

2 followers

Stats

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

Seen: 1,483 times

Last updated: Mar 20 '18