ORB-SLAM3测试:数据集(单目/双目/imu)& ROS (D435 T265)

2023-05-16

ORB-SLAM3环境配置

安装各种依赖库

orb-slam3非常友好,不用自己下载各种依赖库,因为他们全部在thirdParty文件夹中,编译orb-slam3的同时会自动编译各种依赖库

  • Eigen3.3.4
  • Pangolin
  • OpenCV3.3.5
  • DBoW2 and g2o
  • ROS (optional)

安装orb-slam3:https://gitee.com/YaoFL/ORB_SLAM3

cd ORB_SLAM3
chmod +x build.sh
./build.sh

数据集测试运行ORB-SLAM3

数据集网址:https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
下载 ASL Dataset Format 一列
在主目录下添加 Datasets/EuRoC/MH01 文件夹并讲数据集放入

  • 1. 单目
./Examples/Monocular/mono_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular/EuRoC.yaml ./Datasets/EuRoC/MH01 ./Examples/Monocular/EuRoC_TimeStamps/MH01.txt dataset-MH01_mono

./Datasets/EuRoC/MH01改成自己文件夹的路径
MH01.txt存储图片名称

遇到问题:运行成功但是没有显示视频?

【1】代码没有更该为播放模式
mono_euroc.cc文件83 false 改为 true

ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::MONOCULAR, false);

参考:https://blog.csdn.net/changym5/article/details/125041396

【2】内置播放器有问题
ubuntu没有安装video播放器,安装ffmpeg,参考链接
直接在软件更新中下载video(TMD)

??????还是没有视频??????????

  • 2. 双目
./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml ./Datasets/EuRoC/MH01 ./Examples/Stereo/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereo

双目成功出现视频
在这里插入图片描述

  • 3. 单目+imu
./Examples/Monocular-Inertial/mono_inertial_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular-Inertial/EuRoC.yaml ./Datasets/EuRoC/MH01 ./Examples/Monocular-Inertial/EuRoC_TimeStamps/MH01.txt dataset-MH01_monoi
  • 4. 双目+imu
./Examples/Stereo-Inertial/stereo_inertial_euroc ./Vocabulary/ORBvoc.txt ./Examples/Stereo-Inertial/EuRoC.yaml ./Datasets/EuRoC/MH01 ./Examples/Stereo-Inertial/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereoi

ROS实测ORB-SLAM3

配置ros,建立catkin_ws工作空间,将orb-slam3代码加入,一键编译

cd ~/catkin_ws/src/ORB_SLAM3
chmod +x build.sh
./build.sh
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/catkin_ws/src/ORB_SLAM3/Examples/ROS #将这句放到~/.bashrc中,以后使用更方便
chmod +x build_ros.sh
./build_ros.sh

解决build catkin_ws时电脑卡死的问题,减少编译线程数量(默认应该是-j8),操作如下

gedit ~/.bashrc
export ROS_PARALLEL_JOBS=-j3
source ~/.bashrc

ros遇到bug,运行roscore没有反应,因为改了网络代理,导致Ubuntu系统ifconfig得到的ip和~/.bashrc里面的ip不一致

#export ROS_HOSTNAME=master
#export ROS_MASTER_URI=http://master:11311

export ROS_HOSTNAME=192.168.1.114
export ROS_MASTER_URI=http://192.168.1.114:11311
  • 1. 普通双目相机实测

直接按照官网的启动方法是没有图像的,但是双目检查话题也正确,为什么没有图像?
因为双目是usb直接连到主机上,不能自动形成一个ros话题发布,而slam3需要接受两个摄像头的话题,因此下载usb_cam包,该包将摄像头图像通过sensor_msgs::Image消息发布出去,https://github.com/bosch-ros-pkg/usb_cam.git
ROS下使用单目/双目摄像头发布图像话题:https://blog.csdn.net/weixin_53073284/article/details/125671358

运行

roscore
#roslaunch usb_cam usb_cam_stereo.launch
rosrun ORB_SLAM3 Stereo ./Vocabulary/ORBvoc.txt ./Examples/Stereo/EuRoC.yaml true
  • 2. RGBD–D435i实测

1)下载支持相机的SDK,下载realsense-ros并编译https://github.com/IntelRealSense/realsense-ros

2)检查/ORB_SLAM3/Examples/ROS/ORB_SLAM3/src/ros_rgbd.cc代码中相机话题名称是否正确,将之改成相机对应话题

//message_filters::Subscriber<sensor_msgs::Image> rgb_sub(nh, "/camera/rgb/image_raw", 100);
//message_filters::Subscriber<sensor_msgs::Image> depth_sub(nh, "camera/depth_registered/image_raw", 100);

message_filters::Subscriber<sensor_msgs::Image> rgb_sub(nh, "/camera/color/image_raw", 100);
message_filters::Subscriber<sensor_msgs::Image> depth_sub(nh, "/camera/depth/image_rect_raw", 100);

3)同时Examples/RGB-D/TUM1.yaml中的相机参数应该改为自己的相机参数

D435i可以选择多种模式运行ros版本的orb,包括1)深度相机模式、2)双目相机模式、3)双目+imu模式

  • RGBD:深度相机模式

运行

roslaunch realsense2_camera rs_rgbd.launch
rosrun ORB_SLAM3 RGBD Vocabulary/ORBvoc.txt Examples/RGB-D/TUM1.yaml

运行效果:
在这里插入图片描述

  • Stereo:双目相机模式

可以自己调整订阅的双目图像的话题,以及发布的相机位姿的话题

roslaunch realsense2_camera rs_camera_orb3.launch
rosrun ORB_SLAM3 Stereo ~/ORB_SLAM3/Vocabulary/ORBvoc.txt ~/ORB_SLAM3/config/real_camera.yaml true /camera/left/image_raw:=/camera/infra1/image_rect_raw /camera/right/image_raw:=/camera/infra2/image_rect_raw /orbslam3/vision_pose/pose:=/iris_0/orbslam3/vision_pose/pose
  • Stereo_Inertial:双目+imu模式

可以自己调整订阅的双目图像的话题和imu的话题,以及发布的相机位姿的话题
这里有问题???

roslaunch realsense2_camera rs_camera_orb3.launch
rosrun ORB_SLAM3 Stereo_Inertial ~/ORB_SLAM3/Vocabulary/ORBvoc.txt ~/ORB_SLAM3/config/real_camera_imu.yaml true /camera/left/image_raw:=/camera/infra1/image_rect_raw /camera/right/image_raw:=/camera/infra2/image_rect_raw /imu:=/camera/imu /orbslam3/vision_pose/pose:=/iris_0/orbslam3/vision_pose/pose
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ORB-SLAM3测试:数据集(单目/双目/imu)& ROS (D435 T265) 的相关文章

  • Linux CentOS 7安装GNOME图形界面并设置默认启动方式

    为hadoop集群做准备 xff0c 没有多台电脑 xff0c 也只能委屈我这渣渣电脑了 在我的物理机上安装虚拟机 xff0c 再在虚拟机里面虚拟出两台电脑 xff0c 安装两个linux操作系统 1 xff0c 电脑太渣 xff0c 安装
  • dubbo学习资源

    简介 xff1a 项目有使用dubbo xff0c 以此需要学习一下 xff0c 搜集学习资源 一 xff0c 博客资源 1 xff0c dubbo学习 2 xff0c dubbo配置

随机推荐