SpectacularAI / sdk-examples

Spectacular AI SDK examples
Apache License 2.0
202 stars 35 forks source link

Not able to run mapping_visu.py in Ubuntu 20.04 (python 3.8) #32

Closed leizhao3 closed 1 year ago

leizhao3 commented 2 years ago

Hi,

I'm trying to use mapping_visu.py, but I run into the following issue.

  1. data.jsonlseems not generated when I ran python mapping_visu.py --outputFolder /home/lzhao/Spectacular_AI/sdk-examples/python/oak/Maps/20220716Trial1. Therefore, the following error shows up when trying to replay it:
$ python mapping_visu.py --dataFolder /home/lzhao/Spectacular_AI/sdk-examples/python/oak/Maps/20220716Trial1
Starting replay
SpectacularAI ERROR: Could not open /home/lzhao/Spectacular_AI/sdk-examples/python/oak/Maps/20220716Trial1/data.jsonl.
  1. mapping_visu.py --dataFolder also ran into the following error message.
Stack trace (most recent call last):
#26   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#25   Object "python3", at 0x5fa5cd, in _start
#24   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f31899000b2, in __libc_start_main
#23   Object "python3", at 0x6b736c, in Py_BytesMain
#22   Object "python3", at 0x6b6fe1, in Py_RunMain
#21   Object "python3", at 0x67e816, in PyRun_SimpleFileExFlags
#20   Object "python3", at 0x67e470, in 
#19   Object "python3", at 0x67e3ce, in 
#18   Object "python3", at 0x67e350, in 
#17   Object "python3", at 0x68d046, in PyEval_EvalCode
#16   Object "python3", at 0x569399, in _PyEval_EvalCodeWithName
#15   Object "python3", at 0x570673, in _PyEval_EvalFrameDefault
#14   Object "python3", at 0x5f3e1d, in _PyObject_MakeTpCall
#13   Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187edb1d6, in 
#12   Object "python3", at 0x5a7a06, in 
#11   Object "python3", at 0x59c747, in 
#10   Object "python3", at 0x5f3546, in PyObject_Call
#9    Object "python3", at 0x50b157, in 
#8    Object "python3", at 0x5f3e1d, in _PyObject_MakeTpCall
#7    Object "python3", at 0x5f3988, in PyCFunction_Call
#6    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187eddf8d, in 
#5    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187f01955, in 
#4    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187f2f3c9, in spectacularAI::Replay::Builder::build()
#3    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187f2d5a4, in 
#2    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7f3187e65166, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f31898fe858, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f318991f03b, in gsignal
Aborted (Signal sent by tkill() 175584 1889601537)
Aborted (core dumped)

2.1. Similar issue persists when ran python depthai_combination.py

[14442C1031F8F5D000] [1.3] [1404.845] [SpatialDetectionNetwork(10)] [warning] Neural network inference was performed on socket 'RGB', depth frame is aligned to socket 'RIGHT'. Bounding box mapping will not be correct, and will lead to erroneus spatial values. Align depth map to socket 'RGB' using 'setDepthAlign'.
SpectacularAI ERROR: /__w/vio/vio/src/api/../util/allocator.hpp:36
Stack trace (most recent call last) in thread 176467:
#9    Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#8    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fb897e89162, in clone
#7    Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7fb897d4f608, in 
#6    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7fb88eb33c0f, in 
#5    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7fb88e38b7ea, in 
#4    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7fb88df4dfb3, in 
#3    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7fb88df649d0, in 
#2    Object "/home/lzhao/.local/lib/python3.8/site-packages/spectacularAI.cpython-38-x86_64-linux-gnu.so", at 0x7fb88df64941, in 
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fb897d8c858, in abort
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7fb897dad03b, in gsignal
Aborted (Signal sent by tkill() 176406 1889601537)
Aborted (core dumped)
  1. python pen_3d.py has the following issue. Not sure if these are related or not:
    Stack trace (most recent call last):
    #31   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439cc1ec, in 
    #30   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439cc11a, in gtk_container_propagate_draw
    #29   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43beba93, in 
    #28   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43b92634, in 
    #27   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439d633b, in 
    #26   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439d1490, in 
    #25   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43b9179c, in 
    #24   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439cc11a, in gtk_container_propagate_draw
    #23   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43beba93, in 
    #22   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439cc1ec, in 
    #21   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439cc11a, in gtk_container_propagate_draw
    #20   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43beba93, in 
    #19   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43a842e4, in 
    #18   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439d633b, in 
    #17   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad439d1490, in 
    #16   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43a8703f, in 
    #15   Object "/lib/x86_64-linux-gnu/libgtk-3.so.0", at 0x7fad43b0e835, in gtk_render_layout
    #14   Object "/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0", at 0x7fad5827f207, in 
    #13   Object "/lib/x86_64-linux-gnu/libpango-1.0.so.0", at 0x7fad5853dd03, in pango_renderer_draw_layout
    #12   Object "/lib/x86_64-linux-gnu/libpango-1.0.so.0", at 0x7fad5853d938, in pango_renderer_draw_layout_line
    #11   Object "/lib/x86_64-linux-gnu/libpango-1.0.so.0", at 0x7fad5853ce12, in pango_renderer_draw_glyph_item
    #10   Object "/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0", at 0x7fad5827ee3c, in 
    #9    Object "/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0", at 0x7fad5827ec1a, in 
    #8    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b37e7d5, in cairo_show_glyphs
    #7    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b329604, in 
    #6    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b326501, in 
    #5    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b36ff98, in cairo_surface_get_font_options
    #4    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b399c43, in 
    #3    Object "/lib/x86_64-linux-gnu/libcairo.so.2", at 0x7fad5b3971a7, in 
    #2    Object "/lib/x86_64-linux-gnu/libX11.so.6", at 0x7fad5dd38ca9, in XGetDefault
    #1    Object "/lib/x86_64-linux-gnu/libX11.so.6", at 0x7fad5dd5d51e, in XrmQGetResource
    #0    Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7fad8dc70fc4, in pthread_mutex_lock
    Segmentation fault (Address not mapped to object [0x10])
    Segmentation fault (core dumped)

    Environment Linux ~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Any help will be appreciate! Thank you!

Bercon commented 2 years ago

python mapping_visu.py --outputFolder ... will record the pointcloud, but it will not record a replayable session. To do this you could add config.recordingFolder = "./recording/" into def captureLoop(): and then replay it with python mapping_visu.py --dataFolder ./recording.

The --dataFolder option will likely fail if it doesn't have sufficient data stream, for example slam has to be enabled while capturing for the mapping to work. We should make the errors a bit more informative here.

SpectacularAI ERROR: /__w/vio/vio/src/api/../util/allocator.hpp:36 sounds like the SDK output wasn't read fast enough. Did you see any window with the RGB image? I couldn't replicate this myself

The issue with pen_3d.py sounds like a problem with matplotlib or possibly opencv. You could try to change SHOW_CAM = False to see if that helps

oseiskar commented 1 year ago

Could not reproduce. Reopen if the problem persists / reappears.