i have been trying to publish message of type sensor_msgs but i am getting different erros. i have added all required code lines in CMakelists file but i think there is still a problem.

asked 2019-07-11 06:08:04 -0500

aanish gravatar image

updated 2019-07-11 08:32:00 -0500

gvdhoorn gravatar image

i am getting this Error:

Could not find messages which
  '/home/aanish/new_workspace/src/week1/msg/SensorInformation.msg' depends
  on.  Did you forget to specify generate_messages(DEPENDENCIES ...)?

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


-- Configuring incomplete, errors occurred!
See also "/home/aanish/new_workspace/build/CMakeFiles/CMakeOutput.log".
See also "/home/aanish/new_workspace/build/CMakeFiles/CMakeError.log".
Makefile:390: 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

Have you added sensor_msgs inside catking_package in Cmakelists.txt? and inside package.xml dependencies?

EDIT: I see also you should add it in generate_messaged in CmakeLists.txt

Solrac3589 gravatar image Solrac3589  ( 2019-07-11 06:54:55 -0500 )edit

If there is a problem with the CMakeLists.txt it helps a lot to actually see it. Could you please update your question with your CMakeLists.txt (please remove all boilerplate comments, though)?

mgruhler gravatar image mgruhler  ( 2019-07-12 01:18:03 -0500 )edit