tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.58k stars 1.23k forks source link

Compile error....unable to set Sophus directory #283

Closed rnunziata closed 6 years ago

rnunziata commented 6 years ago

I am compiling lsd_slam and it keeps taking the versio of Sophus released in kinetic and not the thirdparty folder even though the CMakeLists.txt has

:include_directories(
${PROJECT_SOURCE_DIR}/thirdparty/Sophus ${EIGEN3_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src
${CSPARSE_INCLUDE_DIR} #Has been set by SuiteParse ${CHOLMOD_INCLUDE_DIR}

Has been set by SuiteParse )

The error is as follows , notice the libs used.

[rosmake-2] Starting >>> lsd_slam_core [ make ]                                                                                                                                                       
[ rosmake ] [ make ] [ lsd_slam_core: 24.4 sec ]                                                                                                  [ rosmake ] [ make ] [ lsd_slam_core: 24.6 sec ]                                                           [ 1 Active 45/4[ rosmake ] Last 40 linesd_slam_core: 24.9 sec ]                                                           [ 1 Active 45/46 Complete ]
{-------------------------------------------------------------------------------
     void setScale(const Scalar & scale) {
          ^
  In file included from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/util/SophusUtil.h:26:0,
                   from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/SlamSystem.h:31,
                   from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/SlamSystem.cpp:21:
  /opt/ros/kinetic/include/sophus/sim3.hpp: In instantiation of ‘void Sophus::Sim3GroupBase<Derived>::setScale(const Scalar&) const [with Derived = Sophus::Sim3Group<double>; Sophus::Sim3GroupBase<Derived>::Scalar = double]’:
  /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/util/SophusUtil.h:58:23:   required from here
  /opt/ros/kinetic/include/sophus/sim3.hpp:339:5: error: passing ‘const RxSO3Type {aka const Sophus::RxSO3Group<double>}’ as ‘this’ argument discards qualifiers [-fpermissive]
       rxso3().setScale(scale);
       ^
  In file included from /opt/ros/kinetic/include/sophus/sim3.hpp:26:0,
                   from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/util/SophusUtil.h:26,
                   from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/SlamSystem.h:31,
                   from /home/rjn/catkin_ws/src_nstd/package_dir/lsd_slam/lsd_slam_core/src/SlamSystem.cpp:21:
  /opt/ros/kinetic/include/sophus/rxso3.hpp:332:8: note:   in call to ‘void Sophus::RxSO3GroupBase<Derived>::setScale(const Scalar&) [with Derived = Sophus::RxSO3Group<double>; Sophus::RxSO3GroupBase<Derived>::Scalar = double]’
     void setScale(const Scalar & scale) {
rnunziata commented 6 years ago

I got around this by hand editing the references in the generated make files

johnchars commented 5 years ago
CMakeFiles/lsdslam.dir/build.make:86: recipe for target 'CMakeFiles/lsdslam.dir/src/DataStructures/FramePoseStruct.cpp.o' failed
  make[3]: *** [CMakeFiles/lsdslam.dir/src/DataStructures/FramePoseStruct.cpp.o] Error 1

My error seems like your compile error. Have you fixed it?