RGBD SLAMv2: build and run 环境搭建与运行

Share:
# Objective - Build development environment - Build RGBD SLAM v2 - Run RGBD SLAMv2 use TUM dataset # Environment - Host: Ubuntu18 - Docker: 19.03 - Docker-compose: 1.25 - Docker image: ubuntu 16 + cuda 9 + ROS kinetic ```sh ➜ launch git:(dev) ✗ docker --version Docker version 19.03.11, build 42e35e61f3 ➜ launch git:(dev) ✗ docker-compose --version docker-compose version 1.25.5, build 8a1c60f6 ``` Host: ```sh ➜ launch git:(dev) ✗ nvidia-smi Thu Jun 11 10:52:57 2020 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 166... Off | 00000000:01:00.0 Off | N/A | | N/A 44C P8 4W / N/A | 720MiB / 5944MiB | 5% Default | +-------------------------------+----------------------+----------------------+ ``` Docker: ```sh # cat /usr/local/cuda/version.txt CUDA Version 9.0.176 # nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2017 NVIDIA Corporation Built on Fri_Sep__1_21:08:03_CDT_2017 Cuda compilation tools, release 9.0, V9.0.176 ``` # Build RGBD SLAMv2 See install.sh Modify: where your source code want to install: - SUBDIR=~/rgbdSLAM ```sh ./install.sh ``` # Build RGBD SLAMv2 Manually I build it manually use docker. Please check ``docker/Dockerfile" and "docker/entrypoint.sh". The program is build automatically when start docker firstly. - G2O ```sh git clone -b c++03 https://github.com/felixendres/g2o.git /root/g2ofork ``` - PCL 1.8 ```sh wget -c https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz ``` I am not sure why the default PCL 1.7 not working in docker image when compile RGBD SLAMv2. - Compile RGBD SLAMv2 The compile process is writen in "docker/entrypoint.sh": ```sh cd /root/catkin_ws rosdep install -y rgbdslam --skip-keys="nvidia-cuda-dev nvidia-cuda" catkin_make -j2 source "/root/catkin_ws/devel/setup.bash" ``` # Evaluate RGBD SALMv2 use TUM dataset - Get TUM dataset ```sh wget -c https://vision.in.tum.de/rgbd/dataset/freiburg1/rgbd_dataset_freiburg1_room.bag ``` - Start RGBD SLAM2 ```sh roslaunch rgbdslam rgbdslam.launch or roslaunch rgbdslam tum.launch (in my GitHub dev branch) ``` Make sure the image topic is like: ```sh ``` - Play TMU dataset ```sh rosbag play *.bag ``` - Result # Run test_settings.launch - Modify test_settings.launch: ```sh ``` ```sh roslaunch rgbdslam test_settings.launch ``` - Result ![image-20200611160659323](https://cdn.jsdelivr.net/gh/yubaoliu/assets@image/image-20200611160659323.png) # Chalenges or Errors ## REQUIRED process [rgbdslam-1] has died ```sh rgbdslam (rgbdslam/rgbdslam) ROS_MASTER_URI=http://localhost:11311 process[rgbdslam-1]: started with pid [2242] ================================================================================REQUIRED process [rgbdslam-1] has died! process has died [pid 2242, exit code -11, cmd /root/catkin_ws/devel/lib/rgbdslam/rgbdslam __name:=rgbdslam __log:=/root/.ros/log/e4990858-ab2a-11ea-9e20-c0b883f2e8ec/rgbdslam-1.log]. log file: /root/.ros/log/e4990858-ab2a-11ea-9e20-c0b883f2e8ec/rgbdslam-1*.log Initiating shutdown! ================================================================================ [rgbdslam-1] killing on exit shutting down processing monitor... ... shutting down processing monitor complete ``` It took me very long time to solve this problem. One day I found the solution in https://blog.csdn.net/weixin_43981221/article/details/89885534. Solution: ```sh export LD_LIBRARY_PATH=/opt/ros/kinetic/lib:$LD_LIBRARY_PATH ``` - Refer - https://github.com/felixendres/rgbdslam_v2/issues/60 - https://github.com/felixendres/rgbdslam_v2/wiki/Instructions-for-Compiling-Rgbdslam-(V2)-on-a-Fresh-Ubuntu-16.04-Install-(Ros-Kinetic)-in-Virtualbox ## libGL error: No matching fbConfigs or visuals found ```sh # rosrun rviz rviz [ INFO] [1591698594.187146454]: rviz version 1.12.17 [ INFO] [1591698594.187204754]: compiled against Qt version 5.5.1 [ INFO] [1591698594.187226653]: compiled against OGRE version 1.9.0 (Ghadamon) libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface. libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Segmentation fault (core dumped) ``` See: https://www.ybliu.com/2020/06/docker-error-libgl-error-failed-to-load.html

No comments