castoryan/ORB-SLAM-Android

import error...

jeffreyzhang23 opened this issue · 7 comments

please ignore the title...I run the project on my phone, and the .yaml files were imported. everything looks ok. but nothing happends except this
image
how to use the APP? thank u.

You should just press SYSTEM and if the application initializes which should take sometime, it should start orb slam. It requires the vocabulary file and the settings file updated to your devices camera put under /emulated/0/ORB2 on LG G3. You will be able to find if it crashes in your logcat with debug level where its trying to load the file from if its a different phone. I got into a glitch where the vocabulary file which is txt when the app is loading to initialize seems to parse it as xml and initialization fails. Am trying to figure out why as the README does not say anything about converting the vocubulary file to an xml format.

Can you share the voc file or is it you used the one referred in the readme. If it's the same file don't worry. I couldn't get past trying to parse the voc file which errors out saying it should be an xml file as the app tries to parse as xml for some reason. Once I resolve then I think I might have some idea of your problems.

Maybe there is some config opencv is using by default or my build has some which is messing with the parsing.

I hope this can help u.

Thanks for your help @jeffreyzhang23. That indirectly helped me as I found the issue was not with that though in this project. The problem was the voc and settings.yaml files were swapped when it was read internally within the application and where the application tries to parse the settings.yaml file voc.txt was geting passed and that was not parsable and so the error. Just for testing, I just swapped the file names order in the code and built it and tested it. Am able to get past the error I was getting and am seeing what your seeing. According to your image and on my phone, I can see orb slam is being processed, but there is no way to see that the slam is doing something as there is no preview for the point cloud that's being generated. I don't know whether we are missing something here. I will have to dig in deeper and see how or what is going on and see if there is a view that should show the point cloud or something. It also seems to not track as well, as if it was tracking it should show some green squares which orb slam interprets and then the point cloud generated based on that (this is from seeing what the original orb slam ros module does or even https://github.com/FangGet/ORB_SLAM2_Android does. The one referred provides a view to see the slam working and the point cloud generation though.

To answer to your question of what is going on once the app is initialized and orb slam starts working. It just logs some debug info in the log and nothing other than that. If the README, the author mentions tha "By now, only basic functions were supported. The pose of every frame returns via android log files, which are easy to check via Android Studio. Some basic debug info have been added, feel free to add others as you need.". Basically from the image you shared, the frame rate is around 1.2 FPS which almost the same for me as well with a res of 1280x720 px, which is a lot to process for mobile phone. Thats why the FPS is quite low running on a mobile phone. Also read in some of the slam tests in other slam's(lsd slam on mobile) they try to use 640x480 or even 320x240 especially on mobile phones to get better frame rates though quality of image would be naturally lesser as well but on a mobile phone, the limited processing power would be better utilized to get the slam working smoothly with a lower resolution for the images fed than being slow or crashing. More optimizations maybe need to be done as you work on the application.

With ref to this app, the app needs extended to handle the pose of every frame and start tracking and then generate a point cloud or so. Check out the one at https://github.com/aivijay/ORB_SLAM2_Android which is a fork of the same referred in the previous message. Some minor tweaks were done in this. Basically it allows to select your voc, settings.yaml and then initializes orb slam and once initialized you should be able to see the tracking on the left side and the point cloud plotting on the right size though very slow(maybe the image size needs to be reduced to get a better frame rate). But works to some extent. Needs more fine tuning and performance improvements.

Yours seem to run at 960x544 which also should be a lot of data to process on a mobile phone and so we get the sloppy frame rate. I dont know how much we can get by coming down to 320x240 though. I will have to find out how I can force the image resolution so we can see how things change with resolution and how much we can track and create point clouds on it.