gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.41k stars 2k forks source link

ch13 #174

Open iamkrs9 opened 3 years ago

iamkrs9 commented 3 years ago

@gaoxiang12 I have compiled all the programs and was trying to run the last one. It gives me the following error which I am unable to resolve. Any suggestions?

WARNING: Logging before InitGoogleLogging() is written to STDERR I0522 12:03:05.747987 179224064 dataset.cpp:43] Camera 0 extrinsics: 0 0 0 I0522 12:03:05.748198 179224064 dataset.cpp:43] Camera 1 extrinsics: -0.537151 000000000 000000000 I0522 12:03:05.748211 179224064 dataset.cpp:43] Camera 2 extrinsics: 000.0610306 -0.00143972 00.00620322 I0522 12:03:05.748222 179224064 dataset.cpp:43] Camera 3 extrinsics: 0-0.474418 0.00187031 00.0033185 I0522 12:03:05.748283 179224064 visual_odometry.cpp:45] VO is running 2021-05-22 12:03:05.816 run_kitti_stereo[585:6220] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!' First throw call stack: ( 0 CoreFoundation 0x00007fff2067a98b exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff203b2d92 objc_exception_throw + 48 2 AppKit 0x00007fff22df9ed6 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4389 3 libpangolin.dylib 0x0000000108f26680 +[PangolinNSApplication run_step] + 96 4 libpangolin.dylib 0x0000000108f2394e _ZN8pangolin9OsxWindowC2ERKNSt3112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEiib + 222 5 libpangolin.dylib 0x0000000108f249ed _ZZN8pangolin24RegisterOsxWindowFactoryEvEN16OsxWindowFactory4OpenERKNS_3UriE + 941 6 libpangolin.dylib 0x0000000108eae750 _ZN8pangolin15FactoryRegistryINS_14VideoInterfaceEE4OpenERKNS_3UriE + 64 7 libpangolin.dylib 0x0000000108ead8ca _ZN8pangolin19CreateWindowAndBindENSt3112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiRKNS_6ParamsE + 1242 8 libmyslam.dylib 0x0000000108589b69 _ZN6myslam6Viewer10ThreadLoopEv + 105 9 libmyslam.dylib 0x000000010858b09e _ZNSt31L14thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEENS_6bindIMN6myslam6ViewerEFvvEJPS9EEEEEEEEPvSF + 62 10 libsystem_pthread.dylib 0x00007fff20507954 _pthread_start + 224 11 libsystem_pthread.dylib 0x00007fff205034a7 thread_start + 15 ) libc++abi: terminating with uncaught exception of type NSException zsh: abort bin/run_kitti_stereo

gaoxiang12 commented 3 years ago

This is a known issue from Pangolin: https://github.com/stevenlovegrove/Pangolin/issues/334. For some reason, the pangolin library cannot be called in a sub-thread in Mac, so you should start the visualization module in the main thread and call the SLAM as a sub-thread.

Please check the example of DSO as an example of how to write the code in this way.

sherlockeded commented 2 years ago

Have you solve this problem? I run into the same error and cannt figure it out.

iamkrs9 commented 2 years ago

No, I wasn't able to solve that. I started with a fresh Linux install and recompiled everything there. It works on Linux