我试图用SLAM弄脏手,我开始使用ORB-SLAM2库。
我已下载了TUM序列,并希望使用ROS。所以我按照这个page执行了步骤。
在第7步,第2部分中,当我运行./build_ros.sh
时,出现以下错误:
In file included from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../Thirdparty/g2o/g2o/types/../core/optimizable_graph.h:41:0,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../Thirdparty/g2o/g2o/types/../core/base_vertex.h:30,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h:34,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../include/LoopClosing.h:34,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../include/LocalMapping.h:26,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../include/Tracking.h:31,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../include/System.h:29,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/AR/ViewerAR.h:29,
from /home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/AR/ViewerAR.cc:21:
/home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/../../../Thirdparty/g2o/g2o/types/../core/jacobian_workspace.h:36:24: fatal error: g2o/config.h: No such file or directory
compilation terminated.
CMakeFiles/MonoAR.dir/build.make:198: recipe for target 'CMakeFiles/MonoAR.dir/src/AR/ViewerAR.cc.o' failed
make[2]: *** [CMakeFiles/MonoAR.dir/src/AR/ViewerAR.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
我去检查了g2o
文件夹,并且有一个名为config.h
的文件。
那么为什么我仍然会收到错误?
答案 0 :(得分:1)
CMakeLists.txt
中的/home/sarvagya/Desktop/Swaayatt/ORB_SLAM2/Examples/ROS/ORB_SLAM2/
尝试添加
${PROJECT_SOURCE_DIR}/../../../Thirdparty
到include_directories()
line 44
的列表(如果你没有更改文件,它应该在那一行)
添加此行告诉cmake在哪里找到g2o/config.h
。
答案 1 :(得分:0)
根据g2o/config.h
中缺少jacobian_workspace.h
的信息,但是当我查看文件时,却未在第36行找到include
。我是否遗漏了某些内容,或者您改变什么?