octomap_server2
octomap_server2 copied to clipboard
Build error with Humble
Hi. I have tried following the README guidelines to build the code, but after executing
$ colcon build --symlink-install --packages-select octomap_msgs octomap_server2
I get the following error:
fatal error: tf2_geometry_msgs/tf2_geometry_msgs.h: No such file or directory
50 | #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
fatal error: rclcpp_components/register_node_macro.hpp: No such file or directory
9 | #include <rclcpp_components/register_node_macro.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
I solved by adding below to CMakeLists.txt.
find_package(tf2_geometry_msgs REQUIRED)
and
ament_target_dependencies(octomap_server2
rclcpp
PCL
pcl_conversions
sensor_msgs
std_msgs
nav_msgs
visualization_msgs
geometry_msgs
std_srvs
octomap
octomap_msgs
message_filters
tf2_ros
tf2_msgs
tf2
tf2_geometry_msgs
rclcpp_components
)
Issue fixed #17