octomap_server2 icon indicating copy to clipboard operation
octomap_server2 copied to clipboard

Build error with Humble

Open sarubito opened this issue 2 years ago • 1 comments

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
  )

sarubito avatar Jun 09 '23 09:06 sarubito

Issue fixed #17

macnack avatar Oct 30 '23 20:10 macnack