ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Compile error while building g2o for Kinetic RGBDSLAM

asked 2016-12-29 02:36:16 -0600

kywang gravatar image

updated 2016-12-30 08:06:20 -0600

gvdhoorn gravatar image

When I follow the procedure of , to build g2o,

mkdir build
cd build
cmake ../

I got the following compile error,

/home/user/g2o/g2o-master/g2o/types/slam2d/edge_se2_pointxy_bearing.cpp: In member function ‘virtual void g2o::EdgeSE2PointXYBearing::initialEstimate(const VertexSet&, g2o::OptimizableGraph::Vertex*)’:
/home/user/g2o/g2o-master/g2o/types/slam2d/edge_se2_pointxy_bearing.cpp:51:52: error: no matching function for call to ‘g2o::SE2::setRotation(Eigen::Rotation2D<double>::Scalar)’
In file included from /home/user/g2o/g2o-master/g2o/types/slam2d/vertex_se2.h:33:0,
                 from /home/user/g2o/g2o-master/g2o/types/slam2d/edge_se2_pointxy_bearing.h:31,
                 from /home/user/g2o/g2o-master/g2o/types/slam2d/edge_se2_pointxy_bearing.cpp:27:
/home/user/g2o/g2o-master/g2o/types/slam2d/se2.h:59:12: note: candidate: void g2o::SE2::setRotation(const Rotation2Dd&)
       void setRotation(const Eigen::Rotation2Dd& R_) {_R=R_;}
/home/user/g2o/g2o-master/g2o/types/slam2d/se2.h:59:12: note:   no known conversion for argument 1 from ‘Eigen::Rotation2D<double>::Scalar {aka double}’ to ‘const Rotation2Dd& {aka const Eigen::Rotation2D<double>&}’
g2o/types/slam2d/CMakeFiles/types_slam2d.dir/build.make:206: recipe for target 'g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy_bearing.cpp.o' failed
make[2]: *** [g2o/types/slam2d/CMakeFiles/types_slam2d.dir/edge_se2_pointxy_bearing.cpp.o] Error 1
CMakeFiles/Makefile2:1016: recipe for target 'g2o/types/slam2d/CMakeFiles/types_slam2d.dir/all' failed
make[1]: *** [g2o/types/slam2d/CMakeFiles/types_slam2d.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

What is the root cause of it and how can I solve it? Thanks.

edit retag flag offensive close merge delete


Please just accept your own answer instead of closing the question. Accepted answers mark a question as answered, which has higher visibility than a closed question.


gvdhoorn gravatar image gvdhoorn  ( 2016-12-30 08:07:52 -0600 )edit

I am having the same problem as you.

Yahahaa gravatar image Yahahaa  ( 2017-04-11 10:37:57 -0600 )edit

2 Answers

Sort by » oldest newest most voted

answered 2016-12-30 05:20:09 -0600

kywang gravatar image

updated 2017-04-12 20:30:50 -0600

Sorry for the late reply. I followed the following script procedure to set up and build the software, the errors were gone, though I did not dig out the root cause. The script: , from here: . Please try it, and thanks for anyone's help about this question.

edit flag offensive delete link more


Can you detail your solution please?i have just faced same problem.

ali ekber celik gravatar image ali ekber celik  ( 2017-03-05 14:59:30 -0600 )edit uses branch "c++03", not "master" when it clones g2o git repository . The author of rgbdslam, Felix Endes modified some configuration code.

jylee0121 gravatar image jylee0121  ( 2017-10-12 18:59:17 -0600 )edit

answered 2017-04-04 15:20:04 -0600

try changing the offending line in g2o/types/slam2d/edge_se2_pointxy_bearing.cpp from:




This fixes that particular compile issue for me. Haven't finished compiling it yet tho. And I don't know if it prevent the software from working properly. My C++ skills are noobish.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-12-29 02:36:16 -0600

Seen: 1,161 times

Last updated: Apr 12 '17