VINS-mono ubuntu20.04bug修复总结

目录

运行roslaunch vins_estimator euroc.launch 发生process has died报错 [feature_tracker-2] [pose_graph-4]

/home/shaozu/output/pose_graph/ not exists问题


运行roslaunch vins_estimator euroc.launch 发生process has died报错 [feature_tracker-2] [pose_graph-4]

我用的ubuntu20.04系统,cv_bridge默认4.2版本,系统安装有opencv4.5和opencv3.2,这个错误是由于版本不一致问题导致的

马后炮:还是建议使用Ubuntu18或者16,opencv安装3.2,可以省去很多问题

下面为解决方法:

在路径/opt/ros/noetic/share/cv_bridge/cmake/(路径大同小异)找到cv_bridgeConfig.cmake文件

sudo gedit cv_bridgeConfig.cmake进行编辑

#号表示原代码 下面对应修改后代码

#if(NOT "include;/usr/include/opencv4 " STREQUAL " ")
if(NOT "include;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/include/opencv " STREQUAL " ")
  set(cv_bridge_INCLUDE_DIRS "")
#  set(_include_dirs "include;/usr/include/opencv4")
   set(_include_dirs "include;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/include/opencv")

#set(libraries "cv_bridge;/usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_features2d.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_flann.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ml.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_photo.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_stitching.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_video.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_videoio.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_aruco.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_bgsegm.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_bioinspired.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ccalib.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_datasets.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn_objdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dnn_superres.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_dpm.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_face.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_freetype.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_fuzzy.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_hdf.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_hfs.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_img_hash.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_line_descriptor.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_optflow.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_phase_unwrapping.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_plot.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_quality.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_reg.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_rgbd.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_saliency.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_shape.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_stereo.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_structured_light.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_superres.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_surface_matching.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_text.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_tracking.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_viz.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_ximgproc.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_xobjdetect.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_xphoto.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_core.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.4.2.0;/usr/lib/x86_64-linux-gnu/libopencv_imgcodecs.so.4.2.0")

#包有很多,一般加入四个主要的基本够用
set(libraries "cv_bridge;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/lib/libopencv_calib3d.so.3.2.0;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/lib/libopencv_imgproc.so.3.2.0;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/lib/libopencv_core.so.3.2.0;/home/arrow/lib_z/opencv-3.2.0/opencv3-lib/lib/libopencv_highgui.so.3.2.0;")

重新catkin_make项目即可,上述为较为简单的一种方法

分享一个提取当前文件夹下所有文件的方法:

创建shell脚本如下:

gedit test.sh

#!/bin/bash
# get all filename in specified path

path=$1
files=$(ls $path)
for filename in $files
do
   echo $filename; >> name.txt
done

粘贴如下内容,运行即可,命令如下

bash test.sh

其他一些方法可以参考:

(33条消息) 解决Ubuntu环境下ROS Kinetic中的cv_bridge和自己安装OpenCV 2.4.xx兼容性笔记_没有博士学位的菜狗的博客-CSDN博客

(33条消息) ROS学习:cv_bridge与opencv版本冲突三种解决方案_Mr.Qin_的博客-CSDN博客_cv_bridge

/home/shaozu/output/pose_graph/ not exists问题

最简单的方法为将缺的文件夹加上即可

(35条消息) 运行VINS-mono出现:/home/shaozu/output/pose_graph/ not exists问题。_男人黄的博客-CSDN博客

你可能感兴趣的:(slam,c++,opencv,计算机视觉)