Compile error while building g2o for Kinetic RGBDSLAM
When I follow the procedure of https://github.com/felixendres/g2o , to build g2o,
mkdir build
cd build
cmake ../
make
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)’
t.setRotation(t.rotation().angle()+_measurement);
^
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.
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.
Thanks.
I am having the same problem as you.