Memory management and large-scale scans on iOS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory management and large-scale scans on iOS

torjusti
Hi!

I'm using RTAB-Map to do handheld scanning of underground caves and mines, and despite having been playing around with different RGB-D cameras I'm seeing best results with an iPhone 15 Pro (and it also has a very usable form factor for this activity).

Unfortunately the iOS app doesn't always handle long running scans very well and the app will usually crash once the memory counter goes a bit over 2GB (presumably killed by iOS).

I've experimented with 1) rendering low detail point clouds only, and 2) limiting the working memory size to 200 nodes. The latter seems to have done me some good, but the app will still usually end up crashing if I try to append to this scan after saving (I guess that for some reason this loads more data into memory).

Does anyone have success stories related to using RTAB-Map for scanning vast cave systems and would be willing to share their tricks? Or more generally, are there any other tips related to memory management on iOS that I'm missing out on?
Reply | Threaded
Open this post in threaded view
|

Re: Memory management and large-scale scans on iOS

matlabbe
Administrator
Hi,

You may check my answer here: http://official-rtab-map-forum.206.s1.nabble.com/iOS-best-practices-for-only-tracking-long-recordings-tp10300p10311.html

If you search rtabmap on sketchfab (https://sketchfab.com/search?q=rtabmap&type=models), you will see some scans in caves, though maybe not as huge as you do. Note that these scans were mostly taken with RTAB-Map on Google Tango phones. The iOS app should produce similar results.

Note that if RTAB-Map crashes, it is possible to recover the database. There would be a rtabmap.tmp.db in RTAB-Map folder on the device. You can backup that file somewhere else. Here 3 ways to recover it:
1. Normally if you re-open RTAB-Map iOS app, it should detect that there is an unfinished scan and ask you to recover it.
2. copy rtabmap.tmp.db on a computer and recover it with rtabmap-recovery CLI tool.
3. copy rtabmap.tmp.db on your computer under ~/Documents/RTAB-Map (the folder automatically created when you launch RTAB-Map Desktop the first time). Open RTAB-Map's desktop app, then click on "New Database" and you should get a warning telling that an incomplete database exists and ask you if you want to recover it, click Yes.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Memory management and large-scale scans on iOS

torjusti
Thanks for your response and work.

Just wanted to share with those interested that for my purposes, turning off "live" loop closure detection by disabling feature extraction (Mapping > Max Features Extracted) and relying on ArUco markers has been working nicely. I can scan for extended periods of time this way as the loop closure vocabulary no longer grows indefinitely.
Reply | Threaded
Open this post in threaded view
|

Re: Memory management and large-scale scans on iOS

matlabbe
Administrator
Thank you for sharing your experience. The tags can also be useful in textureless areas (empty homes) and/or a convenient way to add easily loop closures than relying on visual features: just point a tag on start of scanning, and look back again at the tag before finishing the scan. They can also be used for multi-session mapping in areas where lighting/furniture can change over time (making it more difficult to detect visual loop closures).

Note that for even less computation / memory overhead, at the trade-off of not detecting online any loop closures (even landmarks), is to use the new Data Recording mode (Menu -> Advanced -> New Data Recording). These kind of databases would need to be reprocessed offline on RTAB-Map Desktop, following examples here.

cheers,
Mathieu