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

Creating Custom Message using ROS Message (or Custom Message)

$
0
0
My problem is similar to this [link](http://answers.ros.org/question/102661/custom-service-with-custom-message/), however, I do understand how to use messages within the same package. My problem focuses on how to include a message from a separate package. I have created a package with some "CustomMessage" that pulls from other packages and their messages. These messages may be from a common package within my system, or a simple message type within geometry_msgs. I have tried including the required dependencies in the CMakeLists.txt and Package.xml files, but for the code to work I have to include the package name in the variable type call. For example: common_package/Variable variable_text If the package name is not included, I get something like: Could not find messages which '../CustomMessage.msg' depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)? Cannot locate message [PoseArray] in package [mission_control] Is this the only way to include a custom message from another package, or is there a better way? During my search, I found one other solution that followed this train of though at this [link](http://answers.ros.org/question/64553/how-do-you-locate-message-source-files-based-on-a-package-name-in-catkin/). However, I was under the assumption that by correctly setting the CMakeLists.txt and Package.xml file correctly, it would understand the pathing. For those who will ask, below is the CMakeLists.txt file: cmake_minimum_required(VERSION 2.8.3) project(mission_control) find_package(catkin REQUIRED COMPONENTS project_common roscpp rospy geometry_msgs std_msgs message_generation ) add_message_files( FILES CustomMessage1.msg CustomMessage2.msg ) generate_messages( DEPENDENCIES geometry_msgs std_msgs project_common ) catkin_package( # INCLUDE_DIRS include # LIBRARIES mission_control CATKIN_DEPENDS message_runtime project_common geometry_msgs std_msgs # DEPENDS system_lib ) include_directories( ${catkin_INCLUDE_DIRS} ) Thanks for the help!

Viewing all articles
Browse latest Browse all 670

Trending Articles



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