按照教程就好
sudo apt-get install libsuitesparse-dev
Github上作者发布的install.sh安装rgbdslam …but又失败了
去github上翻一下说明文档:
Prerequisites
Ubuntu 16.04
ROS kinetic
Amd64 processor (there are
known problems with ARM, mostly related to qt and opengl) Other versions may work, but are not tested. Please report success if you use other versions.
ok应该是没有大问题的把!
想看效果:
sudo apt-get install ros-kinetic-openni-launc
roslaunch rgbdslam openni+rgbdslam.launch
(第一次用ROS的新手注意了:在roslaunch 你的launch之前,要另外开一个终端,输入roscore,回车)
往后翻
http://vision.in.tum.de/data/datasets/rgbd-dataset
参照:RGBD SLAM V2 +Ubuntu 16.04+ROS KINETIC配置及运行
然而….用数据集进行测试,
process[rgbdslam-1]: started with pid [29003]
================================================================================REQUIRED process [rgbdslam-1] has died!
process has died [pid 29003, exit code -11, cmd /home/ada/Code/rgbdslam_catkin_ws/devel/lib/rgbdslam/rgbdslam __name:=rgbdslam __log:=/home/ada/.ros/log/2f3dc700-ebce-11e7-855d-f894c2f54745/rgbdslam-1.log].
log file: /home/ada/.ros/log/2f3dc700-ebce-11e7-855d-f894c2f54745/rgbdslam-1*.log
Initiating shutdown!
================================================================================
[rgbdslam-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
可能是g2o与作者的冲突了的缘故,删掉自己电脑上的g2o,重新编译
删除:
(1)删除/usr/local/include/g2o,指令为sudo rm -rf /usr/local/include/g2o;
(2)删除/usr/local/lib下有关libg2o_*.so的库文件,先进入目录cd /usr/local/lib,然后挨个(可多个同时)删除sudo rm -rf libg2o_*.so libg2o_*.so libg2o_*.so
删除干净后重新安装,看下效果:
roslaunch rgbdslam test_settings.launch bagfile_name:="../*.bag"
飞快的闪过界面!胜利就在前方啊,但是…
[FATAL] [1514518475.912320264]: Opening Bagfile ../*.bag failed: Error opening file: ../*.bag Quitting!
================================================================================REQUIRED process [rgbdslam-1] has died!
process has finished cleanly
log file: /home/ada/.ros/log/2f3dc700-ebce-11e7-855d-f894c2f54745/rgbdslam-1*.log
Initiating shutdown!
================================================================================
[rgbdslam-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
查看一下发布的topic
把rgbdslam.launch的参数改一下
<param name="config/topic_image_mono" value="/camera/rgb/image_color"/>
<param name="config/topic_image_depth" value="/camera/depth/image"/>
然后…重新来了一遍,界面有了,但是框里什么都不显示…
Warning: TF_OLD_DATA ignoring data from the past for frame openni_rgb_optical_frame at time 1.30503e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 277 in /tmp/binarydeb/ros-kinetic-tf2-0.5.16/src/buffer_core.cpp
然后找到了这个TF_OLD_DATA error when i play bag file for RGBDSLAM
按照问题解答设置之后,先开界面,再发布数据,成功解决!
感谢各位前辈,继续学习!
下面会用kinectv2在RGBDSLAMV2上运行
未完待续…
使用Kinect One(Kinect v2)运行RGBDSLAM的步骤
首先,在rgbdslam_catkin_ws/src/rgbdslam/launch下创建rgbdslam_kinect2.launch文件
内容如下:
<launch>
<node pkg="rgbdslam" type="rgbdslam" name="rgbdslam" cwd="node" required="true" output="screen">
<param name="config/topic_image_mono" value="/kinect2/qhd/image_color_rect"/>
<param name="config/camera_info_topic" value="/kinect2/qhd/camera_info"/>
<param name="config/topic_image_depth" value="/kinect2/qhd/image_depth_rect"/>
<param name="config/topic_points" value=""/>
<param name="config/feature_extractor_type" value="SIFTGPU"/>
<param name="config/feature_detector_type" value="SIFTGPU"/>
<param name="config/detector_grid_resolution" value="3"/>
<param name="config/optimizer_skip_step" value="15"/>
<param name="config/cloud_creation_skip_step" value="2"/>
<param name="config/backend_solver" value="csparse"/>
<param name="config/pose_relative_to" value="first"/>
<param name="config/maximum_depth" value="2"/>
<param name="config/subscriber_queue_size" value="20"/>
<param name="config/min_sampled_candidates" value="30"/>
<param name="config/predecessor_candidates" value="20"/>
<param name="config/neighbor_candidates" value="20"/>
<param name="config/ransac_iterations" value="140"/>
<param name="config/g2o_transformation_refinement" value="1"/>
<param name="config/icp_method" value="gicp"/>
node>
launch>
运行roslaunch rgbdslam rgbdslam_kinect2.launch
并rosrun kinect2_bridge kinect2_bridge.launch
从不同的终端窗口
but有点不明白,kinect2的部分应该也装在rgbdslamv2工作空间的src下吗?
没用过ROS,遂决定先看看ROS部分在继续.
gedit ~/.bashrc
将工作空间路径加入ROS包的路径下
在文件末尾加上:
export ROS_PACKAGE_PATH=/home/ada/Code/rgbdslam_catkin_ws/src:/home/ada/Code/rgbdslam_catkin_ws/src/rgbdslam:/opt/ros/kinetic/share:/home/ada/kinect/catkin_ws/src
按照自己的写…
然后
source ~/.bashrc
运行:roslaunch kinect2_bridge kinect2_bridge.launch
运行:roslaunch rgbdslam rgbdslam_kinect2.launch
出来界面,终端显示在传递数据,kinect也在工作,但是界面完美 不过点云卡了…
将参数改为ORB
<param name="config/feature_extractor_type" value="ORB"/>
<param name="config/feature_detector_type" value="ORB"/>
好一点,但是点云依然很慢
至此,完成构建,还有很多不明白的,开始学习ROS和RGBDSLAMV2
感谢各位前辈,继续学习!