Rtabmap and octomap in ROS2

Hi!

I am trying to get an octomap using Rtabmap. As instructed in the Rtabmap documentation, this is done automatically if Rtabmap_ros is built with Octomap.

I tried to so by adding this into the CMakeLists.txt file of Rtabmap_ros:

find_package(octomap_msgs) 
find_package(octomap REQUIRED) 
include_directories(${OCTOMAP_INCLUDE_DIRS}) 
link_libraries(${OCTOMAP_LIBRARIES})

And also this into the Package.xml:

<build_depend>octomap</build_depend>
<build_depend>octomap_msgs</build_depend>
<exec_depend>octomap</exec_depend>
<exec_depend>octomap_msgs</exec_depend>

When building again the package I get the following warning:

CMake Warning at CMakeLists.txt:496 (add_executable):
  Cannot generate a safe runtime search path for target
  rtabmap_pointcloud_to_depthimage because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [liboctomap.so.1.9] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /opt/ros/galactic/lib
    runtime library [liboctomath.so.1.9] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /opt/ros/galactic/lib

  Some of these libraries may not be found correctly.

However, if I build it again, the warning disappears. The problem is that although the /octomap_full topic is being published, its data is empty…

image

Can anybody help me? I need this done for an important project