RealSenseD435是一款结构光相机,使用左右目相机和红外光实现测距。有效测距范围为0.2~10m
git clone https://github.com/gaoxiang12/ORBSLAM2_with_pointcloud_map.git
clone代码,无法下载的话,可以直接去https://github.com/gaoxiang12/ORBSLAM2_with_pointcloud_map下载
git clone https://github.com/wylnii/ORBSLAM2_with_pointcloud_map.git
准备所需的库,具体要求可以参考
https://blog.csdn.net/subiluo/article/details/88975979
需要注意的是,Eigen库最好使用3.2.10,OPENCV博主使用的是3.4.5。
电脑中的版本可以使以下命令查看
pkg-config --modversion opencv
如果不想重装Eigen库的话,后面博主会介绍另一种方法
cd g2o_with_orbslam2
mkdir build
cmake ..
make
sudo make install
cd ORB_SLAM2_modified/
rm -rf Thirdparty/DBoW2/build/
rm -rf Thirdparty/g2o/build/
https://github.com/raulmur/ORB_SLAM2/tree/master/Vocabulary
chmod +x build.sh
./build.sh
find_package(Pangolin REQUIRED)
find_package(PCL 1.8 REQUIRED)
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/../../../
${PROJECT_SOURCE_DIR}/../../../include
${Pangolin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
)
#message(FATAL_ERROR ${OpenCV_LIBS})
add_definitions(${PCL_DEFINITIONS})
link_directories(${PCL_LIBRARY_DIRS})
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PCL_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
-lboost_system
# opencv_core3 #手动添加
# opencv_imgproc3
# opencv_highgui3
)
"/camera/color/image_raw";
"/camera/aligned_depth_to_color/image_raw";
gedit ~/.bashrc
# 添加一下命令,如果以前配置过ORB_SLAM2的ROS的话,需要将以前的配置注释掉
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/你的目录/ORB_SLAM2_modified/Examples/ROS
chmod +x build_ros.sh
./build_ros.sh
https://blog.csdn.net/weixin_43828675/article/details/115312472?spm=1001.2014.3001.5501
mkdir realsense
cd realsense
mkdir src
cd src
git clone https://github.com/intel-ros/realsense.git
cd ..
catkin_make
source devel/setup.bash
需要注意的是,SDK和ROS功能包的版本要对应,否则会报错
此时可以使用删除命令后,重新进行安装
dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge
roslaunch realsense2_camera rs_rgbd.launch
rosrun ORB_SLAM2 RGBD Vocabulary/ORBvoc.bin Examples/RGB-D/TUM1.yaml
原因是Eigen库的问题,建议使用Eigen3.2.10
首先去Eigen官网上下载Eigen3.2.10,随后按照以下网站的教程进行修改。我建议将所有的CMakeLisr.txt都进行修改。指明使用的Eigen库的路径。
https://blog.csdn.net/weixin_44457020/article/details/114778641
realsense提供的realsense_viewer可以对实现深度测量的左右目相近进行自校准,校准流程参考
https://www.bilibili.com/video/av757604103
修改相机参数的yaml文件中的DepthMapFactor参数,博主使用的1000