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

custom message creation causes error

asked 2014-12-01 07:13:44 -0500

thijser gravatar image

Hello, I'm attempting to create a custom message following this tutorial: http://wiki.ros.org/ROS/Tutorials

/CreatingMsgAndSrv#Creating_a_msg I currently have the following make file:
cmake_minimum_required(VERSION 2.8.3)
project(glados)
include_directories(include ${catkin_INCLUDE_DIRS})

find_package(catkin REQUIRED COMPONENTS roscpp message_generation threemxl std_msgs  rospy)
catkin_package()

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp std_msgs geometry_msgs)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${roscpp_INCLUDE_DIRS})

######
#CORE
######

add_executable(core src/core.cpp)
target_link_libraries(core ${catkin_LIBRARIES})


#######
#SENSORS
#######

#Switchsensor
add_library(switchSensor src/sensors/switchSensor.cpp)
target_link_libraries(switchSensor ${catkin_LIBRARIES})

#UltrasoneSensor
add_library(UltrasoneSensor src/sensors/UltrasoneSensor.cpp)        
target_link_libraries(UltrasoneSensor ${catkin_LIBRARIES})

#RFIDSensor
add_library(RFIDSensor src/sensors/RFIDSensor.cpp)
target_link_libraries(RFIDSensor ${catkin_LIBRARIES})

#########
#DRIVERS
#########    

#Launch
add_library(launchDriver src/drivers/launchDriver.cpp)
target_link_libraries(launchDriver ${roscpp_LIBRARIES} switchSensor)

#######
#LOGIC
#######

#Ball ask
#add_executable(mathAsker src/mathAsker.cpp)
#target_link_libraries(mathAsker ${catkin_LIBRARIES})

# Generate messages in the 'msg' folder
add_message_files(
   FILES
   music.msg
 )

 generate_messages(
   DEPENDENCIES
   std_msgs
 )

however this causes the following error:

CMake Error at /opt/ros/indigo/share/genmsg/cmake/genmsg-extras.cmake:91 (message):
  add_message_files() directory not found:
  /home/thijs/codes/robotica-minor-5/turtleCode/src/glados/msg
Call Stack (most recent call first):
  glados/CMakeLists.txt:55 (add_message_files)

I have tried around a few times but cannot seem to find the solution, the custom message is placed inside src/msg/music.msg

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-01 08:49:23 -0500

dornhege gravatar image

The message must be, where the error say it is looking for, i.e.: /home/thijs/codes/robotica-minor-5/turtleCode/src/glados/msg

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-12-01 07:12:41 -0500

Seen: 738 times

Last updated: Dec 01 '14