openVSLAM-stella_vslam的编译安装( 二 )


openVSLAM-stella_vslam的编译安装

文章插图
编译成功后的显示为:
1.5 运行
# download an ORB vocabulary from GitHubcurl -sL "https://github.com/stella-cv/FBoW_orb_vocab/raw/main/orb_vocab.fbow" -o orb_vocab.fbow# download a sample dataset from Google DriveFILE_ID="1d8kADKWBptEqTF7jEVhKatBEdN7g0ikY"curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/nullCODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"curl -sLb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o aist_living_lab_1.zipunzip aist_living_lab_1.zip# download a sample dataset from Google DriveFILE_ID="1TVf2D2QvMZPHsFoTb7HNxbXclPoFMGLX"curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/nullCODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"curl -sLb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o aist_living_lab_2.zipunzip aist_living_lab_2.zip# run tracking and mapping./run_video_slam -v ./orb_vocab.fbow -m ./aist_living_lab_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-out map.msg# click the [Terminate] button to close the viewer# you can find map.msg in the current directory# run localization./run_video_slam --disable-mapping -v ./orb_vocab.fbow -m ./aist_living_lab_2/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-in map.msg
我使用的是视频进行测试的:
./ -v /home//XXX//.fbow -m /home//XXX//data//video.mp4 -c /home//XXX///aist/.yaml --frame-skip 3 --no-sleep --map-db-out map.msg
运行过程中会报错误:
./: error while: sion.so:openfile: No such file or
解决办法:
在终端直接导入库所在的位置:
=/home//XXX/g2o/lib:$
或者在配置文件中写入:
=/usr/local/lib:$
数据集的下载直接可以在网页中下载:

运行的结果如图所示:
上述所有搭建环境的依赖包,可以到下面的链接中下载:
二、ROS 环境下的安装
20.04. ros
安装ROS版本的前提是先装好ROS和文章上述第一部分的源码 。
2.1 安装基础依赖包
1)sudo apt update -ysudo apt install ros-noetic-image-transport2)git clone --branch noetic --depth 1 https://github.com/ros-perception/vision_opencv.gitcp -r vision_opencv/cv_bridge ~/catkin_ws/srcrm -rf vision_opencv3)下拉ROS版本的源码cd ~/catkin_ws/srcgit clone --branch ros --depth 1 https://github.com/stella-cv/stella_vslam_ros.gitcd stella_vslam_rosgit submodule update --init --recursivecd ~/catkin_wscatkin_make -DUSE_PANGOLIN_VIEWER=ON -DUSE_SOCKET_PUBLISHER=OFF
编译过程中,出现下面的错误,从网上找到原因是G20的版本不兼容导致的 。所以需要确定官方使用的版本是什么版本 。
下载最新版本的g20,但是提示eigen库版本过低,卸载和升级eigen版本的方法为:eigen下载的网站为:Eigen
1)卸载
sudo
sudo rm -rf /usr//
sudo rm -rf /usr/lib/cmake/
sudo rm -rf /usr/local//
sudo rm -rf /usr/share/doc/-dev
sudo rm -rf /usr/local/share//.pc /usr/share//.pc /var/lib/dpkg/info/-dev.list /var/lib/dpkg/info/-dev.
2)查看查看自己的Eigen版本
sudo gedit /usr///Eigen/src/Core/util/.h
在这个文件开头有如下代表版本为3.3.3
#3
#3
#3
3)安装
sudo tar -xvzf eigen-3.4.0.tar.gz
cd eigen-3.4.0
sudo mkdir build
cd build
sudo cmake ..
sudo make
sudo cp -r /usr/local// /usr/
重新编译g20后,重新编译ros版本的
参考链接为:
ROS—
运行:
1)发布数据基于视频的方法rosrun image_publisher image_publisher ./aist_living_lab_1/video.mp4 /image_raw:=/camera/image_raw2)发布数据基于一般摄像头的apt install ros-${ROS_DISTRO}-usb-camrosparam set usb_cam/pixel_format yuyvrosrun usb_cam usb_cam_noderosrun image_transport republish \raw in:=/usb_cam/image_raw raw out:=/camera/image_raw3)运行(Tracking and Mapping源码位置:stella_vslam_ros/src/run_slam.cc)source ~/catkin_ws/devel/setup.bashrosrun stella_vslam_ros run_slam \-v /path/to/orb_vocab.fbow \-c /path/to/config.yaml \--map-db-out /path/to/map.msg4)运行(Localization 源码位置:stella_vslam_ros/src/run_slam.cc)source ~/catkin_ws/devel/setup.bashrosrun stella_vslam_ros run_slam \--disable-mapping \-v /path/to/orb_vocab.fbow \-c /path/to/config.yaml \--map-db-in /path/to/map.msg