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

add_message_files() directory not found

asked 2016-05-07 11:19:48 -0600

cicimotl@gmail.com gravatar image

updated 2017-03-23 02:43:28 -0600

130s gravatar image

I recently installed ROS indigo and following the tutorial to get to know ROS. However, error occurred after catkin_make. I have also included the log files. Please help me out let me know how to fix this!! Appreciate it!!


The error:

Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install

####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ciara/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Base path: /home/ciara/catkin_ws
Source space: /home/ciara/catkin_ws/src
Build space: /home/ciara/catkin_ws/build
Devel space: /home/ciara/catkin_ws/devel
Install space: /home/ciara/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ciara/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ciara/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/indigo
-- This workspace overlays: /opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ciara/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:
  /home/ciara/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
  beginner_tutorials/CMakeLists.txt:13 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ciara/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

My CMakelists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

# Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  genmsg
)

## Declare ROS messages and services
add_message_files(DIRECTORY msg FILES Num.msg)
add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs
 )

catkin_package()

include_directories(include ${catkin_INCLUDE_DIRS})

add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES ...
(more)
edit retag flag offensive close merge delete

Comments

2

Can you run find * in your beginner_tutorials and post that too? Does msg/Num.msg exist?

lucasw gravatar image lucasw  ( 2016-05-07 22:29:56 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted
0

answered 2016-05-08 05:50:54 -0600

Fighting_bird gravatar image

updated 2016-05-08 05:51:53 -0600

Did you notice the error "add_message_files() directory not found" ? I think the paramemer "msg" in the function add_message_files() may be error, or there is no file msg/Num.msg. In the other way, maybe your msg file's name is wrong, please check it. By the way, I ever made this stupid error.

edit flag offensive delete link more

Comments

By the way, please learn to read the output of building in patience, though it is so long.

Fighting_bird gravatar image Fighting_bird  ( 2016-05-08 05:56:07 -0600 )edit
4

answered 2016-05-08 23:11:01 -0600

cicimotl@gmail.com gravatar image

I fixed the problem by commenting out the following lines then it compiles just fine! Thanks guys!!!

## Declare ROS messages and services
add_message_files(DIRECTORY msg FILES Num.msg)
add_service_files(DIRECTORY srv FILES AddTwoInts.srv)
edit flag offensive delete link more

Comments

1

-1. Although it depends on what you want to do, by commenting out add_{message, service}_files macros you're simply omitting the message/service building features, which I assume is what the tutorial you were working on expects you to do.

130s gravatar image 130s  ( 2017-03-23 02:27:42 -0600 )edit
0

answered 2018-08-17 22:16:49 -0600

I've had a similar issue regarding add_action_files(). A few things to check:

  • Naming of the action file
  • directory location of the action folder and file

In my case, i placed the action directory (which contained my action file) under the src directory, which gave me the error. I changed the action directory's location to my packages root folder (alongside the CMakeLists.txt, include directory, package.xml and src directory) and it compiled just fine.

Hope this helped!

edit flag offensive delete link more

Comments

How do we decide where to place our directory? In the previous comment, the programmer changed the action directory's location to my packages root folder (the folder in which include, src and package.xml is present) instead of the child src folder, and the error seemed to get resolved. Can someone explain why?

aleena_infinitynbeyond gravatar image aleena_infinitynbeyond  ( 2020-01-03 22:30:03 -0600 )edit
0

answered 2021-06-17 14:21:44 -0600

shiv gravatar image

i got the same issue..and i have figured out...i was writing the .msg file inside the src folder..,so i corrected it and wrote outside src folder..

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-05-07 11:19:48 -0600

Seen: 15,521 times

Last updated: Mar 23 '17