Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装时候g2o相关函数报错 #9

Open
Sunchanghao opened this issue Nov 14, 2019 · 5 comments
Open

安装时候g2o相关函数报错 #9

Sunchanghao opened this issue Nov 14, 2019 · 5 comments

Comments

@Sunchanghao
Copy link

报错信息如下
/home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp:448:103: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> >::BlockSolver(std::remove_reference<std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, -1, -1> > >&>::type)’
std::unique_ptr g2o::BlockSolverX solver_ptr (new g2o::BlockSolverX( std::move(linearSolver)));
^
In file included from /usr/local/include/g2o/core/block_solver.h:189:0,
from /home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp:11:
/usr/local/include/g2o/core/block_solver.hpp:39:1: note: candidate: g2o::BlockSolver::BlockSolver(g2o::BlockSolver::LinearSolverType*) [with Traits = g2o::BlockSolverTraits<-1, -1>; g2o::BlockSolver::LinearSolverType = g2o::LinearSolver<Eigen::Matrix<double, -1, -1> >]
BlockSolver::BlockSolver(LinearSolverType* linearSolver) :
^
/usr/local/include/g2o/core/block_solver.hpp:39:1: note: no known conversion for argument 1 from ‘std::remove_reference<std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, -1, -1> > >&>::type {aka std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, -1, -1> > >}’ to ‘g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> >::LinearSolverType* {aka g2o::LinearSolver<Eigen::Matrix<double, -1, -1> >}’
/home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp:450:116: error: no matching function for call to ‘g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(std::remove_reference<std::unique_ptr<g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> > >&>::type)’
g2o::OptimizationAlgorithmLevenberg solver = new g2o::OptimizationAlgorithmLevenberg(std::move(solver_ptr));
^
In file included from /home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp:13:0:
/usr/local/include/g2o/core/optimization_algorithm_levenberg.h:45:16: note: candidate: g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(g2o::Solver
)
explicit OptimizationAlgorithmLevenberg(Solver
solver);
^
/usr/local/include/g2o/core/optimization_algorithm_levenberg.h:45:16: note: no known conversion for argument 1 from ‘std::remove_reference<std::unique_ptr<g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> > >&>::type {aka std::unique_ptr<g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> > >}’ to ‘g2o::Solver*’
/home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp: In member function ‘void ygz::BackendSlidingWindowG2O::LocalBAWithoutIMU(bool)’:
/home/sch/GAAS/software/SLAM/ygz_slam_ros/backend/src/BackendSlidingWindowG2O.cpp:668:103: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> >::BlockSolver(std::remove_reference<std::unique_ptr<g2o::LinearSolver<Eigen::Matrix<double, -1, -1> > >&>::type)’
std::unique_ptr g2o::BlockSolverX solver_ptr (new g2o::BlockSolverX( std::move(linearSolver)) );

下面还有很长都是类似的报错
看起来可能是版本问题 
请教一下如何修改
谢谢

@Sunchanghao
Copy link
Author

解决了 GAAS的项目是基于这个修改的 他们使用了DBOW3 所以g2o需要使用最新版本

@ns15417
Copy link

ns15417 commented Jan 6, 2020

@Sunchanghao 所以您是又下载了最新版本的g2o库运行的吗?而不是使用他们project中的g2o?

@Sunchanghao
Copy link
Author

@ns15417 对 是这样的

@ns15417
Copy link

ns15417 commented Jan 9, 2020

@Sunchanghao 您还保存有对应的g2o链接吗?看到有人说用salm14讲里面的g2o,我在高博的slambook2里面找到了这个:https://github.com/RainerKuemmerle/g2o/tree/9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a
不知道您用的是这个版本的g2o吗?
O(∩_∩)O谢谢

@Sunchanghao
Copy link
Author

@ns15417 我是去g20官方git的最新版本 没有用高博提供的 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants