stella-cv / stella_vslam

This is a unofficial fork of OpenVSLAM (https://github.com/xdspacelab/openvslam)
https://stella-cv.rtfd.io/en/latest/
Other
875 stars 374 forks source link

Illegal instruction (core dumped) When trying to run either Simple Tutorial #455

Closed Rotoslider closed 1 year ago

Rotoslider commented 1 year ago

Describe the bug

When running either tutorial from the build folder example:

./run_video_slam -v ./orb_vocab.fbow -m ./aist_living_lab_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-out map.msg

I get "Illegal instruction (core dumped)" Full output:

(base) lidar@lidar:~/stella_vslam/build$ ./run_video_slam -v ./orb_vocab.fbow -m ./aist_living_lab_3/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-out map.msg
[2023-01-21 09:40:20.780] [I] config file loaded: ../example/aist/equirectangular.yaml
--start-timestamp is not set. using system timestamp.
If --no-sleep is set without --start-timestamp, timestamps may overlap between multiple runs.
[2023-01-21 09:40:20.781] [I] 
original version of OpenVSLAM,
Copyright (C) 2019,
National Institute of Advanced Industrial Science and Technology (AIST)
All rights reserved.
stella_vslam (the changes after forking from OpenVSLAM),
Copyright (C) 2022, stella-cv, All rights reserved.

This is free software,
and you are welcome to redistribute it under certain conditions.
See the LICENSE file.

Camera:
  name: RICOH THETA S 960
  setup: monocular
  model: equirectangular
  fps: 30.0
  cols: 1920
  rows: 960
  color_order: RGB
Preprocessing:
  min_size: 800
  mask_rectangles:
    - [0.0, 1.0, 0.0, 0.1]
    - [0.0, 1.0, 0.84, 1.0]
    - [0.0, 0.2, 0.7, 1.0]
    - [0.8, 1.0, 0.7, 1.0]
Feature:
  name: default ORB feature extraction setting
  scale_factor: 1.2
  num_levels: 8
  ini_fast_threshold: 20
  min_fast_threshold: 7
Mapping:
  backend: g2o
  baseline_dist_thr_ratio: 0.02
  redundant_obs_ratio_thr: 0.95
  num_covisibilities_for_landmark_generation: 20
  num_covisibilities_for_landmark_fusion: 20
Tracking:
  backend: g2o
LoopDetector:
  backend: g2o
  enabled: true
  reject_by_graph_distance: true
  min_distance_on_graph: 50
System:
  map_format: msgpack

[2023-01-21 09:40:20.781] [I] loading ORB vocabulary: ./orb_vocab.fbow
Illegal instruction (core dumped)

I manually download and replaced the lab1 and lab 2 files along with the orb_vocab.flow file in case something was corrupted. I still received the same error afterwards.

Environment

ymd-stella commented 1 year ago

Show me the result of

cat ~/stella_vslam/build/CMakeCache.txt | grep -e USE_ -e BUILD_
ymd-stella commented 1 year ago

Add the following to the build options for stella_vslam.

-DUSE_STACK_TRACE_LOGGER=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -USE_SSE_ORB=OFF
Rotoslider commented 1 year ago

`BUILD_EXAMPLES:BOOL=ON BUILD_GMOCK:BOOL=ON BUILD_SHARED_LIBS:BOOL=ON BUILD_TESTS:BOOL=ON BUILD_UTILS:BOOL=OFF BUILD_WITH_MARCH_NATIVE:BOOL=OFF CMAKE_BUILD_TYPE:STRING= USE_ARUCO:BOOL=ON USE_AVX:BOOL=ON USE_CCACHE:BOOL=ON USE_CONTRIB:BOOL=OFF USE_FAST_MATH:BOOL=OFF USE_GOOGLE_PERFTOOLS:BOOL=OFF USE_GTSAM:BOOL=ON USE_MMX:BOOL=ON USE_O3:BOOL=ON USE_OPENMP:BOOL=OFF USE_OWN_EIGEN3:BOOL=ON USE_PANGOLIN_VIEWER:BOOL=ON USE_SANITIZER:BOOL=OFF USE_SOCKET_PUBLISHER:BOOL=OFF USE_SSE:BOOL=ON USE_SSE2:BOOL=ON USE_SSE3:BOOL=ON USE_SSE4:BOOL=ON USE_SSE_FP_MATH:BOOL=OFF USE_SSE_ORB:BOOL=OFF USE_STACK_TRACE_LOGGER:BOOL=OFF //STRINGS property for variable: CMAKE_BUILD_TYPE CMAKE_BUILD_TYPE-STRINGS:INTERNAL=Debug;Release

`

Rotoslider commented 1 year ago

I deleted the stella folder and re downloaded the git. Now when I try to build I get a new error. `CMake Error at example/CMakeLists.txt:11 (find_package): By not providing "FindBackward.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Backward", but CMake did not find one.

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

BackwardConfig.cmake
backward-config.cmake`

Full error here:

(base) lidar@lidar:~/stella_vslam/build$ cmake \
>     -DUSE_STACK_TRACE_LOGGER=ON \
>     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>     -DUSE_PANGOLIN_VIEWER=ON \
>     -DINSTALL_PANGOLIN_VIEWER=ON \
>     -DUSE_SOCKET_PUBLISHER=OFF \
>     -DBUILD_TESTS=OFF \
>     -DBUILD_EXAMPLES=ON \
>     -USE_SSE_ORB=OFF \
>     ..
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- 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
-- 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
-- Build type: RelWithDebInfo
-- ccache: Enabled
-- Address/Memory sanitizer: DISABLED
-- Architecture-aware optimization: DISABLED
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "3.3") 
-- Use OpenCV 4.2.0
-- aruco: enabled (Found in /usr/include/opencv4/opencv2)
-- Found SQLite3: /usr/include (found version "3.31.1") 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so  
-- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so
-- Found AMD header in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so
-- Found CAMD header in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so
-- Found COLAMD header in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so
-- Found CCOLAMD header in: /usr/include/suitesparse
-- Found SuiteSparse_config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so
-- Found SuiteSparse_config header in: /usr/include/suitesparse
-- Adding librt: /usr/lib/x86_64-linux-gnu/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Did not find METIS library (optional SuiteSparse dependency)
-- Found SuiteSparse: TRUE (found version "5.7.1") 
-- gtsam: disabled
-- Found CXSparse: /usr/include/suitesparse (found version "3.2.0") 
-- OpenMP: DISABLED
-- SSE3 for ORB extraction: DISABLED
-- SSE for floating-point operation: DISABLED
-- BoW framework: FBoW (found in /usr/local/include)
-- trace level log: DISABLED
-- Determinism: DISABLED
-- Build pangolin_viewer with c++17
CMake Error at example/CMakeLists.txt:11 (find_package):
  By not providing "FindBackward.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Backward",
  but CMake did not find one.

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

    BackwardConfig.cmake
    backward-config.cmake

  Add the installation prefix of "Backward" to CMAKE_PREFIX_PATH or set
  "Backward_DIR" to a directory containing one of the above files.  If
  "Backward" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!

CMakeOutput.log

CMakeError.log

ymd-stella commented 1 year ago

Install backward-cpp with the following command.

sudo apt install -y binutils-dev
git clone https://github.com/bombela/backward-cpp.git
cd backward-cpp
git checkout 5ffb2c879ebdbea3bdb8477c671e32b1c984beaa
mkdir -p build
cd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    ..
make -j
sudo make install
Rotoslider commented 1 year ago

That fixed Backwards but now I have new errors. Building CXX object src/stella_vslam/CMakeFiles/stella_vslam.dir/io/map_database_io_sqlite3.cc.o /home/lidar/stella_vslam/src/stella_vslam/io/map_database_io_sqlite3.cc: In member function ‘virtual void stella_vslam::io::map_database_io_sqlite3::save(const string&, const stella_vslam::data::camera_database*, const stella_vslam::data::orb_params_database*, const stella_vslam::data::map_database*)’: /home/lidar/stella_vslam/src/stella_vslam/io/map_database_io_sqlite3.cc:20:75: warning: unused parameter ‘orb_params_db’ [-Wunused-parameter] 20 | const data::orb_params_database* const orb_params_db,

Building CXX object src/stella_vslam/CMakeFiles/stella_vslam.dir/match/fuse.cc.o /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc: In function ‘cv::Ptr<cv::aruco::Dictionary> {anonymous}::get_predefined_dictionary(int, int)’: /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:12:16: error: ‘PREDEFINED_DICTIONARY_NAME’ is not a member of ‘cv::aruco’ 12 | cv::aruco::PREDEFINED_DICTIONARY_NAME dictionary_name = cv::aruco::DICT_4X4_50; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:14:9: error: ‘dictionary_name’ was not declared in this scope 14 | dictionary_name = cv::aruco::DICT_4X4_50; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:17:9: error: ‘dictionary_name’ was not declared in this scope 17 | dictionary_name = cv::aruco::DICT_4X4_100; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:20:9: error: ‘dictionary_name’ was not declared in this scope 20 | dictionary_name = cv::aruco::DICT_4X4_250; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:23:9: error: ‘dictionary_name’ was not declared in this scope 23 | dictionary_name = cv::aruco::DICT_4X4_1000; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:26:9: error: ‘dictionary_name’ was not declared in this scope 26 | dictionary_name = cv::aruco::DICT_5X5_50; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:29:9: error: ‘dictionary_name’ was not declared in this scope 29 | dictionary_name = cv::aruco::DICT_5X5_100; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:32:9: error: ‘dictionary_name’ was not declared in this scope 32 | dictionary_name = cv::aruco::DICT_5X5_250; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:35:9: error: ‘dictionary_name’ was not declared in this scope 35 | dictionary_name = cv::aruco::DICT_5X5_1000; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:38:9: error: ‘dictionary_name’ was not declared in this scope 38 | dictionary_name = cv::aruco::DICT_6X6_50; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:41:9: error: ‘dictionary_name’ was not declared in this scope 41 | dictionary_name = cv::aruco::DICT_6X6_100; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:44:9: error: ‘dictionary_name’ was not declared in this scope 44 | dictionary_name = cv::aruco::DICT_6X6_250; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:47:9: error: ‘dictionary_name’ was not declared in this scope 47 | dictionary_name = cv::aruco::DICT_6X6_1000; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:50:9: error: ‘dictionary_name’ was not declared in this scope 50 | dictionary_name = cv::aruco::DICT_7X7_50; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:53:9: error: ‘dictionary_name’ was not declared in this scope 53 | dictionary_name = cv::aruco::DICT_7X7_100; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:56:9: error: ‘dictionary_name’ was not declared in this scope 56 | dictionary_name = cv::aruco::DICT_7X7_250; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:59:9: error: ‘dictionary_name’ was not declared in this scope 59 | dictionary_name = cv::aruco::DICT_7X7_1000; | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:64:47: error: ‘dictionary_name’ was not declared in this scope 64 | return cv::aruco::getPredefinedDictionary(dictionary_name); | ^~~~~~~~~~~~~~~ /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc: In constructor ‘stella_vslam::marker_detector::aruco::aruco(const stella_vslam::camera::base*, const std::shared_ptr<stella_vslam::marker_model::base>&, unsigned int, double)’: /home/lidar/stella_vslam/src/stella_vslam/marker_detector/aruco.cc:75:50: error: ‘create’ is not a member of ‘cv::aruco::DetectorParameters’ 75 | parameters_ = cv::aruco::DetectorParameters::create(); | ^~~~~~ make[2]: *** [src/stella_vslam/CMakeFiles/stella_vslam.dir/build.make:505: src/stella_vslam/CMakeFiles/stella_vslam.dir/marker_detector/aruco.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/Makefile2:516: src/stella_vslam/CMakeFiles/stella_vslam.dir/all] Error 2 make: *** [Makefile:130: all] Error 2 Here is the build log with no errors: lidar@lidar:~/stella_vslam/build$ cmake -DUSE_STACK_TRACE_LOGGER=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_PANGOLIN_VIEWER=ON -DINSTALL_PANGOLIN_VIEWER=ON -DUSE_SOCKET_PUBLISHER=OFF -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=ON -USE_SSE_ORB=OFF ..

-- The CXX compiler identification is GNU 9.4.0 -- The C compiler identification is GNU 9.4.0 -- 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 -- 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 -- Build type: RelWithDebInfo -- ccache: Enabled -- Address/Memory sanitizer: DISABLED -- Architecture-aware optimization: DISABLED -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- 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
-- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
-- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "3.3") -- Use OpenCV 4.7.0 -- aruco: enabled (Found in /usr/local/include/opencv4/opencv2) -- Found SQLite3: /usr/include (found version "3.31.1") -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so
-- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so -- Found AMD header in: /usr/include/suitesparse -- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so -- Found CAMD header in: /usr/include/suitesparse -- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so -- Found COLAMD header in: /usr/include/suitesparse -- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so -- Found CCOLAMD header in: /usr/include/suitesparse -- Found SuiteSparse_config library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so -- Found SuiteSparse_config header in: /usr/include/suitesparse -- Adding librt: /usr/lib/x86_64-linux-gnu/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing). -- Found METIS library: /usr/lib/x86_64-linux-gnu/libmetis.so. -- Found SuiteSparse: TRUE (found version "5.7.1") -- gtsam: disabled -- Found CXSparse: /usr/include/suitesparse (found version "3.2.0") -- OpenMP: DISABLED -- SSE3 for ORB extraction: DISABLED -- SSE for floating-point operation: DISABLED -- BoW framework: FBoW (found in /usr/local/include) -- trace level log: DISABLED -- Determinism: DISABLED -- Build pangolin_viewer with c++17 -- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) -- Found libbfd: /usr/lib/x86_64-linux-gnu/libbfd.so
-- Found libdwarf: /usr/lib/x86_64-linux-gnu/libdwarf.so
-- Found Backward: /usr/local/lib/backward
-- Stack trace logger: ENABLED -- Google Perftools: DISABLED -- Viewer for examples: PangolinViewer -- Configuring done -- Generating done -- Build files have been written to: /home/lidar/stella_vslam/build

Opencv 4.7 with aruco installed. But this may be the cause. When it was 4.6 this last error was not present. CMakeError.log

CMakeOutput.log

ymd-stella commented 1 year ago

Thank you for your report. Updated documentation.

Use OpenCV version 4.6 or lower.

Rotoslider commented 1 year ago

I uninstalled opencv4.7 and tried to build 4.6. It however now will not build in my system. So I rebuilt 4.7 without issue. I will wait for your enhancement of being able to use opencv4.7

ymd-stella commented 1 year ago

Updated. https://github.com/stella-cv/stella_vslam/pull/460

Rotoslider commented 1 year ago

Created a new stella_vslam folder and cloned the latest version. Seemed everything built fine and installed. However I get a new error when trying to run: ./run_video_slam -v ./orb_vocab.fbow -m ./aist_living_lab_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-out map.msg After the yaml loads i get: `2023-01-29 18:58:09.799] [I] loading ORB vocabulary: ./orb_vocab.fbow Stack trace (most recent call last):

6 Object "", at 0xffffffffffffffff, in

5 Object "/home/lidar/stella_vslam/build/run_video_slam", at 0x55eba56866fd, in _start

BFD: DWARF error: section .debug_info is larger than its filesize! (0x93ef57 vs 0x530ea0)

4 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f2e8238d082, in __libc_start_main

3 | Source "/home/lidar/stella_vslam/example/run_video_slam.cc", line 258, in main

|   257:     // build a slam system
| > 258:     auto slam = std::make_shared<stella_vslam::system>(cfg, vocab_file_path->value());
|   259:     bool need_initialize = true;
|   260:     if (map_db_path_in->is_set()) {
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 718, in std::shared_ptr<stella_vslam::system> std::make_shared<stella_vslam::system, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   716:       typedef typename std::remove_cv<_Tp>::type _Tp_nc;
|   717:       return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
| > 718:                       std::forward<_Args>(__args)...);
|   719:     }
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 702, in std::shared_ptr<stella_vslam::system> std::allocate_shared<stella_vslam::system, std::allocator<stella_vslam::system>, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::allocator<stella_vslam::system> const&, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   700:     {
|   701:       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
| > 702:                 std::forward<_Args>(__args)...);
|   703:     }
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 359, in std::shared_ptr<stella_vslam::system>::shared_ptr<std::allocator<stella_vslam::system>, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::_Sp_alloc_shared_tag<std::allocator<stella_vslam::system> >, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   357:       template<typename _Alloc, typename... _Args>
|   358:    shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| > 359:    : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
|   360:    { }
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 1344, in std::__shared_ptr<stella_vslam::system, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<stella_vslam::system>, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::_Sp_alloc_shared_tag<std::allocator<stella_vslam::system> >, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|  1342:       template<typename _Alloc, typename... _Args>
|  1343:    __shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| >1344:    : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
|  1345:    { _M_enable_shared_from_this_with(_M_ptr); }
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 679, in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<stella_vslam::system, std::allocator<stella_vslam::system>, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(stella_vslam::system*&, std::_Sp_alloc_shared_tag<std::allocator<stella_vslam::system> >, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   677:      auto __guard = std::__allocate_guarded(__a2);
|   678:      _Sp_cp_type* __mem = __guard.get();
| > 679:      auto __pi = ::new (__mem)
|   680:        _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
|   681:      __guard = nullptr;
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 548, in std::_Sp_counted_ptr_inplace<stella_vslam::system, std::allocator<stella_vslam::system>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::allocator<stella_vslam::system>, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   546:      // _GLIBCXX_RESOLVE_LIB_DEFECTS
|   547:      // 2070.  allocate_shared should use allocator_traits<A>::construct
| > 548:      allocator_traits<_Alloc>::construct(__a, _M_ptr(),
|   549:          std::forward<_Args>(__args)...); // might throw
|   550:    }
| Source "/usr/include/c++/9/bits/alloc_traits.h", line 483, in void std::allocator_traits<std::allocator<stella_vslam::system> >::construct<stella_vslam::system, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::allocator<stella_vslam::system>&, stella_vslam::system*, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
|   481:    construct(allocator_type& __a, _Up* __p, _Args&&... __args)
|   482:    noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
| > 483:    { __a.construct(__p, std::forward<_Args>(__args)...); }
|   484: 
|   485:       /**
  Source "/usr/include/c++/9/ext/new_allocator.h", line 146, in void __gnu_cxx::new_allocator<stella_vslam::system>::construct<stella_vslam::system, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(stella_vslam::system*, std::shared_ptr<stella_vslam::config>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) [0x55eba5685efc]
    143:    void
    144:    construct(_Up* __p, _Args&&... __args)
    145:    noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
  > 146:    { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    147: 
    148:       template<typename _Up>
    149:    void

2 Source "/home/lidar/stella_vslam/src/stella_vslam/system.cc", line 39, in stella_vslam::system::system(std::shared_ptr const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) [0x7f2e83d50143]

     37:     // load ORB vocabulary
     38:     spdlog::info("loading ORB vocabulary: {}", vocab_file_path);
  >  39:     bow_vocab_ = data::bow_vocabulary_util::load(vocab_file_path);
     40: 
     41:     const auto system_params = util::yaml_optional_ref(cfg->yaml_node_, "System");

1 Source "/home/lidar/stella_vslam/src/stella_vslam/data/bow_vocabulary.cc", line 39, in stella_vslam::data::bow_vocabulary_util::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator >) [0x7f2e83d99232]

     36:         exit(EXIT_FAILURE);
     37:     }
     38: #else
  >  39:     bow_vocab->readFromFile(path);
     40:     if (!bow_vocab->isValid()) {
     41:         spdlog::critical("wrong path to vocabulary");
     42:         delete bow_vocab;

0 Object "/usr/local/lib/libfbow.so.0.0", at 0x7f2e83b5c365, in fbow::Vocabulary::readFromFile(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)

Illegal instruction (Illegal operand [0x7f2e83b5c365]) Illegal instruction (core dumped) Results of: cat ~/stellavslam/build/CMakeCache.txt | grep -e USE -e BUILD_ BUILD_EXAMPLES:BOOL=ON BUILD_SHARED_LIBS:BOOL=ON BUILD_TESTS:BOOL=OFF BUILD_WITH_MARCH_NATIVE:BOOL=OFF CMAKE_BUILD_TYPE:STRING=RelWithDebInfo USE_ARUCO:BOOL=ON USE_CCACHE:BOOL=ON USE_GOOGLE_PERFTOOLS:BOOL=OFF USE_GTSAM:BOOL=ON USE_OPENMP:BOOL=OFF USE_PANGOLIN_VIEWER:BOOL=ON USE_SANITIZER:BOOL=OFF USE_SOCKET_PUBLISHER:BOOL=OFF USE_SSE_FP_MATH:BOOL=OFF USE_SSE_ORB:BOOL=OFF USE_STACK_TRACE_LOGGER:BOOL=ON`

ymd-stella commented 1 year ago

Rebuild FBoW with RelWithDebInfo.

cd /tmp
git clone https://github.com/stella-cv/FBoW.git
cd FBoW
mkdir build && cd build
cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    ..
make -j4
sudo make install
Rotoslider commented 1 year ago

Closer. The video came up and pangolin_viewer started then both winked out in a couple seconds. Followed by the error below. ran: ./run_video_slam -v ./orb_vocab.fbow -m ./aist_living_lab_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-out map.msg

`2023-01-30 17:32:52.103] [I] loading ORB vocabulary: ./orb_vocab.fbow [2023-01-30 17:32:52.185] [I] load orb_params "default ORB feature extraction setting" [2023-01-30 17:32:52.187] [I] startup SLAM system [2023-01-30 17:32:52.187] [I] start mapping module [2023-01-30 17:32:52.187] [I] start global optimization module [2023-01-30 17:32:52.436] [I] initialization succeeded with E Stack trace (most recent call last) in thread 4658:

11 Object "", at 0xffffffffffffffff, in

BFD: DWARF error: section .debug_info is larger than its filesize! (0x93ef57 vs 0x530ea0)

10 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f407a5e2132, in clone

9 Source "/build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c", line 477, in start_thread [0x7f407bd3a608]

8 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f407a7a6de3, in std::error_code::default_error_condition() const

7 | Source "/usr/include/c++/9/thread", line 195, in _M_run

|   194:    void
| > 195:    _M_run() { _M_func(); }
|   196:       };
| Source "/usr/include/c++/9/thread", line 251, in operator()
|   249:      using _Indices
|   250:        = typename _Build_index_tuple<tuple_size<_Tuple>::value>::__type;
| > 251:      return _M_invoke(_Indices());
|   252:    }
|   253:       };
| Source "/usr/include/c++/9/thread", line 244, in _M_invoke<0>
|   242:      typename __result<_Tuple>::type
|   243:      _M_invoke(_Index_tuple<_Ind...>)
| > 244:      { return std::__invoke(std::get<_Ind>(std::move(_M_t))...); }
|   245: 
|   246:    typename __result<_Tuple>::type
| Source "/usr/include/c++/9/bits/invoke.h", line 95, in __invoke<mono_tracking(const std::shared_ptr<stella_vslam::system>&, const std::shared_ptr<stella_vslam::config>&, const string&, const string&, unsigned int, unsigned int, bool, bool, bool, const string&, const string&, double)::<lambda()> >
|    93:       using __type = typename __result::type;
|    94:       using __tag = typename __result::__invoke_type;
| >  95:       return std::__invoke_impl<__type>(__tag{}, std::forward<_Callable>(__fn),
|    96:                    std::forward<_Args>(__args)...);
|    97:     }
| Source "/usr/include/c++/9/bits/invoke.h", line 60, in __invoke_impl<void, mono_tracking(const std::shared_ptr<stella_vslam::system>&, const std::shared_ptr<stella_vslam::config>&, const string&, const string&, unsigned int, unsigned int, bool, bool, bool, const string&, const string&, double)::<lambda()> >
|    58:     constexpr _Res
|    59:     __invoke_impl(__invoke_other, _Fn&& __f, _Args&&... __args)
| >  60:     { return std::forward<_Fn>(__f)(std::forward<_Args>(__args)...); }
|    61: 
|    62:   template<typename _Res, typename _MemFun, typename _Tp, typename... _Args>
  Source "/home/lidar/stella_vslam/example/run_video_slam.cc", line 90, in std::thread::_State_impl<std::thread::_Invoker<std::tuple<mono_tracking(std::shared_ptr<stella_vslam::system> const&, std::shared_ptr<stella_vslam::config> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, bool, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)::{lambda()#1}> > >::_M_run() [0x55d63321abce]
     88:             if (!frame.empty() && (num_frame % frame_skip == 0)) {
     89:                 // input the current frame and estimate the camera pose
  >  90:                 slam->feed_monocular_frame(frame, timestamp, mask);
     91:             }
     92: 
     93:             const auto tp_2 = std::chrono::steady_clock::now();

6 Source "/home/lidar/stella_vslam/src/stella_vslam/system.cc", line 439, in stella_vslam::system::feed_monocular_frame(cv::Mat const&, double, cv::Mat const&) [0x7f407be853ee]

    436:         spdlog::warn("preprocess: empty image");
    437:         return nullptr;
    438:     }
  > 439:     return feed_frame(create_monocular_frame(img, timestamp, mask), img);
    440: }
    441: 
    442: std::shared_ptr<Mat44_t> system::feed_stereo_frame(const cv::Mat& left_img, const cv::Mat& right_img, const double timestamp, const cv::Mat& mask) {

5 Source "/home/lidar/stella_vslam/src/stella_vslam/system.cc", line 465, in stella_vslam::system::feed_frame(stella_vslam::data::frame const&, cv::Mat const&) [0x7f407be82732]

    463:     const auto start = std::chrono::system_clock::now();
    464: 
  > 465:     const auto cam_pose_wc = tracker_->feed_frame(frm);
    466: 
    467:     const auto end = std::chrono::system_clock::now();
    468:     double elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();

4 Source "/home/lidar/stella_vslam/src/stella_vslam/tracking_module.cc", line 125, in stella_vslam::tracking_module::feed_frame(stella_vslam::data::frame) [0x7f407be9b0c7]

    123:     bool succeeded = false;
    124:     if (tracking_state_ == tracker_state_t::Initializing) {
  > 125:         succeeded = initialize();
    126:     }
    127:     else {
    128:         bool relocalization_is_needed = tracking_state_ == tracker_state_t::Lost;

3 Source "/home/lidar/stella_vslam/src/stella_vslam/tracking_module.cc", line 251, in stella_vslam::tracking_module::initialize() [0x7f407be99ce5]

    248:     std::lock_guard<std::mutex> lock2(mtx_stop_keyframe_insertion_);
    249: 
    250:     // try to initialize with the current frame
  > 251:     initializer_.initialize(camera_->setup_type_, bow_vocab_, curr_frm_);
    252: 
    253:     // if map building was failed -> reset the map database
    254:     if (initializer_.get_state() == module::initializer_state_t::Wrong) {

2 Source "/home/lidar/stella_vslam/src/stella_vslam/module/initializer.cc", line 76, in stella_vslam::module::initializer::initialize(stella_vslam::camera::setup_type_t, fbow::Vocabulary*, stella_vslam::data::frame&) [0x7f407bf41d8d]

     73:             }
     74: 
     75:             // create new map if succeeded
  >  76:             create_map_for_monocular(bow_vocab, curr_frm);
     77:             break;
     78:         }
     79:         case camera::setup_type_t::Stereo:

1 Source "/home/lidar/stella_vslam/src/stella_vslam/module/initializer.cc", line 205, in stella_vslam::module::initializer::create_map_for_monocular(fbow::Vocabulary*, stella_vslam::data::frame&) [0x7f407bf40d54]

    202:     map_db_->add_spanning_root(init_keyfrm);
    203: 
    204:     // compute BoW representations
  > 205:     init_keyfrm->compute_bow(bow_vocab);
    206:     curr_keyfrm->compute_bow(bow_vocab);
    207: 
    208:     // add the keyframes to the map DB

0 | Source "/home/lidar/FBoW/src/fbow.cpp", line 276, in fbow::Vocabulary::transform(cv::Mat const&, int, fbow::BoWVector&, fbow::BoWFeatVector&)

|   274:     //get host info to decide the version to execute
|   275:     if (!cpu_info){
| > 276:         cpu_info=std::make_shared<cpu>();
|   277:         cpu_info->detect_host();
|   278:     }
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 718, in std::shared_ptr<fbow::cpu> std::make_shared<fbow::cpu>()
|   716:       typedef typename std::remove_cv<_Tp>::type _Tp_nc;
|   717:       return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
| > 718:                       std::forward<_Args>(__args)...);
|   719:     }
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 702, in std::shared_ptr<fbow::cpu> std::allocate_shared<fbow::cpu, std::allocator<fbow::cpu>>(std::allocator<fbow::cpu> const&)
|   700:     {
|   701:       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
| > 702:                 std::forward<_Args>(__args)...);
|   703:     }
| Source "/usr/include/c++/9/bits/shared_ptr.h", line 359, in std::shared_ptr<fbow::cpu>::shared_ptr<std::allocator<fbow::cpu>>(std::_Sp_alloc_shared_tag<std::allocator<fbow::cpu> >)
|   357:       template<typename _Alloc, typename... _Args>
|   358:    shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| > 359:    : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
|   360:    { }
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 1344, in std::__shared_ptr<fbow::cpu, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<fbow::cpu>>(std::_Sp_alloc_shared_tag<std::allocator<fbow::cpu> >)
|  1342:       template<typename _Alloc, typename... _Args>
|  1343:    __shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| >1344:    : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
|  1345:    { _M_enable_shared_from_this_with(_M_ptr); }
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 679, in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<fbow::cpu, std::allocator<fbow::cpu>>(fbow::cpu*&, std::_Sp_alloc_shared_tag<std::allocator<fbow::cpu> >)
|   677:      auto __guard = std::__allocate_guarded(__a2);
|   678:      _Sp_cp_type* __mem = __guard.get();
| > 679:      auto __pi = ::new (__mem)
|   680:        _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
|   681:      __guard = nullptr;
| Source "/usr/include/c++/9/bits/shared_ptr_base.h", line 548, in std::_Sp_counted_ptr_inplace<fbow::cpu, std::allocator<fbow::cpu>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<>(std::allocator<fbow::cpu>)
|   546:      // _GLIBCXX_RESOLVE_LIB_DEFECTS
|   547:      // 2070.  allocate_shared should use allocator_traits<A>::construct
| > 548:      allocator_traits<_Alloc>::construct(__a, _M_ptr(),
|   549:          std::forward<_Args>(__args)...); // might throw
|   550:    }
| Source "/usr/include/c++/9/bits/alloc_traits.h", line 483, in void std::allocator_traits<std::allocator<fbow::cpu> >::construct<fbow::cpu>(std::allocator<fbow::cpu>&, fbow::cpu*)
|   481:    construct(allocator_type& __a, _Up* __p, _Args&&... __args)
|   482:    noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
| > 483:    { __a.construct(__p, std::forward<_Args>(__args)...); }
|   484: 
|   485:       /**
| Source "/home/lidar/FBoW/include/fbow/cpu.h", line 61, in void __gnu_cxx::new_allocator<fbow::cpu>::construct<fbow::cpu>(fbow::cpu*)
|    59:     bool HW_AVX512_F,HW_AVX512_PF,HW_AVX512_ER,HW_AVX512_CD,HW_AVX512_VL,HW_AVX512_BW,HW_AVX512_DQ,HW_AVX512_IFMA,HW_AVX512_VBMI;//  SIMD: 512-bit
|    60: public:
| >  61:     inline cpu(){  memset(this, 0, sizeof(*this)); }
|    62:     inline void detect_host();
|    63:     inline bool isSafeAVX(){return  HW_AVX && OS_AVX;}
| Source "/home/lidar/FBoW/include/fbow/cpu.h", line 61, in fbow::cpu::cpu()
|    59:     bool HW_AVX512_F,HW_AVX512_PF,HW_AVX512_ER,HW_AVX512_CD,HW_AVX512_VL,HW_AVX512_BW,HW_AVX512_DQ,HW_AVX512_IFMA,HW_AVX512_VBMI;//  SIMD: 512-bit
|    60: public:
| >  61:     inline cpu(){  memset(this, 0, sizeof(*this)); }
|    62:     inline void detect_host();
|    63:     inline bool isSafeAVX(){return  HW_AVX && OS_AVX;}
  Source "/usr/include/x86_64-linux-gnu/bits/string_fortified.h", line 71, in fbow::Vocabulary::transform(cv::Mat const&, int, fbow::BoWVector&, fbow::BoWFeatVector&) [0x7f407a12f188]
     68:       return __dest;
     69:     }
     70: #endif
  >  71:   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
     72: }
     73: 
     74: #ifdef __USE_MISC

Illegal instruction (Illegal operand [0x7f407a12f188]) Illegal instruction (core dumped)`

ymd-stella commented 1 year ago

Update FBoW to https://github.com/stella-cv/FBoW/commit/7753c2c17dd7ce8bdf4a7a3fb1262b78d5b9b9b5 and rebuild with -DUSE_AVX=OFF.

Rotoslider commented 1 year ago

This works now. Thank you very much for taking the time to help.