VINS-MONO一些踩坑记录
0 本机环境
作者的环境是Ubuntu 18.04 ros melodic opencv 4.1.1 Eigen 3.3.9 ceres solver-1.14
- 跟VINS-MONO官方环境
( Ubuntu 16.04, ROS Kinetic, OpenCV 3.3.1, Eigen 3.3.3, ceres solver)
不同
1 踩坑开始
- 第一个错误:
‘CV_GRAY2BGR’ was not declared in this scope
这是由于opencv版本高引起的,解决方法添加头文件:
#include <opencv2/imgproc/types_c.h>
- 第二个错误:
‘CV_AA’ was not declared in this scope
添加头文件的解决方案:
#include <opencv2/imgproc/imgproc_c.h>
- 第三个错误:
‘CV_CALIB_CB_ADAPTIVE_THRESH’ was not declared in this scope
添加头文件的解决方案:
#include <opencv2/calib3d/calib3d_c.h>
- 第四次报错:
‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
添加头文件的解决方案:
#include <opencv2/imgproc/imgproc_c.h>
2 坑里打滚
此时直接catkin_make虽然可以通过,但运行时会遇到怀疑人生的错误。
[vins_estimator-2] process has died [pid 12283, exit code -11, cmd /home/xzt/catkin_ws/devel/lib/vins_estimator/vins_estimator __name:=vins_estimator __log:=/home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/vins_estimator-2.log]. log file: /home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/vins_estimator-2*.log [feature_tracker-1] process has died [pid 12282, exit code -11, cmd /home/xzt/catkin_ws/devel/lib/feature_tracker/feature_tracker __name:=feature_tracker __log:=/home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/feature_tracker-1.log]. log file: /home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/feature_tracker-1*.log [pose_graph-3] process has died [pid 12284, exit code -11, cmd /home/xzt/catkin_ws/devel/lib/pose_graph/pose_graph __name:=pose_graph __log:=/home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/pose_graph-3.log]. log file: /home/xzt/.ros/log/80f99180-e248-11ec-a970-84c5a661654d/pose_graph-3*.log
其实这个问题vins-mono
的issue也有人提到,对方的解决方案是减少CV版本,问题得到有效解决。此时,我们大胆怀疑应该是ROS自带的CV——bridge
与CV
版本不匹配的问题。 遇到一堆不靠谱的改变cv_bridge
是的,终于遇到了一个可靠的,这里有链接: https://blog.csdn.net/bigdog_1027/article/details/79092263?spm=1001.2014.3001.5502
3 问题解决
修改后,就可以跑了。