./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examples/Monocular/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
./Examples/Monocular/mono_euroc Vocabulary/ORBvoc.txt Examples/Monocular/EuRoC.yaml PATH_TO_SEQUENCE_FOLDER/mav0/cam0/data Examples/Monocular/EuRoC_TimeStamps/SEQUENCE.txt
./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER
./Examples/Stereo/stereo_euroc Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml PATH_TO_SEQUENCE/mav0/cam0/data PATH_TO_SEQUENCE/mav0/cam1/data Examples/Stereo/EuRoC_TimeStamps/SEQUENCE.txt
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILE
roslaunch zed_wrapper zed.launch
rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml false /camera/left/image_raw:=/zed2/zed_node/left/image_rect_color /camera/right/image_raw:=/zed2/zed_node/right/image_rect_color
例如把/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src目录下的ros_stereo.cc建立一个新的文件,比如说叫ros_zed_stereo_rect.cc
把代码复制过去,只需要更改
message_filters::Subscriber\<sensor_msgs::Image\> left_sub(nh, "/zed2/zed_node/left/image_rect_color", 1);
message_filters::Subscriber\<sensor_msgs::Image\> right_sub(nh, "/zed2/zed_node/right/image_rect_color",1);
然后修改CmakeLists.txt,加入:
#Node for ZED camera
rosbuild_add_executable(zed_Stereo_rect src/ros_zed_stereo_rect.cc)
target_link_libraries(zed_Stereo_rect \${LIBS})
重新编译
./build_ros.sh
编译成功后运行
roslaunch zed_wrapper zed.launch
rosrun ORB_SLAM2 zed_Stereo_rect Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml
#yaml文件可以替换成标定之后的zed参数文件