ORB-SLAM2中使用ROS遇到Bad argument (Invalid pointer to file storage) in cvGetFileNodeByName

来源:互联网 发布:程序员的鄙视链 庞博 编辑:程序博客网 时间:2024/06/05 11:00

在最近的调试代码中,有一个问题Bad argument (Invalid pointer to file storage) in cvGetFileNodeByName困扰了我一段时间,查询国内的方案也没有找到方法。在寻找了github的问答中,有人提出了解决方案,且亲测可行。

https://github.com/raulmur/ORB_SLAM2/issues/103

Ok with two days of struggling here is my solution:
First my environment:

Ubuntu 1604 under VMware
ROS Kinetic
OpenCV 2.4.10

I first tried to compile ORB_SLAM with the OpenCV3.1.0 inside ROS follow the introduction provided by@cmxnono, however error occurs while cmake:

CMake Error in CMakeLists.txt:  Imported target "opencv_xphoto" includes non-existent path    "/usr/include/opencv-3.1.0-dev/opencv"  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:  * The path was deleted, renamed, or moved to another location.  * An install or uninstall procedure did not complete successfully.  * The installation package was faulty and references files it does not  provide.

, as the make also failed unsurprisingly. I didn't spend lots of time on figure out why this happens (someone knows? ). Instead, I determine to install another OpenCV 3.1.0 aside of my original 2.4.10, into the path, say \home\jack\libs\opencv, then change findpackage for OpenCV in CMakeList.txt of ORB_SLAM to

  find_package(OpenCV 3 REQUIRED HINTS ${OpenCV_DIR} NO_DEFAULT_PATH)

After compile the ORB_SLAM again, change the opencv version for ros node to 3, too, then everything goes well for me.

By the way, I also tried to convert the rosbuild CMakeList file to catking_make version, it's doesn't help on this problem.


一般这个问题出现在编译ORB-SLAM2与编译ros版本的opencv版本不同,一个为2.4.8一个为kinetic自带的3.2.0。只要在cmakelist中讲opencv那一行统一为ros的3.2.0即可


find_package(OpenCV 3.2.0 REQUIRED)




阅读全文
0 0
原创粉丝点击