Experiments to attempt to get ORB-SLAM3 working with emscripten.
Please use the binvoc branch of my own fork of ORB-SLAM3
Memory alignment issue seems to be fixed, thanks to the PROXY_TO_PTHREAD
flag, which runs main()
on a separate thread. Thanks to @carlodek for this suggestion. Not sure why it fixes the issue though!
Able to test on an actual Android device now, however some ongoing problems:
- memory alignment issue, see the Emscripten Port issue in ORB-SLAM2 repo. This should be fixable once the issue below is fixed...
- still having problems with initialising tracking on a mobile device (works better on a desktop), even after updating camera parameters (currently using params output from OpenCV Android calibrator sample).
Now starting to get tracking working. Added log messages to ORB-SLAM3 fork to identify causes of initialisation failure. Had to remove the time interval check win Tracking::Track()
- not sure what impact that has. When two views are obtained, currently an unaligned memory access error occurs. Not sure of the cause of this at present.
Using binary vocabulary file, now loads in 2s compared to more than 10 minutes :-)
Got ORB loading. Things to note:
-
the
.data
file generated by emscripten needs to be copied from thewasm
directory to the project root. This can probably be fixed with some configuration but this is on the todo list. -
note the security settings for the headers in
.htaccess
. These are necessary to allowSharedArrayBuffer
, which is necessary for threading.