赞
踩
时间4月6号
参考
https://blog.csdn.net/m0_73860872/article/details/127276979
lspci | grep -i nvidia
nvidia-smi
cuda的最大支持版本为12.0
在https://developer.nvidia.com/cuda-toolkit-archive找到你需要的cuda版本
我选的
https://developer.nvidia.com/cuda-11-6-2-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=runfile_local
运行指令
wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run
sudo sh cuda_11.6.2_510.47.03_linux.run
sudo gedit ~/.bashrc
末尾添加
export PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
source ~/.bashrc
nvcc -V
https://www.stereolabs.com/developers/
参考
https://blog.csdn.net/m0_62114628/article/details/123510696
cd ~/catkin_ws/src
git clone --recursive https://github.com/stereolabs/zed-ros-wrapper.git
cd ../
rosdep install --from-paths src --ignore-src -r -y
catkin_make -DCMAKE_BUILD_TYPE=Release
source ./devel/setup.bash
没有做这一步安装zed-ros-interfaces
,因为zed-ros-wrapper里面有zed-ros-interfaces
参考https://blog.csdn.net/m0_62114628/article/details/123510696
https://blog.csdn.net/m0_62114628/article/details/123452584
修改~/orb_slam/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src下的ros_stereo.cc的内容,把相应话题修改成如下内容:
message_filters::Subscriber<sensor_msgs::Image> left_sub(nh, "/zed/zed_node/left/image_rect_color", 1);
message_filters::Subscriber<sensor_msgs::Image> right_sub(nh, "/zed/zed_node/right/image_rect_color", 1);
可以直接github找Windfish_ORB_SLAM2编译这个源码好像就不会报错
或者
这里是由于noetic的cv_bridge是opencv 4.2版本的,而我安装的是 opencv 3.4.16,所以就显示conflict
111
参考这个编译opencv3.4.16版本的cv_bridge,但是里面该cmakelist.txt的方法无效
https://zhuanlan.zhihu.com/p/392939687
以上链接有用部分是下载noetic版本的cv_bridge 并且编译安装。
222
参考这个链接的最后部分,修改系统默认链接的cv_bridge版本
https://blog.csdn.net/qq_18276949/article/details/114820705#t9
以上链接有用部分只有.bashrc中添加 环境变量
# 因为ros中的cv_bridge 是opecv4版本,与我安装的opencv3 版本冲突,所以编译了opencv3版本的cv_bridege,并且在这里source了
source ~/cmake_lib/vision_opencv-noetic/cv_bridge/build/devel/setup.bash
做完这两步就可以
./build_ros.sh
cd orb_slam/src/ORB_SLAM2
chmod +x build_ros.sh
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/baidunetdisk/ORB_SLAM2/Examples/ROS
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/baidunetdisk/Windfish_ORB_SLAM2/ORB_SLAM2/Examples/ROS
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/baidunetdisk/ORB_SLAM2_detailed_comments-master/Examples/ROS
./build_ros.sh
快速运行脚本
#!/bin/bash source ~/catkin_ws/devel/setup.bash { gnome-terminal -x bash -c "roscore;exec bash" }& sleep 1s { gnome-terminal -x bash -c "roslaunch zed_wrapper zed.launch " }& sleep 1s { gnome-terminal -x bash -c "cd baidunetdisk/Windfish_ORB_SLAM2/ORB_SLAM2/ export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/baidunetdisk/Windfish_ORB_SLAM2/ORB_SLAM2/Examples/ROS rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml false " }
运行效果图:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。