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.
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
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
If there is a problem with the
CMakeLists.txt
it helps a lot to actually see it. Could you please update your question with yourCMakeLists.txt
(please remove all boilerplate comments, though)?