ORB_SLAM3 icon indicating copy to clipboard operation
ORB_SLAM3 copied to clipboard

Assertion (mit->second>=3) failing in LocalInertialBA function

Open saiprakash-c opened this issue 4 years ago • 12 comments

Hi,

I am running the monocular-inertial version of ORBSLAM3 with the following configuration:

  • Robot: A smart wheelchair
  • Camera: Intel RealSense D435i
  • Camera frequency: 15 Hz
  • IMU: BMI055(embedded inside the camera)
  • IMU frequency: ~ 200 Hz

The initialization phase happens smoothly. But after initialization, the following assertion fails when the LocalMapping thread calls LocalInertialBA from optimizer.cc.

~/git/ORB_SLAM3/src/Optimizer.cc:4878: static void ORB_SLAM3::Optimizer::LocalInertialBA(ORB_SLAM3::KeyFrame*, bool*, ORB_SLAM3::Map*, bool, bool): Assertion `mit->second>=3' failed.

If I remove the assertion, the LocalInertialBA runs with no further problem, but the next keyframe gets added at the wrong location.

Has anyone run into this issue? May I know what causes this error?

Thanks a lot for your help!

Sai Prakash Reddy C

saiprakash-c avatar Oct 09 '20 16:10 saiprakash-c

Getting the same error about 20% of the time when running on EUROC-MAV sequences

mihaibujanca avatar Oct 11 '20 20:10 mihaibujanca

Hi,

I am running the monocular-inertial version of ORBSLAM3 with the following configuration:

  • Robot: A smart wheelchair
  • Camera: Intel RealSense D435i
  • Camera frequency: 15 Hz
  • IMU: BMI055(embedded inside the camera)
  • IMU frequency: ~ 200 Hz

The initialization phase happens smoothly. But after initialization, the following assertion fails when the LocalMapping thread calls LocalInertialBA from optimizer.cc.

~/git/ORB_SLAM3/src/Optimizer.cc:4878: static void ORB_SLAM3::Optimizer::LocalInertialBA(ORB_SLAM3::KeyFrame*, bool*, ORB_SLAM3::Map*, bool, bool): Assertion `mit->second>=3' failed.

If I remove the assertion, the LocalInertialBA runs with no further problem, but the next keyframe gets added at the wrong location.

Has anyone run into this issue? May I know what causes this error?

Thanks a lot for your help!

Sai Prakash Reddy C

is solved? thanks

xzmbb avatar Nov 17 '20 11:11 xzmbb

No, I couldn't figure out what triggers this error.

saiprakash-c avatar Nov 17 '20 18:11 saiprakash-c

Hi,

I am running the monocular-inertial version of ORBSLAM3 with the following configuration:

  • Robot: A smart wheelchair
  • Camera: Intel RealSense D435i
  • Camera frequency: 15 Hz
  • IMU: BMI055(embedded inside the camera)
  • IMU frequency: ~ 200 Hz

The initialization phase happens smoothly. But after initialization, the following assertion fails when the LocalMapping thread calls LocalInertialBA from optimizer.cc.

~/git/ORB_SLAM3/src/Optimizer.cc:4878: static void ORB_SLAM3::Optimizer::LocalInertialBA(ORB_SLAM3::KeyFrame*, bool*, ORB_SLAM3::Map*, bool, bool): Assertion `mit->second>=3' failed.

If I remove the assertion, the LocalInertialBA runs with no further problem, but the next keyframe gets added at the wrong location.

Has anyone run into this issue? May I know what causes this error?

Thanks a lot for your help!

Sai Prakash Reddy C

I meet the same problem. Is it solved?

hwb0314 avatar Dec 15 '20 08:12 hwb0314

I meet the same problem. Is it solved?

slamhuangxin avatar Feb 01 '21 02:02 slamhuangxin

No, I couldn't figure out what triggers this error.

Compile all code with the release. by this way , we avoid this error.

guchangjun avatar Apr 15 '21 00:04 guchangjun

Compile all code with the same release method, e.g., g2o, voc, and orbslam3.

guchangjun avatar Apr 15 '21 00:04 guchangjun

@guchangjun 不太理解,能详细解释一下吗?

xinruozhishui201314 avatar Apr 20 '21 02:04 xinruozhishui201314

@xinruozhishui201314 when compiled in debug mode, i encountered the assert(mit->second>=3) problem in localmapping thread. but if i compiled the project in release mode (as well as g2o ThirdParty), the issue disappeared. I yet have not figured out the reason behind, but it works. The only drawback is cant debugging.

Keeeeeeevin avatar Jul 01 '21 14:07 Keeeeeeevin

why?who knows the questions ?

zhangpeng66 avatar Mar 06 '22 10:03 zhangpeng66

I guess this is because of the implementation of the macro assert. assert will be regard as a fatal error in debug mode but will be regard as nothing in release mode. The implementation in GCC will be like:

#ifdef NDEBUG
#define assert(expr) (__ASSERT_VOID_CAST(0)) #else #define assert(expr) (static_cast(expr) ? void(0) : __assert_fail(#expr, FILE, LINE, __ASSERT_FUNCTION)) #endif

The answer may be that in release mode the compiler defines the macro NDEBUG, which make the compiler ignore assert() function, and nothing happens when mit->second >= 3. However, the condition will trigger the __assert_fail() function in Debug mode. In my opinion, this line may not affect the loop closing result. Maybe this line can be removed when using it.

M-Cyclone avatar Jun 08 '22 07:06 M-Cyclone

Hi, I am running the monocular-inertial version of ORBSLAM3 on Euroc-MAV dataset and ecountering this error: ~/git/ORB_SLAM3/src/Optimizer.cc:4878: static void ORB_SLAM3::Optimizer::LocalInertialBA(ORB_SLAM3::KeyFrame*, bool*, ORB_SLAM3::Map*, bool, bool): Assertion `mit->second>=3' failed.

Please let me know the intuition behind assertion mit->second >=3. Is removing this assertion correct way of solving the problem or will it give wrong results? I thought of resetting the active map when this assertion fails but then it is resetting and losing the entire map very often in upcoming frames. is there any other alternative? Please help.

Deep-thinker05 avatar Sep 30 '22 07:09 Deep-thinker05

I only meet this problem while compiling program with"DEBUG" .when i use Release mode ,this problem is missing but the cam pose was wrong

hongyeah314 avatar Mar 18 '23 07:03 hongyeah314