Closed mmcza closed 1 week ago
Seeing the same here on multiple systems after an apt upgrade.
sudo apt install liboctomap-dev ros-humble-octomap-ros ros-humble-octomap-rviz-plugins ros-humble-octomap-msgs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
liboctomap-dev is already the newest version (1.9.7+dfsg-3).
ros-humble-octomap-msgs is already the newest version (2.0.0-3jammy.20240728.220605).
ros-humble-octomap-ros is already the newest version (0.4.4-1jammy.20240728.221134).
ros-humble-octomap-rviz-plugins is already the newest version (2.1.0-1jammy.20240730.174119).
ld /opt/ros/humble/lib/liboctomap_rviz_plugins.so
ld: warning: cannot find entry symbol _start; not setting start address
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::Pointcloud::Pointcloud()'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::Pointcloud::~Pointcloud()'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomath::Pose6D::Pose6D(octomath::Pose6D const&)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::OcTreeNode::addValue(float const&)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::OcTreeNode::OcTreeNode()'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::OcTreeNode::~OcTreeNode()'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::AbstractOcTree::createTree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::Pointcloud::transform(octomath::Pose6D)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomath::Pose6D::~Pose6D()'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `typeinfo for octomap::OcTreeStamped'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::OcTree::OcTree(double)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomath::Pose6D::inv() const'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::ColorOcTree::ColorOcTree(double)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomath::operator<<(std::ostream&, octomath::Vector3 const&)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomath::Pose6D::transform(octomath::Vector3 const&) const'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::Pointcloud::Pointcloud(octomap::Pointcloud const&)'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `typeinfo for octomap::ColorOcTree'
ld: /opt/ros/humble/lib/liboctomap_rviz_plugins.so: undefined reference to `octomap::OcTreeNode::getMaxChildLogOdds() const'
ls -al $(dpkg-query -L liboctomap-dev | grep liboctomap.[aso] )
-rw-r--r-- 1 root root 694434 Aug 27 2021 /usr/lib/x86_64-linux-gnu/liboctomap.a
lrwxrwxrwx 1 root root 17 Aug 27 2021 /usr/lib/x86_64-linux-gnu/liboctomap.so -> liboctomap.so.1.9
ls -al /opt/ros/humble/lib/liboctomap_rviz_plugins.so
-rw-r--r-- 1 root root 932056 Jul 31 03:41 /opt/ros/humble/lib/liboctomap_rviz_plugins.so
Workaround
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/liboctomap.so ros2 run rviz2 rviz2
Thank you @aosmw . The workaround is working
@mmcza Are you able to reopen this issue? The real fix will require this PR https://github.com/OctoMap/octomap_rviz_plugins/pull/49 and a re-release.
Hi there, I have experienced the same issue. Here's my info on it:
ros-humble-octomap-rviz-plugins/jammy,now 2.1.0-1jammy.20240730.174119 amd6
ros2
branch commit: 42be6dfff4faebea9656fba10ef8ec18ae874544
When selecting any of the octomap occupancy grid displays (e.g. OccupancyGrid
), loading the plugin fails with the following error message from rviz:
[ERROR] [1724688835.264146998] [rviz2]: PluginlibFactory: The plugin for class 'octomap_rviz_plugins/OccupancyGrid' failed to load. Error: Failed to load library /home/docker/ros_ws/install/octomap_rviz_plugins/lib/liboctomap_rviz_plugins.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library dlopen error: /home/docker/ros_ws/install/octomap_rviz_plugins/lib/liboctomap_rviz_plugins.so: undefined symbol: _ZTIN7octomap13OcTreeStampedE, at ./src/shared_library.c:99
So, I figure it doesn't link against the lib in which this symbol is defined; Probably, the main octomap lib.
I managed to fix the problem by adding find_package(octomap REQUIRED)
to the CMakeLists.txt. After re-building my workspace, I can add the rviz display without getting error output from rviz.
@Cakem1x does the change in PR #49 also work for you?
Yes, your fix also works for my setup. Nice!
I suspect the octomap
target comes from liboctomap-dev
, in the package.xml
. So it should be there after running rosdep
for all compatible systems :+1: .
I think my fix works because finding octomap populates the ${OCTOMAP_LIBRARIES}
cmake variable, so it basically ends up doing the same thing as your fix.
I am unclear about linking against octomap
works with your solution, without finding it via find_package(octomap)
first. Do you know why this works?
It works because of ament_auto_find_build_dependencies() at the top of the file. It knows how to read the package.xml and call find_package() on the listed dependencies and constructs targets that can be used in target_link_libraries.
Follow this rabbit hole. https://github.com/ament/ament_cmake/blob/4c630d4c36af09e8a426ef5c1fbc8850f656019c/ament_cmake_auto/cmake/ament_auto_find_build_dependencies.cmake
Thank you for the detailed documentation and fix suggestion. The corresponding PR #49 is merged and a release to Iron, Humble, and Rolling made. Should there be any issues, please feel free to tag me
Hi, I was using the plugin for rviz that I installed using
apt-get install ros-humble-octomap-rviz-plugins
. It was working until I rebuilt the docker image last week (the previous docker image was over a month old). Now I get a following error:I saw a similar issue here but there it was resolved as there was some update. I did what was mentioned in that issue, but resourcing and reinstalling didn't fix the problem.
Here is response I got from
ldd /opt/ros/humble/lib/liboctomap_rviz_plugins.so
(it was mentioned in that issue to send the information)