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

g20 problem when make #29

Open
wanderhlx opened this issue Sep 13, 2018 · 1 comment
Open

g20 problem when make #29

wanderhlx opened this issue Sep 13, 2018 · 1 comment

Comments

@wanderhlx
Copy link

Hi~ I meet some problems when I build the project with G2O, some problem appeared:

/home/hlx/pl-slam-master/src/mapHandler.cpp:3967:77: error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::BlockSolver(g2o::BlockSolver<g2o::BlockSolverTraits<6, 3> >::LinearSolverType*&)’
g2o::BlockSolver_6_3* solver_ptr = new g2o::BlockSolver_6_3(linearSolver);
and at last:
CMakeFiles/plslam.dir/build.make:62: recipe for target 'CMakeFiles/plslam.dir/src/mapHandler.cpp.o' failed
make[2]: *** [CMakeFiles/plslam.dir/src/mapHandler.cpp.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/plslam.dir/all' failed
make[1]: *** [CMakeFiles/plslam.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I wander if I installed the wrong version of g2o or are there any other reasons cause this error??

@limin199
Copy link

g2o::BlockSolver_6_3::LinearSolverType* linearSolver;
linearSolver = new g2o::LinearSolverCholmodg2o::BlockSolver_6_3::PoseMatrixType();
g2o::BlockSolver_6_3* solver_ptr = new g2o::BlockSolver_6_3(linearSolver);
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(solver_ptr);

Change the above code to

std::unique_ptr<g2o::BlockSolver_6_3::LinearSolverType> linearSolver(new g2o::LinearSolverCholmod<g2o::BlockSolver_6_3::PoseMatrixType>());
std::unique_ptr<g2o::BlockSolver_6_3> solver_ptr(new g2o::BlockSolver_6_3(std::move(linearSolver)));
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(std::move(solver_ptr));

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