一起做RGB-D SLAM (6)学习心得

本文介绍了解决g2o编译时遇到的两个常见问题的方法:一是找不到CSPARSE依赖,可通过安装libsuitesparse-dev解决;二是因版本问题导致的编译错误,按特定顺序重新编译g2o即可。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在编译过程中遇到如下问题:

Could NOT find CSPARSE (missing:  CSPARSE_INCLUDE_DIR CSPARSE_LIBRARY) 
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CSPARSE_INCLUDE_DIR

解决方案:

运行 sudo apt-get install libsuitesparse-dev 安装相关依赖包。

 

二、错误如下

 required from here
/usr/local/include/g2o/core/block_solver.hpp:182:5: error: request for member ‘resize’ in ‘schurMatrixLookup->g2o::SparseBlockMatrixHashMap<MatrixType>::blockCols<Eigen::Matrix<double, 6, 6, 0> >()’, which is of non-class type ‘int’
     schurMatrixLookup->blockCols().resize(_Hschur->blockCols().size());

解决方案:

产生这个错误的原因是g2o版本的问题,按照如下顺序进行安装即可。

git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install

具体情况可参考高博大佬给出的错误解决博客:

一起做RGB-D SLAM(8) (关于调试与补充内容)

最终结果:

 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cchangcs

谢谢你的支持~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值