Cannot locate message [ChannelFloat32] in package [robot_setup_tf]
Hi,
I followed through the tutorial for "Publishing LaserScans over ROS" and "Publishing PointClouds over ROS". I encountered the following error message for the later but I am able to build the former. My platform, ROS version and error message are as follows. Please kindly assist. Thank you.
Platform: Ubuntu 18.04 ROS: Melodic Error: CMake Error at /home/robin/catkin_ws2/build/robot_setup_tf/cmake/robot_setup_tf-genmsg.cmake:3 (message): Could not find messages which '/home/robin/catkin_ws2/src/robot_setup_tf/msg/PointCloud.msg' depends on. Did you forget to specify generate_messages(DEPENDENCIES ...)?
Cannot locate message [ChannelFloat32] in package [robot_setup_tf] with paths [['/home/robin/catkin_ws2/src/robot_setup_tf/msg']] Call Stack (most recent call first): /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:307 (include) robot_setup_tf/CMakeLists.txt:72 (generate_messages)
CMakeLists.txt: cmake_minimum_required(VERSION 3.0.2) project(robot_setup_tf)
Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
Find catkin macros and libraries
if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS geometry_msgs roscpp tf std_msgs sensor_msgs nav_msgs )
Generate messages in the 'msg' folder
add_message_files(DIRECTORY FILES LaserScan.msg) add_message_files(DIRECTORY FILES Odometry.msg) add_message_files(DIRECTORY FILES PointCloud.msg)
Generate added messages and services with any dependencies listed here
generate_messages( DEPENDENCIES geometry_msgs std_msgs sensor_msgs nav_msgs )
catkin_package( CATKIN_DEPENDS geometry_msgs roscpp tf sensor_msgs nav_msgs )
include_directories( include ${catkin_INCLUDE_DIRS} )
add_executable(odometry src/odometry.cpp) add_executable(laser src/laser.cpp) add_executable(pointcloud src/pointcloud.cpp) add_executable(tf_broadcaster src/tf_broadcaster.cpp) add_executable(tf_listener src/tf_listener.cpp) target_link_libraries(odometry ${catkin_LIBRARIES}) target_link_libraries(laser ${catkin_LIBRARIES}) target_link_libraries(pointcloud ${catkin_LIBRARIES}) target_link_libraries(tf_broadcaster ${catkin_LIBRARIES}) target_link_libraries(tf_listener ${catkin_LIBRARIES})