ORB-SLAM3 + RealSense D455相机实时运行
运行环境:
- ubuntu 20.04
- opencv 4.5.2
编译
# 使用ros,编译
chmod +x build_ros.sh
./build_ros.sh
查看D455中所有topic
# 两个终端
roslaunch realsense2_camera rs_camera.launch
# 查看所有topic,可用“| grep color”限定“color”或“depth”搜索
rostopic list
修改代码中的topic为D455的topic(可自选)
# 1.使用深度摄像头
# 位置:ORB_SLAM3/Examples/ROS/ORB_SLAM3/src/ros_rgbd.cc(62行左右)
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);
# 2.使用单目摄像头
# 位置:ORB_SLAM3/Examples/ROS/ORB_SLAM3/src/ros_mono.cc(66行左右)
//ros::Subscriber sub = nodeHandler.subscribe("/camera/image_raw", 1, &ImageGrabber::GrabImage,&igb);
ros::Subscriber sub = nodeHandler.subscribe("/camera/color/image_raw", 1, &ImageGrabber::GrabImage,&igb);
修改完成后再次运行./build_ros.sh命令
运行与结果
# “~/catkin_ws/src/ORB_SLAM3”目录下
# 1.使用深度摄像头
# 三个终端,以此输入
roscore
roslaunch realsense2_camera rs_rgbd.launch
rosrun ORB_SLAM3 RGBD Vocabulary/ORBvoc.txt Examples/RGB-D/D455.yaml
# 2.使用单目摄像头
roscore
roslaunch realsense2_camera rs_camera.launch
rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/Monocular/D455.yaml
1. rgb_d:
2.mono:
问题: 使用mono时,卡在了tring to initialize界面,无图像特征点
解决: 相机内参未标定,标定的相机内参