ORB_SLAM2 with XTION的编译问题及解决(1)
源链接为https://github.com/chaizheng2157/RGBD_ORB_SLAM2_RT
其中里面有两个包要编译,分别是g2o_with_orbslam2和ORB_SLAM2_modified。该文章为记录如何成功编译g2o_with_orbslam2,并解决问题。
1. 问题1
error: no matching function for call to ‘g2o::SE2::setRotation(Eigen::Rotation2D::Scalar)’
t.setRotation(t.rotation().angle()+_measurement);
解决方法:
把
t.setRotation(t.rotation().angle()+_measurement);
改为
t.setRotation((Eigen::Rotation2Dd)(t.rotation().angle()+_measurement));
2.问题2
该g2o_with_orbslam2中的很多报错与g2o的包有关(其实就是和官方的有出入),即RGBD_ORB_SLAM2_RT/orb_slam_rgbd/g2o_with_orbslam2/g2o,可以上以下网站下载替换掉
https://github.com/RainerKuemmerle/g2o
接下来的问题遇到再解决。。。