gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.3k stars 1.99k forks source link

编译sophus库时出现报错,没有查到解决办法 #281

Closed Yikkkkk closed 1 year ago

Yikkkkk commented 1 year ago

首先是安装,采取的是网上很多人用的方法: git clone https://github.com/strasdat/Sophus.git cd Sophus git checkout a621ff mkdir build cd build cmake .. make

在make的时候出现报错,日志如下: /usr/bin/cmake -S/home/yanglilin/Sophus -B/home/yanglilin/Sophus/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/yanglilin/Sophus/build/CMakeFiles /home/yanglilin/Sophus/build/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: 进入目录“/home/yanglilin/Sophus/build” make -f CMakeFiles/Sophus.dir/build.make CMakeFiles/Sophus.dir/depend make[2]: 进入目录“/home/yanglilin/Sophus/build” cd /home/yanglilin/Sophus/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/yanglilin/Sophus /home/yanglilin/Sophus /home/yanglilin/Sophus/build /home/yanglilin/Sophus/build /home/yanglilin/Sophus/build/CMakeFiles/Sophus.dir/DependInfo.cmake --color= make[2]: 离开目录“/home/yanglilin/Sophus/build” make -f CMakeFiles/Sophus.dir/build.make CMakeFiles/Sophus.dir/build make[2]: 进入目录“/home/yanglilin/Sophus/build” [ 5%] Building CXX object CMakeFiles/Sophus.dir/sophus/se2.cpp.o /usr/bin/c++ -DSophus_EXPORTS -O3 -DNDEBUG -fPIC -Wall -Werror -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -o CMakeFiles/Sophus.dir/sophus/se2.cpp.o -c /home/yanglilin/Sophus/sophus/se2.cpp /home/yanglilin/Sophus/sophus/se2.cpp: In member function ‘Eigen::Matrix3d Sophus::SE2::matrix() const’: /home/yanglilin/Sophus/sophus/se2.cpp:104:29: error: ‘Eigen::MatrixBase<Eigen::Matrix<double, 3, 3> >::ColXpr’ {aka ‘class Eigen::Block<Eigen::Matrix<double, 3, 3>, 3, 1, 1, 32>’} has no member named ‘head’ 104 | homogeniousmatrix.col(2).head(2) = translation; | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp: In member function ‘Eigen::Matrix<double, 3, 3> Sophus::SE2::Adj() const’: /home/yanglilin/Sophus/sophus/se2.cpp:115:7: error: ‘Eigen::Matrix3d’ {aka ‘class Eigen::Matrix<double, 3, 3>’} has no member named ‘topLeftCorner’ 115 | res.topLeftCorner<2,2>() = R; | ^~~~~ /home/yanglilin/Sophus/sophus/se2.cpp:115:26: error: expected primary-expression before ‘)’ token 115 | res.topLeftCorner<2,2>() = R; | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Eigen::Matrix3d Sophus::SE2::hat(const Vector3d&)’: /home/yanglilin/Sophus/sophus/se2.cpp:126:9: error: ‘Eigen::Matrix3d’ {aka ‘class Eigen::Matrix<double, 3, 3>’} has no member named ‘topLeftCorner’ 126 | Omega.topLeftCorner<2,2>() = SO2::hat(v[2]); | ^~~~~ /home/yanglilin/Sophus/sophus/se2.cpp:126:28: error: expected primary-expression before ‘)’ token 126 | Omega.topLeftCorner<2,2>() = SO2::hat(v[2]); | ^ /home/yanglilin/Sophus/sophus/se2.cpp:127:16: error: ‘Eigen::MatrixBase<Eigen::Matrix<double, 3, 3> >::ColXpr’ {aka ‘class Eigen::Block<Eigen::Matrix<double, 3, 3>, 3, 1, 1, 32>’} has no member named ‘head’ 127 | Omega.col(2).head<2>() = v.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:127:24: error: expected primary-expression before ‘)’ token 127 | Omega.col(2).head<2>() = v.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp:127:30: error: ‘const Vector3d’ {aka ‘const class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 127 | Omega.col(2).head<2>() = v.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:127:38: error: expected primary-expression before ‘)’ token 127 | Omega.col(2).head<2>() = v.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Eigen::Vector3d Sophus::SE2::vee(const Matrix3d&)’: /home/yanglilin/Sophus/sophus/se2.cpp:135:17: error: ‘Eigen::Vector3d’ {aka ‘class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 135 | upsilon_omega.head<2>() = Omega.col(2).head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:135:25: error: expected primary-expression before ‘)’ token 135 | upsilon_omega.head<2>() = Omega.col(2).head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp:135:42: error: ‘const ColXpr’ {aka ‘const class Eigen::Block<Eigen::Matrix<double, 3, 3>, 3, 1, 1, 32>’} has no member named ‘head’ 135 | upsilon_omega.head<2>() = Omega.col(2).head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:135:50: error: expected primary-expression before ‘)’ token 135 | upsilon_omega.head<2>() = Omega.col(2).head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp:136:37: error: ‘const Matrix3d’ {aka ‘const class Eigen::Matrix<double, 3, 3>’} has no member named ‘topLeftCorner’ 136 | upsilon_omega[2] = SO2::vee(Omega.topLeftCorner<2,2>()); | ^~~~~ /home/yanglilin/Sophus/sophus/se2.cpp:136:56: error: expected primary-expression before ‘)’ token 136 | upsilon_omega[2] = SO2::vee(Omega.topLeftCorner<2,2>()); | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Eigen::Vector3d Sophus::SE2::lieBracket(const Vector3d&, const Vector3d&)’: /home/yanglilin/Sophus/sophus/se2.cpp:143:26: error: ‘const Vector3d’ {aka ‘const class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 143 | Vector2d upsilon1 = v1.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:143:34: error: expected primary-expression before ‘)’ token 143 | Vector2d upsilon1 = v1.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp:144:26: error: ‘const Vector3d’ {aka ‘const class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 144 | Vector2d upsilon2 = v2.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:144:34: error: expected primary-expression before ‘)’ token 144 | Vector2d upsilon2 = v2.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Eigen::Matrix3d Sophus::SE2::d_lieBracketab_by_d_a(const Vector3d&)’: /home/yanglilin/Sophus/sophus/se2.cpp:156:26: error: ‘const Vector3d’ {aka ‘const class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 156 | Vector2d upsilon2 = v2.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:156:34: error: expected primary-expression before ‘)’ token 156 | Vector2d upsilon2 = v2.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Sophus::SE2 Sophus::SE2::exp(const Vector3d&)’: /home/yanglilin/Sophus/sophus/se2.cpp:169:29: error: ‘const Vector3d’ {aka ‘const class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 169 | Vector2d upsilon = update.head<2>(); | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:169:37: error: expected primary-expression before ‘)’ token 169 | Vector2d upsilon = update.head<2>(); | ^ /home/yanglilin/Sophus/sophus/se2.cpp: In static member function ‘static Eigen::Vector3d Sophus::SE2::log(const Sophus::SE2&)’: /home/yanglilin/Sophus/sophus/se2.cpp:223:17: error: ‘Eigen::Vector3d’ {aka ‘class Eigen::Matrix<double, 3, 1>’} has no member named ‘head’ 223 | upsilon_theta.head<2>() = Vinv*se2.translation; | ^~~~ /home/yanglilin/Sophus/sophus/se2.cpp:223:25: error: expected primary-expression before ‘)’ token 223 | upsilon_theta.head<2>() = Vinv*se2.translation; | ^ make[2]: [CMakeFiles/Sophus.dir/build.make:79:CMakeFiles/Sophus.dir/sophus/se2.cpp.o] 错误 1 make[2]: 离开目录“/home/yanglilin/Sophus/build” make[1]: [CMakeFiles/Makefile2:91:CMakeFiles/Sophus.dir/all] 错误 2 make[1]: 离开目录“/home/yanglilin/Sophus/build” make: *** [Makefile:144:all] 错误 2

暂时没有找到解决办法~ 感谢回复!