Ask Your Question
1

Compile error while building g2o for Kinetic RGBDSLAM

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

kywang gravatar image

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

gvdhoorn gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

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

I am having the same problem as you.

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

2 Answers

Sort by » oldest newest most voted
2

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

kywang gravatar image

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

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: https://raw.githubusercontent.com/fel... , from here: https://github.com/felixendres/rgbdsl... . Please try it, and thanks for anyone's help about this question.

edit flag offensive delete link more

Comments

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 -0500 )edit

install.sh 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 -0500 )edit
0

answered 2017-04-04 15:20:04 -0500

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

t.setRotation(t.rotation().angle()+_measurement);

to

t.setRotation((Eigen::Rotation2Dd)(t.rotation().angle()+_measurement));

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 1,029 times

Last updated: Apr 12 '17