introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.01k stars 559 forks source link

ROS kinetic binaries opencv3 link errors #158

Closed matlabbe closed 7 years ago

matlabbe commented 7 years ago

From clean Ubuntu 16.04/Kinetic:

$ docker run -i -t ros:kinetic-perception

# in container
$ apt-get update
$ apt-get install ros-kinetic-rtabmap-ros
$ source /opt/ros/kinetic/setup.bash
$ roslaunch rtabmap_ros rtabmap.launch

I got: /opt/ros/kinetic/lib/rtabmap_ros/rgbd_odometry: error while loading shared libraries: libopencv_xfeatures2d3.so.3.2: cannot open shared object file: No such file or directory [rtabmap/rgbd_odometry-2] process has died [pid 2126, exit code 127, cmd /opt/ros/kinetic/lib/rtabmap_ros/rgbd_odometry --delete_db_on_start rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info __name:=rgbd_odometry __log:=/root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rgbd_odometry-2.log]. log file: /root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rgbd_odometry-2*.log process[rtabmap/rtabmap-3]: started with pid [2136]

/opt/ros/kinetic/lib/rtabmap_ros/rtabmap: error while loading shared libraries: libopencv_xfeatures2d3.so.3.2: cannot open shared object file: No such file or directory [rtabmap/rtabmap-3] process has died [pid 2136, exit code 127, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmap --delete_db_on_start rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud __name:=rtabmap __log:=/root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rtabmap-3.log]. log file: /root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rtabmap-3*.log process[rtabmap/rtabmapviz-4]: started with pid [2137]

/opt/ros/kinetic/lib/rtabmap_ros/rtabmapviz: error while loading shared libraries: libopencv_core3.so.3.2: cannot open shared object file: No such file or directory [rtabmap/rtabmapviz-4] process has died [pid 2137, exit code 127, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud __name:=rtabmapviz __log:=/root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rtabmapviz-4.log]. log file: /root/.ros/log/eb94edc6-0b2c-11e7-b96b-0242ac110002/rtabmap-rtabmapviz-4*.log

By default Opencv 3.1 is installed. We should explicitly update openCV 3 from kinetic to get 3.2:

$ apt-get install ros-kinetic-opencv3

With 3.2 is installed, I got:

/opt/ros/kinetic/lib/rtabmap_ros/rtabmapviz: error while loading shared libraries: libopencv_imgcodecs3.so.3.1: cannot open shared object file: No such file or directory [ERROR] [1489770344.578036320]: Failed to load nodelet [/rtabmap/rgbd_odometry] of type [rtabmap_ros/rgbd_odometry] even after refreshing the cache: Failed to load library /opt/ros/kinetic/lib//librtabmap_ros.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 (Poco exception = libopencv_imgcodecs3.so.3.1: cannot open shared object file: No such file or directory)

[ERROR] [1489770344.578322994]: The error before refreshing the cache was: Failed to load library /opt/ros/kinetic/lib//librtabmap_ros.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 (Poco exception = libopencv_imgcodecs3.so.3.1: cannot open shared object file: No such file or directory) [ INFO] [1489770344.612068044]: Initializing nodelet with 1 worker threads. [rtabmap/rtabmapviz-4] process has died [pid 3327, exit code 127, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud __name:=rtabmapviz __log:=/root/.ros/log/f46655c8-0b33-11e7-98c9-0242ac110002/rtabmap-rtabmapviz-4.log]. log file: /root/.ros/log/f46655c8-0b33-11e7-98c9-0242ac110002/rtabmap-rtabmapviz-4*.log

[ERROR] [1489770344.715563189]: Failed to load nodelet [/rtabmap/rtabmap] of type [rtabmap_ros/rtabmap] even after refreshing the cache: Failed to load library /opt/ros/kinetic/lib//librtabmap_ros.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 (Poco exception = libopencv_imgcodecs3.so.3.1: cannot open shared object file: No such file or directory) [ERROR] [1489770344.715890562]: The error before refreshing the cache was: Failed to load library /opt/ros/kinetic/lib//librtabmap_ros.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 (Poco exception = libopencv_imgcodecs3.so.3.1: cannot open shared object file: No such file or directory)

which points now on previous version 3.1. It seems there is something wrong with the built ros-kinetic-rtabmap-ros. Note that rtabmap-console can start without problems.

matlabbe commented 7 years ago

This works (make sure to upgrade all ros packages to latest version):

$ docker run -i -t ros:kinetic-perception

# in container
$ apt-get update
$ apt-get upgrade
$ apt-get install ros-kinetic-rtabmap-ros
$ source /opt/ros/kinetic/setup.bash
$ roslaunch rtabmap_ros rtabmap.launch
$ roslaunch rtabmap_ros rtabmap.launch
... logging to /root/.ros/log/37b36d46-0cbc-11e7-a195-0242ac110002/roslaunch-52e5d297e214-7185.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://52e5d297e214:33217/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.7
 * /rtabmap/rgbd_odometry/approx_sync: True
 * /rtabmap/rgbd_odometry/config_path: 
 * /rtabmap/rgbd_odometry/frame_id: camera_link
 * /rtabmap/rgbd_odometry/queue_size: 10
 * /rtabmap/rgbd_odometry/wait_for_transform_duration: 0.2
 * /rtabmap/rtabmap/Mem/IncrementalMemory: true
 * /rtabmap/rtabmap/Mem/InitWMWithAllNodes: false
 * /rtabmap/rtabmap/approx_sync: True
 * /rtabmap/rtabmap/config_path: 
 * /rtabmap/rtabmap/database_path: ~/.ros/rtabmap.db
 * /rtabmap/rtabmap/frame_id: camera_link
 * /rtabmap/rtabmap/odom_frame_id: 
 * /rtabmap/rtabmap/queue_size: 10
 * /rtabmap/rtabmap/subscribe_depth: True
 * /rtabmap/rtabmap/subscribe_scan: False
 * /rtabmap/rtabmap/subscribe_scan_cloud: False
 * /rtabmap/rtabmap/subscribe_stereo: False
 * /rtabmap/rtabmap/wait_for_transform_duration: 0.2
 * /rtabmap/rtabmapviz/approx_sync: True
 * /rtabmap/rtabmapviz/frame_id: camera_link
 * /rtabmap/rtabmapviz/odom_frame_id: 
 * /rtabmap/rtabmapviz/queue_size: 10
 * /rtabmap/rtabmapviz/subscribe_depth: True
 * /rtabmap/rtabmapviz/subscribe_odom_info: True
 * /rtabmap/rtabmapviz/subscribe_scan: False
 * /rtabmap/rtabmapviz/subscribe_scan_cloud: False
 * /rtabmap/rtabmapviz/subscribe_stereo: False
 * /rtabmap/rtabmapviz/wait_for_transform_duration: 0.2

NODES
  /rtabmap/
    rgbd_odometry (rtabmap_ros/rgbd_odometry)
    rtabmap (rtabmap_ros/rtabmap)
    rtabmapviz (rtabmap_ros/rtabmapviz)

auto-starting new master
process[master]: started with pid [7196]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 37b36d46-0cbc-11e7-a195-0242ac110002
process[rosout-1]: started with pid [7209]
started core service [/rosout]
process[rtabmap/rgbd_odometry-2]: started with pid [7221]
process[rtabmap/rtabmap-3]: started with pid [7227]
process[rtabmap/rtabmapviz-4]: started with pid [7228]
[ INFO] [1489938820.513963368]: Starting node...
[ INFO] [1489938820.654694175]: Initializing nodelet with 1 worker threads.
[ INFO] [1489938820.676262353]: Initializing nodelet with 1 worker threads.
[ INFO] [1489938821.626897135]: Starting node...
QXcbConnection: Could not connect to display 
[rtabmap/rtabmapviz-4] process has died [pid 7228, exit code -6, cmd /opt/ros/kinetic/lib/rtabmap_ros/rtabmapviz -d ~/.ros/rtabmap_gui.ini rgb/image:=/camera/rgb/image_rect_color depth/image:=/camera/depth_registered/image_raw rgb/camera_info:=/camera/rgb/camera_info left/image_rect:=/stereo_camera/left/image_rect_color right/image_rect:=/stereo_camera/right/image_rect left/camera_info:=/stereo_camera/left/camera_info right/camera_info:=/stereo_camera/right/camera_info scan:=/scan scan_cloud:=/scan_cloud __name:=rtabmapviz __log:=/root/.ros/log/37b36d46-0cbc-11e7-a195-0242ac110002/rtabmap-rtabmapviz-4.log].
log file: /root/.ros/log/37b36d46-0cbc-11e7-a195-0242ac110002/rtabmap-rtabmapviz-4*.log
[ INFO] [1489938821.827651595]: /rtabmap/rtabmap(maps): grid_cell_size             = 0.050000
[ INFO] [1489938821.827748934]: /rtabmap/rtabmap(maps): grid_incremental           = false
[ INFO] [1489938821.828046987]: /rtabmap/rtabmap(maps): grid_size                  = 0.000000
[ INFO] [1489938821.828230415]: /rtabmap/rtabmap(maps): grid_eroded                = false
[ INFO] [1489938821.828407802]: /rtabmap/rtabmap(maps): grid_footprint_radius      = 0.000000
[ INFO] [1489938821.828584921]: /rtabmap/rtabmap(maps): map_filter_radius          = 0.000000
[ INFO] [1489938821.828765214]: /rtabmap/rtabmap(maps): map_filter_angle           = 30.000000
[ INFO] [1489938821.828931179]: /rtabmap/rtabmap(maps): map_cleanup                = true
[ INFO] [1489938821.829095730]: /rtabmap/rtabmap(maps): map_negative_poses_ignored = false
[ INFO] [1489938821.829267329]: /rtabmap/rtabmap(maps): cloud_output_voxelized     = true
[ INFO] [1489938821.829432502]: /rtabmap/rtabmap(maps): cloud_subtract_filtering   = false
[ INFO] [1489938821.829597535]: /rtabmap/rtabmap(maps): cloud_subtract_filtering_min_neighbors = 2
[ INFO] [1489938821.835221724]: /rtabmap/rtabmap(maps): octomap_tree_depth         = 16
[ INFO] [1489938821.835411556]: /rtabmap/rtabmap(maps): octomap_occupancy_thr      = 0.500000
[ INFO] [1489938821.912238712]: rtabmap: frame_id      = camera_link
[ INFO] [1489938821.912434892]: rtabmap: map_frame_id  = map
[ INFO] [1489938821.912785564]: rtabmap: tf_delay      = 0.050000
[ INFO] [1489938821.912977061]: rtabmap: tf_tolerance  = 0.100000
[ INFO] [1489938821.913161854]: rtabmap: odom_sensor_sync   = false
[ INFO] [1489938822.508966400]: Setting RTAB-Map parameter "Mem/IncrementalMemory"="true"
[ INFO] [1489938822.510894629]: Setting RTAB-Map parameter "Mem/InitWMWithAllNodes"="false"
[ INFO] [1489938822.820894124]: 
/rtabmap/rgbd_odometry subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1489938823.659672693]: RTAB-Map detection rate = 1.000000 Hz
[ INFO] [1489938823.659872568]: rtabmap: Using database from "/root/.ros/rtabmap.db".
[ INFO] [1489938823.668518773]: rtabmap: Database version = "0.11.13".
[ INFO] [1489938823.715442734]: /rtabmap/rtabmap: queue_size    = 10
[ INFO] [1489938823.715662915]: /rtabmap/rtabmap: rgbd_cameras = 1
[ INFO] [1489938823.716028673]: /rtabmap/rtabmap: approx_sync   = true
[ INFO] [1489938823.716333089]: Setup depth callback
[ INFO] [1489938823.835990095]: 
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ INFO] [1489938823.836690655]: rtabmap 0.11.13 started...
[ WARN] [1489938827.823411249]: /rtabmap/rgbd_odometry: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. 
/rtabmap/rgbd_odometry subscribed to (approx sync):
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
[ WARN] [1489938828.838015457]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom,
   /camera/rgb/image_rect_color,
   /camera/depth_registered/image_raw,
   /camera/rgb/camera_info
^C[rtabmap/rtabmap-3] killing on exit
[rtabmap/rgbd_odometry-2] killing on exit
rtabmap: Saving database/long-term memory... (located at /root/.ros/rtabmap.db)
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

The rtabmapviz error is normal as there is no GUI on docker (QXcbConnection: Could not connect to display).