JdeRobot / SDslam

Semi Direct SLAM (SD-SLAM) for Monocular and RGB-D Cameras
Other
49 stars 19 forks source link

[sdslam+_depth] Build.sh script fails due to mrpt-poses #22

Closed diegomrt closed 4 years ago

diegomrt commented 4 years ago

Hi @omar-ogm

I'm trying to build the sdslam+_depth branch but I'm getting a CMake error related to "mrpt-poses". This is the complete build output:

diego@JOULE:~/JDEROBOT/SD-SLAM+/SDslam$ sh build.sh
Configuring and building SD_SLAM ...
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type: Release
-- Compiling on Unix
-- Using CATKIN_DEVEL_PREFIX: /home/diego/JDEROBOT/SD-SLAM+/SDslam/build/devel
-- Using CMAKE_PREFIX_PATH: /home/diego/catkin_ws/devel;/opt/ros/melodic;/opt/jderobot;/opt/jderobot
-- This workspace overlays: /home/diego/catkin_ws/devel;/opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/diego/JDEROBOT/SD-SLAM+/SDslam/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.23
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package):
  By not providing "Findmrpt-poses.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "mrpt-poses", but CMake did not find one.

  Could not find a package configuration file provided by "mrpt-poses" with
  any of the following names:

    mrpt-posesConfig.cmake
    mrpt-poses-config.cmake

  Add the installation prefix of "mrpt-poses" to CMAKE_PREFIX_PATH or set
  "mrpt-poses_DIR" to a directory containing one of the above files.  If
  "mrpt-poses" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  /usr/share/mrpt/mrpt-config.cmake:26 (find_dependency)
  CMakeLists.txt:64 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/diego/JDEROBOT/SD-SLAM+/SDslam/build/CMakeFiles/CMakeOutput.log".
See also "/home/diego/JDEROBOT/SD-SLAM+/SDslam/build/CMakeFiles/CMakeError.log".
make: *** No se especificó ningún objetivo y no se encontró ningún makefile.  Alto.

However, I check if mrpt-poses is installed with apt list --installed | grep mrpt-poses and everything seems ok:

libmrpt-poses2.0/bionic,now 1:2.0.4~snapshot20200525-1143-git-7ea9b7e8-bionic-1 amd64 [instalado, automático]
omar-ogm commented 4 years ago

Hi,

Im not quite sure what the problem could be but I see that you have installed version 2.0. Ive work with version 1.9.9 since that is the version available when I started to develop. I think that in between versions there could have been mayor changes but I guess that backward compatibility should be no problem.

It seems like there is a new way to find_packege() mrpt libraries compare to the older versions (before v2.0.0). Take a look at this link: https://docs.mrpt.org/reference/stable/mrpt_from_cmake.html

Could you change the CMakeLists.txt line of:

find_package(MRPT REQUIRED poses gui vision) to find_package(MRPT COMPONENTS poses gui vision)

If this works, then also the CMakeLists.txt to build the ROS package should also be updated: https://github.com/JdeRobot/SDslam/blob/sdslam%2B_depth/Examples/ROS/SD-SLAM/CMakeLists.txt

If this fixes your problem and you can use SD-SLAM+ with version 2.0 from MRPT let me know and I will require version 2.0 and update the instructions.

diegomrt commented 4 years ago

At the moment the last MRPT stable version in the PPA is 2.0.4, so it's the one that you get following the SD-SLAM+ installation instructions.

In any case, I've just made the suggested change in CMakeLists.txt and the problems are still there:

CMake Warning at /usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package):
  By not providing "Findmrpt-poses.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "mrpt-poses", but CMake did not find one.

  Could not find a package configuration file provided by "mrpt-poses" with
  any of the following names:

    mrpt-posesConfig.cmake
    mrpt-poses-config.cmake

  Add the installation prefix of "mrpt-poses" to CMAKE_PREFIX_PATH or set
  "mrpt-poses_DIR" to a directory containing one of the above files.  If
  "mrpt-poses" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  /usr/share/mrpt/mrpt-config.cmake:26 (find_dependency)
  CMakeLists.txt:64 (find_package)

CMake Warning at CMakeLists.txt:64 (find_package):
  Found package configuration file:

    /usr/share/mrpt/mrpt-config.cmake

  but it set MRPT_FOUND to FALSE so package "MRPT" is considered to be NOT
  FOUND.  Reason given by package:

  MRPT could not be found because dependency mrpt-poses could not be found.
omar-ogm commented 4 years ago

Hi.

Ive install mrpt version 2.0 removing the older version 1.9.9. Everything seems to be build on my system without any error.

The version that Im using right now is the lastest available on the ppa: sudo add-apt-repository ppa:joseluisblancoc/mrpt-stable

My ouput from apt list --installed | grep mrpt-poses:

libmrpt-poses-dev/bionic,now 1:2.0.4~snapshot20200620-1815-git-80037994-bionic-1 amd64 [installed,automatic]
libmrpt-poses2.0/bionic,now 1:2.0.4~snapshot20200620-1815-git-80037994-bionic-1 amd64 [installed,automatic]

I have a newer version compare to yours. Also on your output you didnt specify that you had the libmrpt-poses-dev package. Could you update and check that you have both packets?

The instructions to uninstall and install again are:

sudo apt-get --purge remove libmrpt*
sudo apt-get --purge remove mrpt*
sudo add-apt-repository ppa:joseluisblancoc/mrpt-stable
sudo apt update
sudo apt install libmrpt-dev mrpt-apps

Are you using Ubuntu 20? This has been tested on Ubuntu 18.04.

diegomrt commented 4 years ago

Thanks @omar-ogm, I've followed your suggestions, removing all previous instalation and reinstalling from scratch and it worked!

The key probably was in the libmrpt-poses-dev package, it wasn't installed in my system.