lsd_slam icon indicating copy to clipboard operation
lsd_slam copied to clipboard

error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] Eigen::Map<const g2o::Vector7d> v(m);

Open TengFeiHan0 opened this issue 6 years ago • 3 comments

when running LSD-slam on my laptop, I received these unexpected errors

GlobalMapping/g2oTypeSim3Sophus.h:96:20: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
   Eigen::Map<const g2o::Vector7d> v(m);
                    ^~~
/home/htf/catkin_ws/src/third_parties/lsd_slam/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:96:33: error: template argument 1 is invalid
   Eigen::Map<const g2o::Vector7d> v(m);
                                 ^
/home/htf/catkin_ws/src/third_parties/lsd_slam/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:96:38: error: invalid conversion from ‘const double*’ to ‘int’ [-fpermissive]
   Eigen::Map<const g2o::Vector7d> v(m);
                                      ^
/home/htf/catkin_ws/src/third_parties/lsd_slam/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:97:38: error: no matching function for call to ‘Sophus::Sim3Group<double>::exp(int&)’
 setMeasurement(Sophus::Sim3d::exp(v));

does anyone has encountered this problem? hope to get some clues, Thank you in advance.

TengFeiHan0 avatar Jul 12 '18 02:07 TengFeiHan0

Same here g++ 5.4

tim37021 avatar Jul 26 '18 03:07 tim37021

line 96 @ g2oTypeSim3Sophus.h

Eigen::Map<const g2o::Vector7d> v(m);

change to

Eigen::Map<const Eigen::Matrix<double, 7 ,1> > v(m);

city22 avatar Nov 28 '18 11:11 city22

@city22 's solution worked for me

MrMinemeet avatar Jul 15 '19 13:07 MrMinemeet