iKrishneel / octomap_server2

ROS2 stack for mapping with OctoMap, contains octomap_server package
74 stars 33 forks source link

Build error with Humble #15

Open sarubito opened 1 year ago

sarubito commented 1 year ago

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
  )
macnack commented 10 months ago

Issue fixed #17