stella-cv / stella_vslam

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

can't open /orb _vocab.fbow #487

Closed Jlim01 closed 1 year ago

Jlim01 commented 1 year ago

I use Intel cpu not gpu (I don't have gpu like nvidia) My ubuntu environment is that 18.04 ver (open cv 3.x) When i input run command on the docker environment, It happened under the error. terminate called after throwing an instance of 'std::runtime_error' what(): Vocabulary::readFromFile could not open:./orb_vocab.fbow How to solve this error? Im just wanna see VSLAM(like ORB2) visualizing image


`root@88554c449440:/stella_vslam/build# ./run_video_slam --disable-mapping -v ./orb_vocab.fbow -m ./aist_living_lab_2/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --map-db-in map.msg [2023-03-09 03:00:35.911] [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-03-09 03:00:35.911] [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:

[2023-03-09 03:00:35.911] [I] loading ORB vocabulary: ./orb_vocab.fbow terminate called after throwing an instance of 'std::runtime_error' what(): Vocabulary::readFromFile could not open:./orb_vocab.fbow Stack trace (most recent call last):

14 Object "", at 0xffffffffffffffff, in

13 Object "/stella_vslam/build/run_video_slam", at 0x564886f1ce44, in _start

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

11 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff078bc5d8f, in __libc_init_first

10 | Source "/stella_vslam/example/run_video_slam.cc", line 267, in main

|   266:     // build a slam system
| > 267:     auto slam = std::make_shared<stella_vslam::system>(cfg, vocab_file_path->value());
|   268:     bool need_initialize = true;
|   269:     if (map_db_path_in->is_set()) {
| Source "/usr/include/c++/11/bits/shared_ptr.h", line 879, 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> >&&)
|   877:       typedef typename std::remove_cv<_Tp>::type _Tp_nc;
|   878:       return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
| > 879:                       std::forward<_Args>(__args)...);
|   880:     }
| Source "/usr/include/c++/11/bits/shared_ptr.h", line 863, 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> >&&)
|   862:       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
| > 863:                 std::forward<_Args>(__args)...);
|   864:     }
| Source "/usr/include/c++/11/bits/shared_ptr.h", line 409, 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> >&&)
|   407:       template<typename _Alloc, typename... _Args>
|   408:    shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| > 409:    : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
|   410:    { }
| Source "/usr/include/c++/11/bits/shared_ptr_base.h", line 1342, 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> >&&)
|  1340:       template<typename _Alloc, typename... _Args>
|  1341:    __shared_ptr(_Sp_alloc_shared_tag<_Alloc> __tag, _Args&&... __args)
| >1342:    : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
|  1343:    { _M_enable_shared_from_this_with(_M_ptr); }
| Source "/usr/include/c++/11/bits/shared_ptr_base.h", line 650, 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> >&&)
|   648:      auto __guard = std::__allocate_guarded(__a2);
|   649:      _Sp_cp_type* __mem = __guard.get();
| > 650:      auto __pi = ::new (__mem)
|   651:        _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
|   652:      __guard = nullptr;
| Source "/usr/include/c++/11/bits/shared_ptr_base.h", line 519, 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> >&&)
|   517:      // _GLIBCXX_RESOLVE_LIB_DEFECTS
|   518:      // 2070.  allocate_shared should use allocator_traits<A>::construct
| > 519:      allocator_traits<_Alloc>::construct(__a, _M_ptr(),
|   520:          std::forward<_Args>(__args)...); // might throw
|   521:    }
| Source "/usr/include/c++/11/bits/alloc_traits.h", line 516, 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> >&&)
|   514:    {
|   515: #if __cplusplus <= 201703L
| > 516:      __a.construct(__p, std::forward<_Args>(__args)...);
|   517: #else
|   518:      std::construct_at(__p, std::forward<_Args>(__args)...);
  Source "/usr/include/c++/11/ext/new_allocator.h", line 162, 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> >&&) [0x564886f1bcd5]
    159:    void
    160:    construct(_Up* __p, _Args&&... __args)
    161:    noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
  > 162:    { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    163: 
    164:       template<typename _Up>
    165:    void

9 Source "/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&) [0x7ff07a62477d]

     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");

8 Source "/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 >) [0x7ff07a671432]

     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;

7 Source "/stella_vslam/3rd/FBoW/src/fbow.cpp", line 391, in fbow::Vocabulary::readFromFile(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) [0x7ff07884360d]

    388: //loads/saves from a file
    389: void Vocabulary::readFromFile(const std::string &filepath){
    390:     std::ifstream file(filepath,std::ios::binary);
  > 391:     if (!file) throw std::runtime_error("Vocabulary::readFromFile could not open:"+filepath);
    392:     fromStream(file);
    393: }

6 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7ff078e92517, in __cxa_throw

5 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7ff078e922b6, in std::terminate()

4 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7ff078e9224b, in std::rethrow_exception(std::__exception_ptr::exception_ptr)

3 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7ff078e86bbd, in __cxa_throw_bad_array_new_length

2 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff078bc47f2, in abort

1 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff078bde475, in raise

0 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff078c32a7c, in pthread_kill

Aborted (Signal sent by tkill() 44 0) Aborted (core dumped) root@88554c449440:/stella_vslam/build# `

Jlim01 commented 1 year ago

I solved it ! imageThe problem was that the files could not be downloaded. Re-downloading to docker solved the problem. However, as in the question below, the pangolin viewer (map view) does not appear as a window in Docker. Of course, the cloud point viewer comes out as a window.

like this image

My command is your example code

Jlim01 commented 1 year ago

image

my command ./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

ymd-stella commented 1 year ago

Close because it is duplicated with #481.