zoukankan      html  css  js  c++  java
  • g2o error

    /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp: In function ‘void bundleAdjustment(std::vector<cv::Point3_<float> >, std::vector<cv::Point_<float> >, const cv::Mat&, cv::Mat&, cv::Mat&)’:
    /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:154:50: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::BlockSolver(g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType*&)’
         Block* solver_ptr = new Block ( linearSolver );     // 矩阵块求解器
                                                      ^
    /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:154:50: note: candidate is:
    In file included from /usr/local/include/g2o/core/block_solver.h:199:0,
                     from /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:10:
    /usr/local/include/g2o/core/block_solver.hpp:40:1: note: g2o::BlockSolver<Traits>::BlockSolver(std::unique_ptr<typename Traits::LinearSolverType>) [with Traits = g2o::BlockSolverTraits<6, 3>; typename Traits::LinearSolverType = g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >]
     BlockSolver<Traits>::BlockSolver(std::unique_ptr<LinearSolverType> linearSolver)
     ^
    /usr/local/include/g2o/core/block_solver.hpp:40:1: note:   no known conversion for argument 1 from ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType* {aka g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >*}’ to ‘std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> >, std::default_delete<g2o::LinearSolver<Eigen::Matrix<double, 6, 6, 0> > > >’
    /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:155:104: error: no matching function for call to ‘g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(Block*&)’
         g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg ( solver_ptr );
                                                                                                            ^
    /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:155:104: note: candidate is:
    In file included from /home/lzp/slamtest/graduationcode/p3/poseestimation/pose_estimation_3d2d.cpp:11:0:
    /usr/local/include/g2o/core/optimization_algorithm_levenberg.h:47:16: note: g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(std::unique_ptr<g2o::Solver>)
           explicit OptimizationAlgorithmLevenberg(std::unique_ptr<Solver> solver);
                    ^
    /usr/local/include/g2o/core/optimization_algorithm_levenberg.h:47:16: note:   no known conversion for argument 1 from ‘Block* {aka g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >*}’ to ‘std::unique_ptr<g2o::Solver>’
    make[2]: *** [CMakeFiles/pose_estimation_3d2d.dir/pose_estimation_3d2d.cpp.o] 错误 1
    make[1]: *** [CMakeFiles/pose_estimation_3d2d.dir/all] 错误 2
    make: *** [all] 错误 2

    g2o版本问题,换老版本即可。

    版权声明:本文为博主原创文章,未经博主允许不得转载。
  • 相关阅读:
    一、基础篇--1.1Java基础-反射的用途和实现
    一、基础篇--1.1Java基础-抽象类和接口的区别
    一、基础篇--1.1Java基础-重载和重写的区别
    一、基础篇--1.1Java基础-String、StringBuilder、StringBuffer
    一、基础篇--1.1Java基础-包装类的装箱和拆箱
    一、基础篇--1.1Java基础-int 和 Integer 有什么区别,Integer的值缓存范围
    一、基础篇--1.1Java基础-Exception、Error、RuntimeException与一般异常有何异同
    一、基础篇--1.1Java基础-final, finally, finalize 的区别
    c++ 中 *++ptr,++*ptr等的区别
    c++ new与char*,动态数组,sizeof的注意点总结
  • 原文地址:https://www.cnblogs.com/dtyy/p/7880908.html
Copyright © 2011-2022 走看看