Skip to content

Conversation

@DreamWaterFound
Copy link

Excellent work! Thank you very much for your contribution to the open source community. 😘 The work of ORB-SLAM series has helped and inspired many researchers and engineers.

I've noticed that segment fault occurred when testing ORB_SLAM3 in monocular-only, or stereo-olny, or RGB-D on KITTI and TUM RGB-D datasets, as issue #3 , #8 , #16 , #18 , #21 mentioned. So I modified .yaml files and codes to fix it.

In addition, I encountered a small error after I compiled the source code of ORB-SLAM3:

In file included from /usr/include/c++/10/map:61,
                 from <ORB_SLAM3_ROOT>/Thirdparty/DBoW2/DBoW2/BowVector.h:14,
                 from <ORB_SLAM3_ROOT>/include/KeyFrame.h:24,
                 from <ORB_SLAM3_ROOT>/include/MapPoint.h:23,
                 from <ORB_SLAM3_ROOT>/include/Map.h:23,
                 from <ORB_SLAM3_ROOT>/include/Optimizer.h:23,
                 from <ORB_SLAM3_ROOT>/src/Optimizer.cc:20:
/usr/include/c++/10/bits/stl_map.h: In instantiation of ‘class std::map<ORB_SLAM3::KeyFrame*, g2o::Sim3, std::less<ORB_SLAM3::KeyFrame*>, Eigen::aligned_allocator<std::pair<const ORB_SLAM3::KeyFrame*, g2o::Sim3> > >’:
<ORB_SLAM3_ROOT>/src/Optimizer.cc:2388:37:   required from here
/usr/include/c++/10/bits/stl_map.h:123:71: error: static assertion failed: std::map must have the same value_type as its allocator
   123 |       static_assert(is_same<typename _Alloc::value_type, value_type>::value,
       |                                                                       ^~~~~

After testing, this error only appeared with higher version of GCC/G++ compiler such as G++9, G++10. I replaced

typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;

with

typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<KeyFrame *const, g2o::Sim3> > > KeyFrameAndPose;

in the head of file LoopClosing.h and this error was fixed. It works well with G++ 10.0.1, 9.3.0, 8.4.0, 7.5.0, 6.4.0 and 5.5.0.


My environmental information:

OS: Ubuntu 20.04 LTS
GNU GCC/G++: 10.0.1
cmake: 3.16.3
GNU make: 4.2.1

Pangolin: commit 86eb497
OpenCV: 3.2.0
Eigen: 3.2.10


Known problems:

It seems something wrong during Local BA. I can get following warnings if I build ORB_SLAM3 system in DEBUG mode:

...
void g2o::SparseOptimizer::update(const double*): Update contains a nan for vertex xxxx
void g2o::SparseOptimizer::update(const double*): Update contains a nan for vertex xxxx
void g2o::SparseOptimizer::update(const double*): Update contains a nan for vertex xxxx
....
computeActiveErrors(): found NaN in error for edge xxxx
computeActiveErrors(): found NaN in error for edge xxxx
computeActiveErrors(): found NaN in error for edge xxxx
computeActiveErrors(): found NaN in error for edge xxxx
...

More details : issue #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants