Could not find messages

asked 2019-11-06 07:29:25 -0500

k's gravatar image

updated 2019-11-06 08:08:24 -0500

gvdhoorn gravatar image

when I did catkin_make,I got the bellow error. I made msg file. But it said that there is no message. How can I solve the peoblem?

CMake Error at /opt/ros/kinetic/share/catkin/cmake/assert.cmake:20 (message):
  Assertion failed: file
  '/home/robot/catkin_ws/src/ndt3d/msg/  humansArray.msg' does not exist.
  Message: message file not found

Call Stack (most recent call first):
  /opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:113 (assert_file_exists)
  ndt3d/CMakeLists.txt:60 (add_message_files)

I wrote like bellow in CMakeList.txt

add_message_files(
  #DIRECTORY
 # msg
  FILES
  NDTResult.msg
  StampedArray.msg
  humansArray.msg
)

error:

CMake Error at /home/robot/catkin_ws/build/ndt3d/cmake/ndt3d-genmsg.cmake:3 (message):
  Could not find messages which
  '/home/robot/catkin_ws/src/ndt3d/msg/humansArray.msg' depends on.  Did you
  forget to specify generate_messages(DEPENDENCIES ...)?

  Cannot locate message [Pose] in package [ndt3d] with paths
  [['/home/robot/catkin_ws/src/ndt3d/msg']]
Call Stack (most recent call first):
  /opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:307 (include)
  ndt3d/CMakeLists.txt:90 (generate_messages)


-- Configuring incomplete, errors occurred!
See also "/home/robot/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/robot/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:7248: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
edit retag flag offensive close merge delete

Comments

Did you forget to specify generate_messages(DEPENDENCIES ...)?

If your custom message depends on other ROS messages (like geometry_msgs/Pose.msg ), you need to add them in your CMakeLists.txt as follows:

generate_messages(
  DEPENDENCIES geometry_msgs ...
)
Jasmin gravatar image Jasmin  ( 2019-11-06 16:02:51 -0500 )edit
1

It would be helpful if you post your humansArray.msg file.

Jasmin gravatar image Jasmin  ( 2019-11-06 16:06:30 -0500 )edit

Looks like you have just Pose instead of geometry_msgs/Pose in your humansArray.msg file. Please post it!

KenYN gravatar image KenYN  ( 2019-11-06 18:18:29 -0500 )edit

Inside humansArray.msg:

Header header Pose[] poses

float64[] id

I mistook inside msg file. I changed "Pose[]" to "float64[]". Then I could do catkin_make.

Thank you

k's gravatar image k's  ( 2019-11-07 01:08:23 -0500 )edit

Can I use Pose[] in my own msg?

k's gravatar image k's  ( 2019-11-07 02:58:08 -0500 )edit

Do you mean geometry_msgs/Pose?

Jasmin gravatar image Jasmin  ( 2019-11-07 03:01:14 -0500 )edit