tum-vision / lsd_slam

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

Get rid of ROS dependency #169

Open vranki opened 8 years ago

vranki commented 8 years ago

ROS is supported only on some quite old Ubuntu versions. This makes it difficult to build lsd_slam on newer versions. The lsd_slam homepage says:

"However, ROS is only used for input (video), output (pointcloud & poses) and parameter handling; ROS-dependent code is tightly wrapped and can easily be replaced. "

I'd suggest replacing ROS with some widely available cross-platform library such as Qt. Qt supports video input (http://doc.qt.io/qt-5/cameraoverview.html) and other requirements. If possible, design the interfaces so that multiple alternatives can be supported.

mihaibujanca commented 8 years ago

Actually ROS is supported on all versions of Ubuntu since 2010, including support for LTS12.04 (through Groovy), LTS14.04 (through indigo) and the latest, 15.04, through Jade. ROS are also having annual major releases.

That being said, I don't enjoy ROS either, but I understand the choice. Qt is just a library, while ros is a toolkit

nickponline commented 8 years ago

How big an under-taking would this be? I'm quite interested in a ROS-free version.

sharder-dev commented 8 years ago

LSD-SLAM only depends on ROS for the communication (cam<->lsdslam, lsdslam<->visualizer). If you don't care about the visualization, all you have to do is to write your own class for reading from images/video files (implementing lsd_slam::InputImageStream). There are also some forks that are usable under windows and they don't use ROS.

ningt commented 8 years ago

@nickponline I have successfully run a ROS-free version lsd-slam on my mac xcode. It uses a light-weight and open source framework Pangolin for visualisation. You can check it out here.

LiangliangGuo commented 6 years ago

Hi Seryogah! I want to know how to run LSD_SLAM on windows,can you help me ? many thanks

9friday commented 6 years ago

@LiangliangGuo I know that I am late(pretty late) to the party but maybe this could help : https://github.com/williammc/lsd_slam I haven't run it though. I am trying to get LSD-SLAM to run from a live videostream on Ubuntu 17.10 and just came across the above repo. These are the repos I found for Linux, but I am facing some error or the other with each of them : https://github.com/jserv/lsd_slam (Error I am facing : https://github.com/jserv/lsd_slam/issues/7) https://github.com/aivijay/lsd_slam_noros https://github.com/mp3guy/lsd_slam (Facing similar error as the above)

In the https://github.com/aivijay/lsd_slam_noros repo, on running sudo make in the terminal, I recieve the following error:

`-- lsd_slam_noros-master/CMakeLists.txt:64 >> Closure cmake modules: /home/username/Downloads/lsd_slam_noros-master/cmake;/home/username/Downloads/lsd_slam_noros-master/cmake/modules;/home/username/Downloads/lsd_slam_noros-master/build -- lsd_slam_noros-master/CMakeLists.txt:64 >> Welcome! Closure version 1.0.0 -- Compiling for Unix -- build/LsdSlamDependencies_Config.cmake:64 >> Setup paths for dependencies -- build/LsdSlamDependencies_Config.cmake:64 >> BEGIN NOTEs for dependencies configuration ================================= ;You can configure dependencies in a single config file (/home/username/Downloads/lsd_slam_noros-master/build/LsdSlamDependencies_Config.cmake ;There are sample configuration paths in the file ;To use this config file, change to LsdSlam_USE_MANUAL_CONFIG_FILE to TRUE ;END NOTEs for dependencies configuration ===================================

-- build/LsdSlamDependencies_Config.cmake:64 >> Boost_INCLUDE_DIR:/usr/include -- build/LsdSlamDependencies_Config.cmake:64 >> OpenCV_DIR:D:/dev/gitlab_structural_modeling/precompiled/x86/vc12/prebuilts/opencv -- build/LsdSlamDependencies_Config.cmake:64 >> GLUT_INCLUDE_DIR:D:/deps_msvc_common/freeglut-2.8.1/include -- build/LsdSlamDependencies_Config.cmake:64 >> GLEW_INCLUDE_DIR:D:/deps_msvc_common/glew-1.10.0/include -- cmake/LsdSlamDependencies.cmake:64 >> Setup required dependencies for LsdSlam tracking library -- Boost version: 1.62.0 -- Found the following Boost libraries: -- system -- thread -- atomic -- chrono -- date_time -- cmake/LsdSlamDependencies.cmake:64 >> Boost libs: libboost_system.so;libboost_thread.so;libboost_atomic.so;libboost_chrono.so;libboost_date_time.so;libpthread.so -- cmake/LsdSlamDependencies.cmake:64 >> OpenCV include dirs:/usr/local/include;/usr/local/include/opencv -- cmake/LsdSlamDependencies.cmake:64 >> OpenCV libs:opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto -- cmake/LsdSlamDependencies.cmake:64 >> Found OpenGL ? TRUE -- cmake/LsdSlamDependencies.cmake:64 >> OpenGL INCLUDE: /usr/include -- Could NOT find GLUT (missing: GLUT_glut_LIBRARY) -- lsd_slam_noros-master/CMakeLists.txt:64 >> LsdSlam_ALL_LIBRARIES:openFABMAP;libboost_system.so;libboost_thread.so;libboost_atomic.so;libboost_chrono.so;libboost_date_time.so;libpthread.so;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto;optimized;libg2o_core.so;debug;G2O_CORE_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_stuff.so;debug;G2O_STUFF_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_solver_dense.so;debug;G2O_SOLVER_DENSE_DEBUG-NOTFOUND;optimized;libg2o_types_slam3d.so;debug;G2O_TYPES_SLAM3D_DEBUG-NOTFOUND;optimized;libg2o_simulator.so;debug;G2O_SIMULATOR_DEBUG-NOTFOUND;libg2o_solver_csparse.so;libg2o_csparse_extension.so;G2O_EXT_CSPARSE-NOTFOUND;libg2o_solver_cholmod.so;libg2o_solver_eigen.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLEW.so -- Looking for OpenCV2.2 or greater - found -- OpenCV2.2 include path: /usr/local/include/opencv2 -- Looking for OpenCV2.2 or greater - found -- OpenCV2.2 include path: /usr/local/include/opencv2 -- lsd_slam_noros-master/CMakeLists.txt:64 >> LsdSlam_ALL_LIBRARIES After:openFABMAP;libboost_system.so;libboost_thread.so;libboost_atomic.so;libboost_chrono.so;libboost_date_time.so;libpthread.so;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto;optimized;libg2o_core.so;debug;G2O_CORE_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_stuff.so;debug;G2O_STUFF_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_solver_dense.so;debug;G2O_SOLVER_DENSE_DEBUG-NOTFOUND;optimized;libg2o_types_slam3d.so;debug;G2O_TYPES_SLAM3D_DEBUG-NOTFOUND;optimized;libg2o_simulator.so;debug;G2O_SIMULATOR_DEBUG-NOTFOUND;libg2o_solver_csparse.so;libg2o_csparse_extension.so;G2O_EXT_CSPARSE-NOTFOUND;libg2o_solver_cholmod.so;libg2o_solver_eigen.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLEW.so;lsd_slam -- slam/CMakeLists.txt:64 >> LsdSlam_ALL_LIBRARIES:openFABMAP;libboost_system.so;libboost_thread.so;libboost_atomic.so;libboost_chrono.so;libboost_date_time.so;libpthread.so;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto;optimized;libg2o_core.so;debug;G2O_CORE_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_stuff.so;debug;G2O_STUFF_LIBRARY_DEBUG-NOTFOUND;optimized;libg2o_solver_dense.so;debug;G2O_SOLVER_DENSE_DEBUG-NOTFOUND;optimized;libg2o_types_slam3d.so;debug;G2O_TYPES_SLAM3D_DEBUG-NOTFOUND;optimized;libg2o_simulator.so;debug;G2O_SIMULATOR_DEBUG-NOTFOUND;libg2o_solver_csparse.so;libg2o_csparse_extension.so;G2O_EXT_CSPARSE-NOTFOUND;libg2o_solver_cholmod.so;libg2o_solver_eigen.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLEW.so;lsd_slam CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: G2O_CLI_LIBRARY_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_CORE_LIBRARY_DEBUG linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_EXT_CSPARSE linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SIMULATOR_DEBUG linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_CHOLMOD_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_CSPARSE_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_CSPARSE_EXTENSION_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_DENSE_DEBUG linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_EIGEN_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_PCG_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_SLAM2D_LINEAR_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_SOLVER_STRUCTURE_ONLY_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_STUFF_LIBRARY_DEBUG linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_DATA_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_ICP_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_SBA_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_SCLAM2D_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_SIM3_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_SLAM2D_DEBUG linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam G2O_TYPES_SLAM3D_DEBUG linked by target "lsd_slam" in directory /home/username/Downloads/lsd_slam_noros-master/lsd_slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam linked by target "sample_app" in directory /home/username/Downloads/lsd_slam_noros-master/apps/slam

-- Configuring incomplete, errors occurred! See also "/home/username/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeOutput.log". See also "/home/username/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeError.log". ` I have all the dependencies mentioned in the readme installed on my system. I haven't installed ROS as I want to run LSD-SLAM on a live videostream without the ROS dependencies.

Also there is a repo focused on the GUI, if I was able gather correctly from its readme. https://github.com/amarburg/lsd-slam-pangolin-gui

@ningt Since, you have been successfully able to run LSD-SLAM without the ROS dependency, do you have some suggestions? I realize that the OS is different but I saw that you too had gone to jserv's repo, so I thought that you may have faced similar issues. Any help would be appreciated.

I have a 64-bit laptop running Ubuntu 17.10.

Cheers :grinning:

9friday commented 6 years ago

I tried compiling on a different laptop. On executing 'sudo make', the following shows up:

[ 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<double>::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

This is again on a 64-bit laptop running Ubuntu 17.10. Cheers :grinning: