Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtabmap_ros 0.16 build error #227

Open
QinZiwen opened this issue Mar 26, 2018 · 3 comments
Open

rtabmap_ros 0.16 build error #227

QinZiwen opened this issue Mar 26, 2018 · 3 comments

Comments

@QinZiwen
Copy link

when I try to build rtabmap_ros after successfully compiled rtabmap, termial show errors like:

/usr/local/lib/librtabmap_core.so: undefined reference to `pcl::search::KdTree

I have install ros-indigo, pcl-1.7, qt 4.8.6 and vtk 6.3.0

@matlabbe
Copy link
Member

matlabbe commented Mar 26, 2018

Is PCL built from source? which full version? Here is a similar post: http://official-rtab-map-forum.206.s1.nabble.com/Compiling-in-ROS-Indigo-with-PCL-1-7-2-Undefined-reference-to-tp386p397.html

@QinZiwen
Copy link
Author

@matlabbe Thank you. I fix the problem by add find_package(PCL REQUIRED) in CMakeLists.txt
Terminal show error for me, but rtabmap_ros can run

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

    runtime library [libpcl_common.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_octree.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_io.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_kdtree.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_search.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_sample_consensus.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_filters.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_features.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_keypoints.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_segmentation.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_visualization.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_outofcore.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_registration.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_recognition.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_surface.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_people.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib
    runtime library [libpcl_tracking.so.1.7] in /usr/lib may be hidden by files in:
      /usr/local/lib

@matlabbe
Copy link
Member

You have two versions of PCL, depending on the order of paths in PATH or LD_LIBRARY_PATH, the wrong library could be used on runtime and cause a seg fault. In your case, the right libraries seem taken on runtime, so rtabmap is not crashing.

Normally, you should not have to add "find_package(PCL REQUIRED)" to rtabmap_ros CMakeLists.txt. rtabmap_ros depends already on pcl_ros, which will set the PCL link libraries to rtabmap_ros. As you have two PCL installed, you have to build pcl_ros from source so that it is linked to PCL in /usr/local instead of the default binaries. Uninstall PCL binaries. This will remove a couple of ROS packages depending on it, so you will have to rebuild them from source in your catkin workspace so that they are correctly linked to PCL built from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants