-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: camera pass-through mode #313
base: master
Are you sure you want to change the base?
Conversation
seems like there are some lint issues, you can auto fix them by going though the documentation https://github.com/alvr-org/PhoneVR?tab=readme-ov-file#development |
Ah I see... Sorry... the spotless apply thing was checked always before android studio build the apk, but it seems it didn't check the c++ part. Ok I will update I guess tomorrow or the day after tomorrow. |
Yeah, sure. I tried this and the passthough works really well, really good work !!
Rest everything looks good |
Ok so, lets see what the steps are:
Another question... should I squash the commits together to one when I am finished here? |
Edit: Also if you want more immediate response you can join Discord and communicate in #dev channel :3 |
Just to make myself clear, Training mode is nothing fancy, just an Activty showing realtime graphs of 3axis of accelSensor so that they(users) get used to it. You can use an existing libary for graphs like https://github.com/PhilJay/MPAndroidChart-Realm (other libs here https://github.com/lucasrafagnin/android-charts) If you are looking for some button, there is a suggestion here: #77 |
So here some points to understand the algorithm:
For each axis:
(Beware It is not important on which axis this applies... but that is also the reason why I use sumMean to prevent it to trigger when something like this happens in one axis, but the other axis have more "movement")
The current implementation needs a steady phase before the double tap and a steady phase after the double tap |
Nice explanation. Do add this documentation into the code :3 |
ps: in #334 i added utils.h and modified it according to phonevr, i handled errors in existing alvr_main.cpp GL* calls which i forgot earlier. You may want to use that, it will be merged when tests are done. |
Well it seems like I have to cleanup my git history somehow... as rebasing needs to many merges for unneeded commits. I am not really well versed in this kind of stuff... so I think I will make a branch, rebase there (if this is possible) do some commit cherry picking and hope everything works as suspected... and after that I think I must rewrite history of the master branch so that it can be pulled from here. Sounds that reasonable or is my thinking wrong? |
Combine 7 commits to one: * Initial Passthrough implementation with menu to select passthrough mode. * Made passthrough available via inflateMenu. Fixed crashes during change to passthrough mode. * Added recordingHint to Settings. Open Camera only on passthrough mode. * Added option to trigger passthrough by double tapping the headset on the side. * run make format * Moved passthrough code into separate file * split passthrough stuff into separate file, made variables camelCase
Well I did some cherry-picking, rebasing force-pushing and so on...^^ |
Quantify its size, i dont think android libraries would be that heavy. Still some linting errors :3 |
/ok-to-test sha=16e98a2 |
I have a question... What am I missing? I don't get the last CI Test... Do I need to add some tests? |
Just reopened and closed the PR so that the tests will get retriggered, now. If i remember there were some errors (maybe linting errors). Were you able to test at local properly ? |
I don't get the Test APK error as it fails on Screenshot uploading... but I haven't even implemented a test (well... I know... it is not good design)... Maybe something with the CI Action is wrong? |
/ok-to-test sha=a6ebf88 |
📷 Screenshots of tests:📱 Pixel_2(AVD) - 11🔧 ALVRActivityTest_saveDeviceScreenBitmap🔧 ALVRActivityTest_saveDeviceScreenBitmap_LookingDown🔧 ALVRActivityTest_saveDeviceScreenBitmap_LookingFrontDown🔧 ALVRActivityTest_saveDeviceScreenBitmap_Popup🔧 InitActivityTest_saveDeviceScreenBitmap🔧 MainActivityTest_saveDeviceScreenBitmap🔧 SettingsActivityTest_saveDeviceScreenBitmap🔧 view-op-error-1For commit a6ebf88 |
CI Actions are atlast fixed. |
@Schmetzler Anything left on your end to do here ? |
If I find the time... I would like to look into the variable names, add some comments and maybe add some test cases... But I am not very well versed in android development (and also testing) anyway... I can imagine to add a test case where I put some predefined data into the algorithm and check if it triggers the passthrough mode... But I think it would take me at least a week (I need to find time, and I resetted my OS so I need to setup the development environment again) |
its okay, take your time. Let me know if you are stuck somewhere : ) |
Sorry I cannot afford to work on it anymore. Get everything to build is just too much of a hassle for me and stresses me... You may merge it the way it is (which is working and functional) but I won't change any naming or add comments without the possibility to check if everything works. And even for the testing it seems that there is no possibility to mock the sensordata. If the code is too complicated I am willing to explain. Hope you understand and find the code usefull nevertheless. Thanks for your patience |
Its okay, no need to worry too much, i will look into this : ) |
I added a pass-through mode for ALVR... recently only tested in the lobby, but it should work while streaming (or should it?).
You can trigger the pass-through by double tapping on the side of your headset... this is a little experimental and needs some practice you should not hit too hard and also not to soft and you must start in a resting position.
Basically it detects 2 maxima of the derivative of the accelerator sensor signal on a predefined delay.
The algorithm is somewhat described in the comments of
onSensorChanged
Or you can switch to passthrough in the settings menu (which is not really usable when the device is in the headset). Maybe it can be set to a predefined button (any suggestions?)
I also added a preference Activity, where you can tinker with the values for the pass-through or disable auto detection if it interferes while playing.
There are 2 more options in the Settings menu, the Passthrough fraction (the fraction of the view that should be filled with the camera image ... this is needed as some cameras hava a really narrow FOV so the passthrough would look kinda too close) and the set Recording Hint, if set to false this can increase the FOV but usually also decreases the FPS which is kinda hard to look at, but maybe this is a no issue on newer smartphones.