introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.74k stars 780 forks source link

Crash when exporting mesh with textures #1167

Closed omgitsraven closed 7 months ago

omgitsraven commented 10 months ago

I'm having essentially the same issue as #136 , but the issue was old enough that it seemed better to create a new issue...

My steps are:

  1. Start capturing (from an Azure Kinect)
  2. Stop capturing
  3. File > Export 3D Clouds
  4. Check "Meshing"
  5. Check "Texture Mapping"
  6. Set "Texture Format" to ".png"
  7. Click "save"
  8. The progress bar runs for a while
  9. It asks me to save a file, I do
  10. It creates a .PNG file containing many images in a grid. This file looks normal.
  11. It creates an .OBJ file
  12. Several seconds pass, with the progress window still open
  13. RTAB's window (and the progress window) suddenly disappears
  14. Trying to open the .OBJ file in blender shows a cloud of vertices, with no faces
matlabbe commented 10 months ago

Which rtabmap version are you using? Latest release on Windows? Could it be possible to share the database?

omgitsraven commented 10 months ago

Sorry, yes; 0.21.0 on Windows 10. Here's a tiny example database just to show that it even happens in such a simple case:

crashdemo.zip

matlabbe commented 10 months ago

I could not reproduce the issue with this version following your instructions. Here is a comparison of the exported OBJ in CloudCompare on left, from the point cloud in rtabmap on right: image

You may try to download the ZIP archive, and start RTABMap.exe from that folder directly, maybe in your current installation, RTABMap.exe is loading a wrong dll on start. You may also enable file logging in Preferences: image After rtabmap is closed, a file LogRtabmap.txt is created in your ~/Documents/RTAB-Map.

Note that the black borders in the texture are coming from the RGB image. To crop them we should set "Export 3D clouds dialog" / "Regenerate clouds"->"ROI ratios" to 0.05 0.05 0.05 0.05: image

omgitsraven commented 10 months ago

Downloading a fresh .zip and running it inside there produced the same result.

Here's my log file following the crash:
LogRtabmap.txt

For that matter, here's the .obj and .png that wind up on the disk after the crash: crashdemo_export.zip

matlabbe commented 10 months ago

It looks like it crashed while writing the OBJ (disk space issue?), and I think we are missing some logs that were in the buffer and not yet written to the file. I'll try on another computer tonight if I can reproduce. If you have access to another windows computer, you may try it too to compare. I saw in this post it is possible to get the logs doing RTABMap.exe > logs.txt from a terminal, but it didn't work for me yesterday. I may have to create a new version to get all logs correctly.

matlabbe commented 10 months ago

Good news! I could reproduce the issue on my other computer, which means that there is maybe a missing DLL in the package (the first computer I tried on is the build machine, which all contains developments libraries). I'll try to walk down the dependencies to see which one is different.

matlabbe commented 10 months ago

Looks like I was testing a version on my build machine using older dependencies. I uploaded here to unblock you while I continue investigating what happens with the official release. I feels it may be related to PCL version... Capture d’écran 2023-11-28 022857

omgitsraven commented 10 months ago

Confirming that your unblocker version successfully works for me too, I've exported a mesh with no crashing now! Thank you! (I'll leave the ticket open until it makes it into an official release, I guess?)

matlabbe commented 10 months ago

Keep it open, I am currently checking again with latest dependencies on windows to see if the issue would be fixed implicitly by a new release.

matlabbe commented 10 months ago

Confirming with latest dependencies, the next release should not have this issue. Tested with:

Capture d’écran 2023-11-29 045112

sjmielke commented 7 months ago

I seem to have the same issue, but I'm on an Apple Silicon Mac. Are there nightly or beta binaries or are .2 or .3 being released soon?

Alternatively, I would optimize, mesh, and export in iOS but even just the scanning can only take small areas before the app crashes, I guess running out of memory. There's no flag or setting to prevent that running out at the expense of processing speed, is there? Thanks!!

matlabbe commented 7 months ago

I recently added a homebrew formula (https://github.com/Homebrew/homebrew-core/pull/162576) so that it would be easier in the future to build the latest version on mac with:

brew install rtabmap --head

Nevertheless, I'll try to release new official binaries soon.

sjmielke commented 7 months ago

Sweet! Can't wait until that's merged, thanks! :)On Feb 17, 2024, at 4:57 PM, matlabbe @.***> wrote: I recently added a homebrew formula (Homebrew/homebrew-core#162576) so that it would be easier in the future to build the latest version on mac with: brew install rtabmap --head

Nevertheless, I'll try to release new official binaries soon.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

matlabbe commented 7 months ago

New binaries here: https://github.com/introlab/rtabmap/releases/tag/0.21.4