0
$\begingroup$

Rosanswers logo

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


Originally posted by thijser on ROS Answers with karma: 1 on 2014-12-01

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by dornhege with karma: 31395 on 2014-12-01

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.