introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.72k stars 775 forks source link

segmentation fault when trying to run c++ rgbd-mapping on macos #654

Open John-Trager opened 3 years ago

John-Trager commented 3 years ago

There seems to be an issue when trying to run the c++ rgbd-mapping example. I get the following terminal ouput: John@lab-1 tests2 % ./noEventsExample 20 2 10 stereo_20Hz stereo_20Hz stereo_20Hz/left stereo_20Hz/right objc[7770]: Class vtkCocoaTimer is implemented in both /usr/local/opt/vtk/lib/libvtkRenderingUI-9.0.1.dylib (0x12bc61438) and /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122fe90). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaTimer is implemented in both /usr/local/opt/vtk/lib/libvtkRenderingUI-9.0.1.dylib (0x12bc61438) and /opt/local/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x1114eee90). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaFullScreenWindow is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff08) and /opt/local/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x1114eef08). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaServer is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff30) and /opt/local/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x1114eef30). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaGLView is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff80) and /opt/local/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x1114eef80). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaFullScreenWindow is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff08) and /usr/local/opt/vtk/lib/libvtkRenderingOpenGL2-9.0.1.dylib (0x12bbaf240). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaServer is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff30) and /usr/local/opt/vtk/lib/libvtkRenderingOpenGL2-9.0.1.dylib (0x12bbaf268). One of the two will be used. Which one is undefined. objc[7770]: Class vtkCocoaGLView is implemented in both /usr/local/opt/vtk@8.2/lib/libvtkRenderingOpenGL2-8.2.1.dylib (0x12122ff80) and /usr/local/opt/vtk/lib/libvtkRenderingOpenGL2-9.0.1.dylib (0x12bbaf2b8). One of the two will be used. Which one is undefined. objc[7770]: Class QMacAutoReleasePoolTracker is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x120918ab8) and /opt/local/libexec/qt5/lib/QtCore.framework/Versions/5/QtCore (0x1121333f0). One of the two will be used. Which one is undefined. objc[7770]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x120918b30) and /opt/local/libexec/qt5/lib/QtCore.framework/Versions/5/QtCore (0x112133468). One of the two will be used. Which one is undefined. objc[7770]: Class KeyValueObserver is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x120918b58) and /opt/local/libexec/qt5/lib/QtCore.framework/Versions/5/QtCore (0x112133490). One of the two will be used. Which one is undefined. objc[7770]: Class RunLoopModeTracker is implemented in both /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (0x120918ba8) and /opt/local/libexec/qt5/lib/QtCore.framework/Versions/5/QtCore (0x1121334e0). One of the two will be used. Which one is undefined. zsh: segmentation fault

I think this has something to do with how rtab was built however I am unsure.
The example I was trying to follow was here: https://github.com/introlab/rtabmap/wiki/Cplusplus-RGBD-Mapping Thanks for the help.

matlabbe commented 3 years ago

Did you use macports? https://github.com/introlab/rtabmap/wiki/Installation#source

John-Trager commented 3 years ago

I used brew. Could that be an issue?

rtwomey commented 3 years ago

@John-Trager I found a similar issue with brew. I believe vtk@8.2 is a dependency from brew's pcl, but the latest OpenCV has a dependency on vtk@9. With both installed, I suspect this is causing the segfault.

matlabbe commented 3 years ago

The opencv@3 is independent of VTK, maybe it could help if it is the problem. I think with:

brew install sqlite pcl opencv@3

you would have the minimal dependencies to build rtabmap. I recommend also to build GTSAM or g2o for better graph optimization.

John-Trager commented 3 years ago

@matlabbe okay, I will try this later this week thanks!