高博14讲:第七讲中g20 3d3d 3d2d 报错的改动

原因:g2o版本更新引起的错误修改

3d3d报错:

/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp: In function ‘void bundleAdjustment(const std::vector<cv::Point3_<float> >&, const std::vector<cv::Point3_<float> >&, cv::Mat&, cv::Mat&)’:
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:280:74: error: ‘LinearSolverCSparse’ in namespace ‘g2o’ does not name a template typestd::unique_ptr<Block::LinearSolverType> linearSolver ( new g2o::LinearSolve^
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:280:115: error: expected primary-expression before ‘>’ tokenverType> linearSolver ( new g2o::LinearSolverCSparse<Block::PoseMatrixType>());^
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:280:117: error: expected primary-expression before ‘)’ tokenverType> linearSolver ( new g2o::LinearSolverCSparse<Block::PoseMatrixType>());^
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:287:9: error: ‘OptimizationAlgorithmLevenberg’ is not a member of ‘g2o’g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgo^
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:287:46: error: ‘solver’ was not declared in this scopeg2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgo^
/home/yk/桌面/slambook-master/ch7/pose_estimation_3d3d.cpp:287:59: error: expected type-specifierg2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgo^
CMakeFiles/pose_estimation_3d3d.dir/build.make:62: recipe for target 'CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o' failed
make[2]: *** [CMakeFiles/pose_estimation_3d3d.dir/pose_estimation_3d3d.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pose_estimation_3d3d.dir/all' failed
make[1]: *** [CMakeFiles/pose_estimation_3d3d.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

将pose_estimation_3d3d.cpp中的 bundleAdjustment() 函数中初始g2o修改一下:

原始代码:

    typedef g2o::BlockSolver< g2o::BlockSolverTraits<6,3> > Block;  // pose维度为 6, landmark 维度为 3Block::LinearSolverType* linearSolver = new g2o::LinearSolverEigen<Block::PoseMatrixType>(); // 线性方程求解器Block* solver_ptr = new Block( linearSolver );      // 矩阵块求解器g2o::OptimizationAlgorithmGaussNewton* solver = new g2o::OptimizationAlgorithmGaussNewton( solver_ptr );g2o::SparseOptimizer optimizer;optimizer.setAlgorithm( solver );

修改为:

    typedef g2o::BlockSolver< g2o::BlockSolverTraits<6,3> > Block;  // pose维度为 6, landmark 维度为 3// Block::LinearSolverType* linearSolver = new g2o::LinearSolverEigen<Block::PoseMatrixType>(); // 线性方程求解器std::unique_ptr<Block::LinearSolverType> linearSolver ( new g2o::LinearSolverEigen<Block::PoseMatrixType>());//Block* solver_ptr = new Block( linearSolver );      // 矩阵块求解器std::unique_ptr<Block> solver_ptr ( new Block ( std::move(linearSolver)));//g2o::OptimizationAlgorithmGaussNewton* solver = new g2o::OptimizationAlgorithmGaussNewton( solver_ptr );g2o::OptimizationAlgorithmGaussNewton* solver = new g2o::OptimizationAlgorithmGaussNewton ( std::move(solver_ptr));g2o::SparseOptimizer optimizer;optimizer.setAlgorithm( solver );

将pose_estimation_3d2d.cpp中的 bundleAdjustment() 函数中初始g2o修改一下:

原始代码:

    typedef g2o::BlockSolver< g2o::BlockSolverTraits<6,3> > Block;  // pose 维度为 6, landmark 维度为 3Block::LinearSolverType* linearSolver = new g2o::LinearSolverCSparse<Block::PoseMatrixType>(); // 线性方程求解器Block* solver_ptr = new Block ( linearSolver );     // 矩阵块求解器g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg ( solver_ptr );g2o::SparseOptimizer optimizer;optimizer.setAlgorithm ( solver );

修改为;

     typedef g2o::BlockSolver< g2o::BlockSolverTraits<6,3> > Block;  // pose 维度为 6, landmark 维度为 3//Block::LinearSolverType* linearSolver = new g2o::LinearSolverCSparse<Block::PoseMatrixType>(); // 线性方程求解器std::unique_ptr<Block::LinearSolverType> linearSolver ( new g2o::LinearSolverCSparse<Block::PoseMatrixType>());//Block* solver_ptr = new Block ( linearSolver );//std::unique_ptr<Block> solver_ptr ( new Block ( linearSolver));std::unique_ptr<Block> solver_ptr ( new Block ( std::move(linearSolver)));     // 矩阵块求解器//g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg ( solver_ptr);g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg ( std::move(solver_ptr));g2o::SparseOptimizer optimizer;optimizer.setAlgorithm ( solver );

参考:https://blog.csdn.net/ykwjt/article/details/89394086

高博14讲:第七讲中g20报错相关推荐

  1. 高博14讲--第七讲 视觉里程计-7.3 2D-2D:对极几何

    高博14讲--第七讲 视觉里程计-7.3 2D-2D:对极几何 基本问题 对极约束 对极约束推导过程 本质矩阵 八点法 八点法推导过程 本质矩阵$\ E$的SVD分解 单目SLAM的一些问题 尺度不确 ...

  2. 高博14讲--第三讲 三维空间刚体运动

    高博14讲--第三讲 三维空间刚体运动 旋转矩阵 点和向量.坐标系 坐标系间的欧式变换 变换矩阵与齐次坐标 旋转向量和欧拉角 旋转向量 欧拉角 四元数 四元数的定义 四元数的运算 用四元数表示旋转 四 ...

  3. 【转载】Chrome插件在高版本浏览器中安装报错解决

    为什么80%的码农都做不了架构师?>>>    Chrome插件在高版本浏览器中安装报错解决技术 maybe yes 发表于2014-12-17 17:20 原文链接 : http: ...

  4. 【Android NDK 开发】NDK C/C++ 代码崩溃调试 - Tombstone 报错信息日志文件分析 ( 使用 addr2line 命令行工具查找动态库中的报错代码位置 )

    文章目录 一.从 Tombstone 报错日志中查找报错动态库 二.addr2line 命令行工具使用 64 位动态库使用的 aarch64-linux-android-addr2line.exe 工 ...

  5. 【致敬嵌入式攻城狮第2期活动预热征文】解决瑞萨RA2E1开发板在RT-Thread的版本中编译报错 error: ‘board_cfg.h‘ file not found

    解决瑞萨RA2E1开发板在RT-Thread的版本中编译报错 error: 'board_cfg.h' file not found 继上上周在RA2E1开发板上跑通了RT-Thread最新版本的代码 ...

  6. 【Keil MDK中工程报错Browse information of one of more files is not available解决方法】

    [Keil MDK中工程报错Browse information of one of more files is not available解决方法] 今天在进行工程编写时,出现了这个错误Browse ...

  7. vue中打包报错Multiple chunks emit assets to the same filename static/js/chunk-6c337256.33476c81.js

    引了几个bpmn的包,导致Jenkins部署报错,找原因一直以为是引入的包有问题,后来发现是在打包的过程中会对生成的文件切割导致文件名重复了,在vue.config.js中配置以下配置完美解决,之前我 ...

  8. python2中的unicode_python2中的unicode()函数在python3中会报错:

    python2中的unicode()函数在python3中会报错:NameError: name 'unicode' is not defined There is no such name in P ...

  9. IDEA快捷键及xml文件中网址报错

    Alt+Shift+Tab 切换窗口(从后往前) div+Tab             补全为         <div></div> #box+Tab           ...

最新文章

  1. 详细介绍Java垃圾回收机制
  2. 通过命令删除在ambari界面上无法删除节点上服务
  3. Linux上怎样实现文件夹重命名
  4. linux decode函数,Oracle 中 decode 函数用法
  5. shell命令行快捷键
  6. 大学四年怎样过,做到这六点,甩别人一条街
  7. expdp的常用用法
  8. Keras网络层之“关于Keras的层(Layer)”
  9. 实验二 VB基本界面设计
  10. Ubuntu16 e1000e驱动安装
  11. python opc
  12. 请定义一个方法用于判断一个字符串是否是对称的字符串,并在主方法中测试方法。例如:“abcba“、“上海自来水来自海上“均为对称字符串。
  13. 央视 315 晚会曝光数据泄露
  14. antd菜单使用动态图标
  15. Kali Linux蓝牙连接问题解决
  16. delphi如何将字符串复制到剪贴板上
  17. [bzoj5473]仙人掌
  18. python 股票市场分析实战
  19. 我的MATLAB学习
  20. JS计算数组各数据所占百分比

热门文章

  1. 起底飞书:在产品背后,看见现代管理哲学
  2. 手把手教你,抖音去水印-有手就能学会
  3. 海盗喝啤酒问题Java解法
  4. 为了让师妹20分钟学会canvas,我熬夜苦肝本文外加一个小项目【❤️建议收藏❤️】
  5. 数据库构造器之查询构造器构建
  6. could not write file:C:\Users\user\Desktop\KunMing40m\KunMing40m\.classpath
  7. Ubuntu下UnixC的第二天
  8. 经济管理专业必备的15种国内数据库推荐
  9. 迅为IMX6Q开发板 Buildroot文件系统mqtt测试
  10. ubuntu18.04安装搜狗输入法