1 github仓库
https://github.com/ToniRV/NeRF-SLAM
2 步骤
照着作者给的readme一步一步来,别直接下载master,因为直接下载的master没有git中链接的第三方库。跟着readme里的指示来
git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules
只有这行就可以了,第二行应该是不用的
3 报错
基本所有的报错都在gtsam编译这一步
cmake ./thirdparty/gtsam -DGTSAM_BUILD_PYTHON=1 -B build_gtsam
cmake --build build_gtsam --config RelWithDebInfo -j
cd build_gtsam
make python-install
就是这里
1 pyparsing.exceptions.ParseException: Expected string_end, found ‘namespace’ (at char 1249), (line:46, col:1
pyparsing.exceptions.ParseException: Expected string_end, found 'namespace' (at char 1249), (line:46, col:1)
python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/build.make:75: recipe for target 'python/gtsam_unstable.cpp' failed
make[2]: *** [python/gtsam_unstable.cpp] Error 1
CMakeFiles/Makefile2:32358: recipe for target 'python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/all' failed
make[1]: *** [python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/all] Error 2
这大概是第一个报错的信息,问题出在python/gtsam_unstable.cpp
里面
https://github.com/ToniRV/NeRF-SLAM/issues/9解决方法在这里
A hack that is useful for me:
directly remove +stringEnd at the 48th line of NeRF-SLAM/thirdparty/gtsam/wrap/gtwrap/interface_parser/module.py
删除NeRF-SLAM/thirdparty/gtsam/wrap/gtwrap/interface_parser/module.py
里48行的+stringEnd
2 /usr/include/c++/7/bits/alloc_traits.h:392:27: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’
/usr/include/c++/7/bits/alloc_traits.h:392:27: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’
报错如上,解决办法在
https://github.com/ToniRV/NeRF-SLAM/issues/7
大概就是
You may change const std::vector<const gtsam::Matrix&>& to const std::vector<gtsam::Matrix>& use & as pointer is not proper define of std::vector
将build_gtsam/python/linear.cpp
里面的std::vector<const gtsam::Matrix&>&
改为std::vector<gtsam::Matrix>&
3 /usr/include/c++/7/ext/new_allocator.h:93:7: error: ‘const _Tp* __gnu_cxx::new_allocator<_Tp>: :address(__gnu_cxx::new_allocator<_Tp>::const_reference) const [with _Tp = const Eigen: :Matrix<double, -1, -1>; _gnu
很多解决方法都在
https://github.com/ToniRV/NeRF-SLAM/issues/7
可以自己找找,不过我找到个解决一切的办法,也是在上述链接中。想自己慢慢改的也可以接着看,不想改了见下一条。
4
牛逼好吧,删了再git一次后重新编译,啥问题也没有了