在~/catkin_ws_orb/src/ORB_SLAM3-master/Examples/ROS/ORB_SLAM3下运行
rosrun ORB_SLAM3 Mono_Inertial ../../../Vocabulary/ORBvoc.txt ../../Monocular-Inertial/EuRoC.yaml true
rosbag play MH_01_easy.bag /cam0/image_raw:=/camera/image_raw /imu0:=/imu
可以正常运行,开始修改话题。
rosrun ORB_SLAM3 Stereo_Inertial ../../../Vocabulary/ORBvoc.txt ../../uuv/camchain-imucam-StereoRig1.yaml true
rosbag play bus_out_loop_w_cam_info-003.bag /slave1/image_raw/compressed:=/camera/left/image_raw /slave2/image_raw/compressed:=/camera/right/image_raw /imu:=/imu
运行发现没反应,使用原先单目的运行,更换以下话题
rosrun ORB_SLAM3 Mono_Inertial ../../../Vocabulary/ORBvoc.txt ../../Monocular-Inertial/EuRoC.yaml true
rosbag play bus_out_loop_w_cam_info-003.bag /slave1/image_raw/compressed:=/camera/image_raw /imu:=/imu
报错,还是不行,检查发现是数据集给的数据类型不对
尝试更改,并修改话题,增加了一个重新发布话题
新发布的话题分别为,让orbslam订阅这几个话题,运行试试
/cam0/image_raw
/cam1/image_raw
/imu/imu
单目运行成功,未经处理直接运行orbslam3根本跟踪不上,但是好歹成功运行了
相机参数
尝试运行
rosrun ORB_SLAM3 Stereo_Inertial ../../../Vocabulary/ORBvoc.txt ../../uuv/stereo.yaml true
rosbag play bus_out_loop_w_cam_info-003.bag
roslaunch okvis_ros republish.launch
报错,提示,重启试一下
X11 Error: BadValue (integer parameter out of range for operation)
X11 Error: BadValue (integer parameter out of range for operation)
terminate called after throwing an instance of 'std::runtime_error'
what(): Pangolin X11: Failed to create an OpenGL context
已放弃 (核心已转储)
出现了另一个错误
Camera 0 is pinhole
ERROR: Calibration parameters to rectify stereo are missing!
段错误 (核心已转储)
应该是相机校准参数的问题,先设置成false
rosrun ORB_SLAM3 Stereo_Inertial ../../../Vocabulary/ORBvoc.txt ../../uuv/stereo.yaml false
可以运行了,但是效果贼差,怀疑是相机参数设置的问题,换回单目试一下,单目的文件需要在开头加上,不然会报错opencv。
%YAML:1.0
rosrun ORB_SLAM3 Mono_Inertial ../../../Vocabulary/ORBvoc.txt ../../uuv/mono.yaml false
单目就是总是丢跟踪,但是有些地方还是能运行一会儿的,严重怀疑双目相机的参数不对,先找个好点的数据集去尝试单目吧