修复了双目灰度图像的问题,完善了的配置支持,重写了YoloDetection文件,按照新版本Ultralyics的要求,增加YOLO11/v8/新版v5的支持
为ORB提取算法补充了二次提取的代码,当动态剔除后如果特征点过少,会触发这一机制,从而使得特征点满足yaml文件要求
基于此修改:https://github.com/HLkyss/modified_YOLO_ORB_SLAM3
环境要求: Pytorch 1.13.0注意:由于需要兼容新版本YOLO,该文件与yolov5版本作者提供的不同,但安装方式相同,可以参考下方文档作者 OpenCV 4.2.0
yolov5版本作者下自带的yolo权重文件已不再支持,需要下载最新版本的yolo.pt权重文件,并且转为torchscript文件格式
作为本科毕设开源
------------------------------以下为yolov5版本README文件----------------------------------------------------------
来源:https://github.com/YWL0720/YOLO_ORB_SLAM3
原开源代码只给了RGBD的,补充了一下自己使用的双目的,后面再补其他的
编译:
cmakelists只修改了opencv和cv_bridge相关部分,需要根据自己的环境修改。此外,YoloDetect.cpp里有一句加载模型的语句,我改成了我的绝对路径,需要修改成自己的。
双目:
./Examples/Stereo/stereo_tum_vi /home/hl/project/ORB_SLAM3_detailed_comments-master/Vocabulary/ORBvoc.txt /home/hl/project/YOLO_ORB_SLAM3-master/Examples/Stereo/ue_pin.yaml /media/hl/Stuff/ubuntu_share_2/Dataset/ue_pin_fov100/theta0/cam0 /media/hl/Stuff/ubuntu_share_2/Dataset/ue_pin_fov100/theta0/cam1 /media/hl/Stuff/ubuntu_share_2/Dataset/ue_180/time.txt /media/hl/Stuff/ubuntu_share_2/Dataset/ue_pin_fov100/theta0/result/dataset-hik_stereo-traj
单目:
./Examples/Monocular/mono_euroc ./Vocabulary/ORBvoc.txt ./Examples/Monocular/EuRoC.yaml /media/hl/Stuff/ubuntu_share_2/Dataset/EuRoc/V1_02 ./Examples/Monocular/EuRoC_TimeStamps/V102.txt
./Examples/Monocular/mono_tum_vi /home/hl/project/YOLO_ORB_SLAM3-master/Vocabulary/ORBvoc.txt /home/hl/project/YOLO_ORB_SLAM3-master/Examples/Monocular/ue_pin.yaml /media/hl/Stuff/ubuntu_share_2/Dataset/ue_pin_fov100/theta0/cam0 /media/hl/Stuff/ubuntu_share_2/Dataset/ue_180/time.txt
This is an improved version of ORB-SLAM3 that adds an object detection module implemented with YOLOv5 to achieve SLAM in dynamic environments.
- Object Detection
- Dynamic SLAM
We have tested on:
OS = Ubuntu 20.04
OpenCV = 4.2
Eigen3 = 3.3.9
Pangolin = 0.5
ROS = Noetic
You can download the compatible version of libtorch from Baidu Netdisk code: 8y4k, then
unzip libtorch.zip
mv libtorch/ PATH/YOLO_ORB_SLAM3/Thirdparty/wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcpu.zip
mv libtorch/ PATH/YOLO_ORB_SLAM3/Thirdparty/cd YOLO_ORB_SLAM3
chmod +x build.sh
./build.shOnly the rgbd_tum target will be build.
Add the path including Examples/ROS/YOLO_ORB_SLAM3 to the ROS_PACKAGE_PATH environment variable. Open .bashrc file:
gedit ~/.bashrcand add at the end the following line. Replace PATH by the folder where you cloned YOLO_ORB_SLAM3:
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/YOLO_ORB_SLAM3/Examples/ROSThen build
chmod +x build_ros.sh
./build_ros.shOnly the RGBD target has been improved.
The frequency of camera topic must be lower than 15 Hz.
You can run this command to change the frequency of topic which published by the camera driver.
roslaunch YOLO_ORB_SLAM3 camera_topic_remap.launch./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILEroslaunch YOLO_ORB_SLAM3 camera_topic_remap.launch
rosrun YOLO_ORB_SLAM3 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE

