lsd_slam icon indicating copy to clipboard operation
lsd_slam copied to clipboard

Error while 'making' without ROS dependency (Eigen::Map<const g2o::Vector7d> v(m);)

Open 9friday opened this issue 6 years ago • 9 comments

I have a 64-bit laptop with Ubuntu 17.10. I am trying to run LSD-SLAM without the ROS dependencies. I have found three repos which contain LSD-SLAM without the ROS dependency. They are all modified versions of the original LSD-SLAM. ROS is just used for IO so the rest of the code should be pretty much the same. But on building them with cmake and then executing 'sudo make', I get a common error across all three repos.

[ 3%] Building CXX object CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o In file included from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/DataStructures/FramePoseStruct.h:23:0, from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.h:26, from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.cpp:21: /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h: In member function ‘virtual bool lsd_slam::EdgeSim3::setMeasurementData(const double*)’: /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/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/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:96:33: error: template argument 1 is invalid Eigen::Map<const g2o::Vector7d> v(m); ^ /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/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/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:97:38: error: no matching function for call to ‘Sophus::Sim3Group::exp(int&)’ setMeasurement(Sophus::Sim3d::exp(v)); ^ In file included from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/util/SophusUtil.h:23:0, from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.h:22, from /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.cpp:21: /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/thirdparty/Sophus/sophus/sim3.hpp:418:27: note: candidate: static const Sophus::Sim3Group<typename Eigen::internal::traits<T>::Scalar> Sophus::Sim3GroupBase<Derived>::exp(const Tangent&) [with Derived = Sophus::Sim3Group; typename Eigen::internal::traits<T>::Scalar = double; Sophus::Sim3GroupBase<Derived>::Tangent = Eigen::Matrix<double, 7, 1>] const Sim3Group<Scalar> exp(const Tangent & a) { ^~~ /home/username/Downloads/lsd_slam-master-mp3guy/lsd_slam-master/lsd_slam_core/src/thirdparty/Sophus/sophus/sim3.hpp:418:27: note: no known conversion for argument 1 from ‘int’ to ‘const Tangent& {aka const Eigen::Matrix<double, 7, 1>&}’ CMakeFiles/lsdslam.dir/build.make:62: recipe for target 'CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o' failed make[2]: *** [CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lsdslam.dir/all' failed make[1]: *** [CMakeFiles/lsdslam.dir/all] Error 2

These are the links to the repos:

  1. https://github.com/aivijay/lsd_slam_noros
  2. https://github.com/mp3guy/lsd_slam
  3. https://github.com/jserv/lsd_slam

While 2 and 3 give the exact same error, 1 is a bit different:

[ 4%] Building CXX object CMakeFiles/lsd_slam.dir/depth_estimation/depth_map.cc.o In file included from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/depth_estimation/depth_map.h:28:0, from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/depth_estimation/depth_map.cc:21: /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:72:31: error: ‘SE3Group’ is not a class template extern template class Sophus::SE3Group<float, 0>; ^~~~~~~~ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:72:31: error: ‘SE3Group’ in namespace ‘Sophus’ does not name a type /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:73:31: error: ‘SE3Group’ is not a class template extern template class Sophus::SE3Group<double, 0>; ^~~~~~~~ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:73:31: error: ‘SE3Group’ in namespace ‘Sophus’ does not name a type /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:75:31: error: ‘Sim3Group’ is not a class template extern template class Sophus::Sim3Group<float, 0>; ^~~~~~~~~ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:75:31: error: ‘Sim3Group’ in namespace ‘Sophus’ does not name a type /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:76:31: error: ‘Sim3Group’ is not a class template extern template class Sophus::Sim3Group<double, 0>; ^~~~~~~~~ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:76:31: error: ‘Sim3Group’ in namespace ‘Sophus’ does not name a type In file included from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/model/frame_pose_struct.h:23:0, from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/model/frame.h:26, from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/depth_estimation/depth_map.cc:31: /home/username/Downloads/lsd_slam_noros-master/lsd_slam/global_mapping/g2o_type_sim3_sophus.h: In member function ‘virtual bool lsd_slam::EdgeSim3::setMeasurementData(const double*)’: /home/username/Downloads/lsd_slam_noros-master/lsd_slam/global_mapping/g2o_type_sim3_sophus.h:96:20: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] Eigen::Map<const g2o::Vector7d> v(m); ^~~ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/global_mapping/g2o_type_sim3_sophus.h:96:33: error: template argument 1 is invalid Eigen::Map<const g2o::Vector7d> v(m); ^ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/global_mapping/g2o_type_sim3_sophus.h:96:38: error: invalid conversion from ‘const double*’ to ‘int’ [-fpermissive] Eigen::Map<const g2o::Vector7d> v(m); ^ /home/username/Downloads/lsd_slam_noros-master/lsd_slam/global_mapping/g2o_type_sim3_sophus.h:97:38: error: no matching function for call to ‘Sophus::Sim3::exp(int&)’ setMeasurement(Sophus::Sim3d::exp(v)); ^ In file included from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/util/sophus_util.h:23:0, from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/depth_estimation/depth_map.h:28, from /home/username/Downloads/lsd_slam_noros-master/lsd_slam/depth_estimation/depth_map.cc:21: /usr/local/include/sophus/sim3.hpp:439:35: note: candidate: static Sophus::Sim3<Scalar_> Sophus::Sim3<Scalar_, Options>::exp(const Tangent&) [with Scalar_ = double; int Options = 0; Sophus::Sim3<Scalar_, Options>::Tangent = Eigen::Matrix<double, 7, 1, 0, 7, 1>] SOPHUS_FUNC static Sim3<Scalar> exp(Tangent const& a) { ^~~ /usr/local/include/sophus/sim3.hpp:439:35: note: no known conversion for argument 1 from ‘int’ to ‘const Tangent& {aka const Eigen::Matrix<double, 7, 1, 0, 7, 1>&}’ CMakeFiles/lsd_slam.dir/build.make:62: recipe for target 'CMakeFiles/lsd_slam.dir/depth_estimation/depth_map.cc.o' failed make[2]: *** [CMakeFiles/lsd_slam.dir/depth_estimation/depth_map.cc.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lsd_slam.dir/all' failed make[1]: *** [CMakeFiles/lsd_slam.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

But even this has the error related to this line(link takes you to g2oTypeSim3Sophus.h, the file that contains this line of code) : Eigen::Map<const g2o::Vector7d> v(m);

I would be really grateful if you guys could help me out or just point me in the right direction.

Than You :+1:

9friday avatar Apr 28 '18 09:04 9friday

This is untested as of now because I am running into further build problems but either add #include "g2o/types/sim3/sim3.h"

or in utils/SophusUtils.h:40, uncomment // typedef Sophus::Vector7d Vector7;

It is most likely that you will run into other building porblems causing from version changes (i.e. g2o updated their Solvers to not own the pointers and switched to unique_ptr instead)

OAkyildiz avatar May 02 '18 19:05 OAkyildiz

@OAkyildiz , thanks for the advice. I tried that but I am getting the same error:

[ 3%] Building CXX object CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o In file included from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/DataStructures/FramePoseStruct.h:23:0, from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.h:26, from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.cpp:21: /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h: In member function ‘virtual bool lsd_slam::EdgeSim3::setMeasurementData(const double*)’: /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:98:20: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] Eigen::Map<const g2o::Vector7d> v(m); ^~~ /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:98:33: error: template argument 1 is invalid Eigen::Map<const g2o::Vector7d> v(m); ^ /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:98:38: error: invalid conversion from ‘const double*’ to ‘int’ [-fpermissive] Eigen::Map<const g2o::Vector7d> v(m); ^ /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/GlobalMapping/g2oTypeSim3Sophus.h:99:38: error: no matching function for call to ‘Sophus::Sim3Group::exp(int&)’ setMeasurement(Sophus::Sim3d::exp(v)); ^ In file included from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/util/SophusUtil.h:23:0, from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.h:22, from /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/DataStructures/Frame.cpp:21: /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/thirdparty/Sophus/sophus/sim3.hpp:418:27: note: candidate: static const Sophus::Sim3Group<typename Eigen::internal::traits<T>::Scalar> Sophus::Sim3GroupBase<Derived>::exp(const Tangent&) [with Derived = Sophus::Sim3Group; typename Eigen::internal::traits<T>::Scalar = double; Sophus::Sim3GroupBase<Derived>::Tangent = Eigen::Matrix<double, 7, 1>] const Sim3Group<Scalar> exp(const Tangent & a) { ^~~ /home/username/Downloads/lsd_slam_jserv/lsd_slam-master/lsd_slam_core/src/thirdparty/Sophus/sophus/sim3.hpp:418:27: note: no known conversion for argument 1 from ‘int’ to ‘const Tangent& {aka const Eigen::Matrix<double, 7, 1>&}’ CMakeFiles/lsdslam.dir/build.make:62: recipe for target 'CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o' failed make[2]: *** [CMakeFiles/lsdslam.dir/DataStructures/Frame.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lsdslam.dir/all' failed make[1]: *** [CMakeFiles/lsdslam.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

I tried the changes on the https://github.com/jserv/lsd_slam repo.

Thanks for helping. I will keep trying to solve this.

Cheers :+1:

9friday avatar May 04 '18 11:05 9friday

Were you able to solve this?

sadidaa avatar Jun 18 '18 02:06 sadidaa

No, i haven't been able to solve this. What are the steps you took for installing this?

On Mon 18 Jun, 2018, 7:35 AM Aditya Sundar, [email protected] wrote:

Were you able to solve this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tum-vision/lsd_slam/issues/303#issuecomment-397924768, or mute the thread https://github.com/notifications/unsubscribe-auth/AkCptf8kMhdYGiaoFczsMxbJnLJCrtuRks5t9wrugaJpZM4TrU0k .

9friday avatar Jun 18 '18 02:06 9friday

Even I haven't been able to

sadidaa avatar Jun 18 '18 06:06 sadidaa

What are the exact steps you followed? Can you mention them here?

On Mon 18 Jun, 2018, 12:17 PM Aditya Sundar, [email protected] wrote:

Even I haven't been able to

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tum-vision/lsd_slam/issues/303#issuecomment-397957339, or mute the thread https://github.com/notifications/unsubscribe-auth/AkCptaU_dZqa5aLVGzE1atvziPyGcuLcks5t900dgaJpZM4TrU0k .

9friday avatar Jun 18 '18 07:06 9friday

Even if you haven't been able to.

On Mon 18 Jun, 2018, 12:34 PM Everyday Newday, [email protected] wrote:

What are the exact steps you followed? Can you mention them here?

On Mon 18 Jun, 2018, 12:17 PM Aditya Sundar, [email protected] wrote:

Even I haven't been able to

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tum-vision/lsd_slam/issues/303#issuecomment-397957339, or mute the thread https://github.com/notifications/unsubscribe-auth/AkCptaU_dZqa5aLVGzE1atvziPyGcuLcks5t900dgaJpZM4TrU0k .

9friday avatar Jun 18 '18 07:06 9friday

g2oTypeSim3Sophus.h line 96

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

g2oTypeSim3Sophus.h line 96

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

change to

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

I think that maybe a misstype of Sophus::Vector7d

xlla avatar Sep 24 '19 15:09 xlla