ROS_kinetic下rgbdslam_V2的安装和使用

本文详细介绍了如何在ROS环境下搭建ORB_SLAM2系统,包括软硬件准备、工作空间建立、依赖库安装与配置等步骤。针对常见的编译错误提供了具体的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、软硬件
1)软件--装有ROS kinetic ubuntu 16.04 同时兼容 ROS Indigo ubuntu 14.04

2)硬件--笔记本、kinect2摄像头


2、建立orbslam_ws工作空间

$ cd ~/rgbdslam_ws/src 
$ cd rgbdslam_ws 
$ catkin_make 
$ source devel/setup.bash 

3、获取rgbdslam_v2包--注意:ros_kinetic下务必下载对应kinetic版本的package

1) 方式一
$ cd ~/rgbdslam_ws/src 
$ wget -q http://github.com/felixendres/rgbdslam_v2/archive/kinetic.zip 
$ unzip -q kinetic.zip 
$ cd ~/rgbdslam_ws/ 
2) 方式二
--直接到作者github网址下载https://github.com/felixendres/rgbdslam_v2
--解压后放到目录 /rgbdslam_ws/src 下即可

4、安装及编译rgbdslam_v2包
$ rosdep update 
$ rosdep install rgbdslam 

catkin_make之前rgbdslam_v2包的cmakelists.txt文件下的第6行加入

add_compile_options(-std=c++11)

如下图所示


终端执行catkin_make

$ catkin_make 

如果编译成功,如下所示:



5、添加rgbdslam_ws工作空间到.bashrc文件下

$ echo "source /home/ljl/rgbdslam_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

6、修改rgbdslam_v2包的cmakelists文件

将第7行的

set(USE_SIFT_GPU  1 CACHE BOOL "build with support for siftgpu") 

改成

set(USE_SIFT_GPU  0 CACHE BOOL "build with support for siftgpu") 

如下图红框所示:



7、修改rgbdslam_v2包launch文件夹下的rgbdslam.launch文件和openni+rgbdslam.launch文件

修改1 ) ~/rgbdslam_ws/src/rgbdslam_v2/launch/rgbdslam.launch文件中13、14行的value值设置为ORB

<param name="config/feature_detector_type" value="ORB"/>
<param name="config/feature_extractor_type" value="ORB"/>

修改2 ) ~/rgbdslam_ws/src/rgbdslam_v2/launch/openni+rgbdslam.launch文件中13、14行的value值设置为ORB

<param name="config/feature_detector_type" value="ORB"/>
<param name="config/feature_extractor_type" value="ORB"/>

8、下载rgbd数据集

数据集网址:https://vision.in.tum.de/data/datasets/rgbd-dataset/download,这里我下了个最小的,如下图所示,下载完成后,解压到rgbdslam_v2/src/rgbdslam/目录下;



9、开始测试

1)打开一个终端,输入

$ roscore

2) 打开第二个终端,cd到rgbd数据集所在目录下,然后输入

$ rosbag play rgbd_dataset.bag

3) 打开第三个终端,输入

$ roslaunch rgbdslam rgbdslam.launch

10、BUG解决

如果您遇到了“required process[rgbdslam-2] has died”......Iinitiating down问题,请不要着急,该问题主要是由于rgbdslam依赖库g2o和pcl不兼容引起的;

解决方法源网址https://hubpages.com/technology/Instructions-for-compiling-rgbdslam-v2-on-a-fresh-Ubuntu-1604-install-ros-kinetic-in-virtualbox

我的解决方法:已测试成功

1 )如果你之前已经安装了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(我一个一个删的我会说……)

2 ) 下载Eigen3库到rgbdslam_vs/src目录下

$ cd rgbdslam_vs/src
$ wget http://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2
$ mkdir eigen
$ tar -xvjf 3.2.10.tar.bz2 -C eigen --strip-components 1

3 ) 使用上面下载的eigen3.2配置g2o

编辑g2o包下的cmakelists.txt文件,将第251行

SET(G2O_EIGEN3_INCLUDE ${EIGEN3_INCLUDE_DIR} CACHE PATH "Directory of Eigen3")

改成

SET(G2O_EIGEN3_INCLUDE "你的Eigen3的绝对路径" CACHE PATH "Directory of Eigen3")

4 ) 下载rgbdslam作者的g2o并利用cmake编译

$ cd rgbdslam_vs/src
$ git clone https://github.com/felixendres/g2o.git
$ cd ~/rgbdslam/src/g2o
$ mkdir build
$ cd build
$ cmake ..
$ make 
$ sudo make install
5 ) 下载PCL1.8并修改其cmakelist.txt

$ cd ~/rgbdslam_vs/src
$ wget https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0.tar.gz
$ tar -xvzf pcl-1.8.0.tar.gz
修改cmakelist.txt,在其第146行加入并保存

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
6 )编译PCL1.8

$  cd ~/temp_test_ws/src/pcl-pcl-1.8.0
$ mkdir build
$ cd build
$ cmake ..
$ make VERBOSE=1
$ sudo make install 
7 ) 更改rgbdslam_v2包下的cmakelist.txt文件,并重新编译

--将rgbdslam_v2包下的cmakelist.txt文件的第79行

find_package(PCL 1.7 REQUIRED COMPONENTS common io)

改成

find_package(PCL 1.8 REQUIRED COMPONENTS common io)

8 )将rgbdslam_ws下的build和devel文件夹删除,并重新编译

$ cd rgbdslam_ws
$ catkin_make

9 ) 至此,bug已解决


11、重新测试

1)打开一个终端,输入

roscore
2) 打开第二个终端,cd到rgbd数据集所在目录下,然后输入

rosbag play rgbd_dataset.bag

3) 打开第三个终端,输入

roslaunch rgbdslam rgbdslam.launch

测试成功,如下图所示:








### ROS Kinetic Calibration Tutorial and Resources For users interested in calibrating sensors or other components within the ROS Kinetic environment, several tutorials and resources are available. The `pluginlib` package provides an abstract framework for creating and using plugins which might be useful when developing custom calibration nodes[^1]. However, specific to calibration tasks, one of the most comprehensive guides comes from the official ROS wiki documentation. The Camera Calibration tool is part of the image_pipeline suite and allows performing camera intrinsic parameter estimation through a graphical user interface. This process involves capturing images containing a known pattern such as a chessboard grid placed at different orientations relative to the camera lens. After collecting enough samples, running the calibration node will compute focal length, principal point position, distortion coefficients among others parameters necessary for undistorting captured frames during operation. Another important aspect covered by these materials includes extrinsic parameters determination between multiple cameras mounted on robots like TurtleBot where accurate alignment ensures better performance especially while navigating environments based upon visual SLAM algorithms. Instructions provided explain not only theoretical concepts behind each step involved but also practical considerations regarding setup preparation before starting actual measurements. Moreover, integrating self-created maps alongside simulation platforms enhances testing capabilities without requiring physical hardware availability all times thus facilitating development cycles significantly according to explanations found elsewhere concerning Stage integration techniques specifically tailored towards mobile bases equipped with laser scanners capable of generating occupancy grids used later inside Gazebo worlds after proper adjustments made via configuration files following guidelines outlined thereupon too[^3]. Lastly, expanding workspaces beyond base installations enables incorporating specialized libraries supporting advanced functionalities required throughout various stages ranging from data acquisition up until post-processing analysis phases thanks largely due contributions coming directly out-of-the-box once extra dependencies get added properly following instructions laid down hereunder about managing releases efficiently so projects benefit fully from community efforts put forth collectively over time ensuring compatibility across diverse setups encountered regularly nowadays within research labs around globe alike[^5]. ```bash roslaunch camera_calibration cameracalibrator.launch \ image:=<your_image_topic> \ camera_name:=<your_camera_name> \ calib_url:=<path_to_your_calib_file> ```
评论 36
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值