跑VINS_Mono的时候每次运行
roslaunch vins_estimator euroc.launch
就报错:
OpenCV Error: Bad argument (Invalid pointer to file storage) in cvGetFileNodeByName, file /build/buildd/opencv-2.4.8+dfsg1/modules/core/src/persistence.cpp, line 740
[INFO] [1498548740.315501276]: Loaded vins_folder: /home/duyl/catkin_ws/src/VINS-Mono/feature_tracker/../config/../
OpenCV Error: Bad argument (Invalid pointer to file storage) in cvGetFileNodeByName, file /build/buildd/opencv-2.4.8+dfsg1/modules/core/src/persistence.cpp, line 740
terminate called after throwing an instance of ‘cv::Exception’
what(): /build/buildd/opencv-2.4.8+dfsg1/modules/core/src/persistence.cpp:740: error: (-5) Invalid pointer to file storage in function cvGetFileNodeByNameterminate called after throwing an instance of ‘cv::Exception’
what(): /build/buildd/opencv-2.4.8+dfsg1/modules/core/src/persistence.cpp:740: error: (-5) Invalid pointer to file storage in function cvGetFileNodeByName
今天这个问题终于解决了.
查看issues里面说到可能是opencv的版本的问题,于是多方尝试。
刚开始装的是ros附带的opencv2.4.8,后来看slambook装了一个opencv3.1.0,看了这个issue之后,下载了opencv2.4.8,然后重新安装。(安装过程中还遇到了点小麻烦,百度之予以解决)装完2.4.8之后catkin_make然后运行roslaunch vins_estimator euroc.launch还是有错误。
然后回忆了一下自己的操作跟VINS的github主页上有什么不一样的地方,发现自己装了ros-indigo-opencv3,而主页上只说明让安装ros-kinetc-opencv3,并没有让Ubuntu14.04版本的用户去安装这个ros-indigo-opencv3,所以我就试一试把这个卸载了。
sudo apt-get remove ros-indigo-opencv3
然后重新清理catkin_ws里的build文件夹,重新catkin_make,再运行roslaunch的时候发现已经没有那个错误了!!!
真是波折啊
本文记录了解决VINS_Mono在运行时出现的OpenCV错误的过程。通过对比官方指南,发现安装了不合适的ROS版本,卸载并重新配置后成功解决了问题。
2332





