I know this question has been asked a number of times, and I've gone through and followed the instructions on a number of those answers (for example- here and here), as well as in the documentation for building a custom message. Yet still my message header is not building.
This is the error I get:
/home/erinline/Documents/testsim/src/m-explore/explore/src/explore.cpp:39:10: fatal error: msg/util.h: No such file or directory
#include <msg/util.h>
^~~~~~~~~~~~
compilation terminated.
m-explore/explore/CMakeFiles/explore.dir/build.make:86: recipe for target 'm-explore/explore/CMakeFiles/explore.dir/src/explore.cpp.o' failed
make[2]: *** [m-explore/explore/CMakeFiles/explore.dir/src/explore.cpp.o] Error 1
CMakeFiles/Makefile2:23711: recipe for target 'm-explore/explore/CMakeFiles/explore.dir/all' failed
make[1]: *** [m-explore/explore/CMakeFiles/explore.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(explore_lite)
## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
actionlib
actionlib_msgs
costmap_2d
geometry_msgs
map_msgs
move_base_msgs
nav_msgs
roscpp
std_msgs
tf
visualization_msgs
message_generation
)
add_message_files(
FILES
util.msg
)
generate_messages(
DEPENDENCIES
std_msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
CATKIN_DEPENDS
actionlib_msgs
geometry_msgs
map_msgs
move_base_msgs
nav_msgs
std_msgs
visualization_msgs
message_runtime
)
###########
## Build ##
###########
# c++11 support required
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
## Specify additional locations of header files
include_directories(
${catkin_INCLUDE_DIRS}
include
)
add_executable(explore
src/costmap_client.cpp
src/explore.cpp
src/frontier_search.cpp
)
#add_dependencies(explore ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(explore explore_lite_generate_messages_cpp)
target_link_libraries(explore ${catkin_LIBRARIES})
#############
## Install ##
#############
# install nodes
install(TARGETS explore
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# install roslaunch files
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
#############
## Testing ##
#############
if(CATKIN_ENABLE_TESTING)
find_package(roslaunch REQUIRED)
# test all launch files
roslaunch_add_file_check(launch)
endif()
My message is called util.msg, it is in a file called msg within the package file called explore. I must be missing something, since those previous answers seem to work for some folks. Any advice on where I am going wrong would be greatly appreciated!
Originally posted by kitkatme on ROS Answers with karma: 47 on 2019-04-13
Post score: 0