Ask Your Question
0

Could not find messages which depends on

asked 2021-01-20 05:19:19 -0500

mad-physicist gravatar image

Hello all,

I've been trying to define a custom message on my own but when i run catkin build command, I keep getting the same error:

Errors << tryout_nodes:check /home/yigithan/catkin_ws/logs/tryout_nodes/build.check.019.log CMake Error at /home/yigithan/catkin_ws/build/tryout_nodes/cmake/tryout_nodes-genmsg.cmake:3 (message): Could not find messages which '/home/yigithan/catkin_ws/src/tryout_nodes/msg/SensorInformation.msg' depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?

Cannot locate message [Range]: unknown package [sensor_msgs] on search path [{{'std_msgs': ['/opt/ros/melodic/share/std_msgs/cmake/../msg'], 'tryout_nodes': ['/home/yigithan/catkin_ws/src/tryout_nodes/msg']}}] Call Stack (most recent call first): /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include) CMakeLists.txt:11 (generate_messages)

The thing is, when I run rosmsg show SensorInformation , the terminal gives me the content of my message file. I am leaving my CMakeLists.txt below. I would appreciate any help. Thanks!

cmake_minimum_required(VERSION 3.0.2) project(tryout_nodes)

find_package(catkin REQUIRED COMPONENTS rospy std_msgs message_generation)

add_message_files(DIRECTORY msg FILES SensorInformation.msg )

generate_messages( DEPENDENCIES std_msgs )

catkin_package( CATKIN_DEPENDS message_runtime std_msgs rospy )

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-01-20 10:10:40 -0500

tryan gravatar image

updated 2021-01-20 10:11:07 -0500

Your custom message appears to depend on sensor_msgs, so you need to add that to your CMakeLists.txt in all the same places as std_msgs.

edit flag offensive delete link more

Comments

1

Thank you very much!

mad-physicist gravatar image mad-physicist  ( 2021-01-21 08:04:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-20 05:19:19 -0500

Seen: 668 times

Last updated: Jan 20 '21