Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

custom message fails to build; no such file or directory

$
0
0
I followed the custom message documentation to the letter, and searched all the related questions on here, and unfortunately I am still stuck. Could you please have a look? I am getting the same error building in Ubuntu 14.04 and 16.04, both running Kinetic. All my packages that have custom messages fail to build (`catkin_make` exits with error). The custom message definition are part of the package, and are not from another package. The error reason is the same for all the packages with custom messages (from my limited understanding the .msg file is not found for some reason): ` fatal error: ... : No such file or directory ... >` ![image description](/upfiles/15406075368275472.png) ![image description](/upfiles/15406085293420606.png) The package organization follows the documentation: ![image description](/upfiles/15406082195812666.png) where the custom message file is called my_msg.msg and is inside the msg directory. The contents of `my_msg.msg` are not suspect either: int32 my_int float64 my_float The package.xml does contain the needed lines: message_generationmessage_runtime The CMakeLists.txt contains everything the documentation mentions, and I even ran `catkin_create_pkg test` to make sure all the items are arranged in the correct order. Here is the file: cmake_minimum_required(VERSION 2.8.3) project(g_custom_messages) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation ) add_message_files( FILES my_msg.msg ) generate_messages(DEPENDENCIES std_msgs ) catkin_package(CATKIN_DEPENDS message_runtime) include_directories(include ${catkin_INCLUDE_DIRS}) add_executable(custom_msg_subscriber src/custom_msg_subscriber.cpp) target_link_libraries(custom_msg_subscriber ${catkin_LIBRARIES}) and in the source code (file name is `custom_msg_subscriber.cpp` and it is inside the src directory), I am refrencing the custom message as `#include `, and am accessing the data via: void poseMessageReceived(const g_custom_messages::my_msg &msg) { storeInt = msg.my_int; storeFloat = msg.my_float; } All the web search gymnastics I did have not helped. Could you please let me know why am I getting an error?

Viewing all articles
Browse latest Browse all 417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>