aframe icon indicating copy to clipboard operation
aframe copied to clipboard

aframe is causing images to shake rapidly (see the video attached)

Open Fede-viale opened this issue 2 years ago • 11 comments

On Android devices, across all browsers, some aframe examples shake like crazy at the smallest movement. We experimented this issue even when the mobile devices were totally still.

  • A-Frame Version: 1.1.0
  • Platform / Device: Android (all, but tested on One Plus 5, Xiaomi Redmi Note 9 Pro, Pixel 1, Galaxy S10 , Galaxy S20)
  • Reproducible Code Snippet or URL: attached video to reproduce the issue.

https://user-images.githubusercontent.com/98468287/162217230-3a385be8-b0d9-455a-97af-fb1c5649f794.mp4

Fede-viale avatar Apr 07 '22 14:04 Fede-viale

It could be sensor noise / drift. I don’t think much can be done on the A-Frame side.

It doesn’t seem to be affecting normal operation once you grab the phone in your hand, correct?

dmarcos avatar Apr 08 '22 15:04 dmarcos

when you grab the phone in your hand it's almost imperceptible to see. But if you looking for it, you'll see it.

Are you sure there is nothing to do on A-Frame side?

Fede-viale avatar Apr 08 '22 16:04 Fede-viale

FWIW I cannot reproduce the issue on a Pixel 3 and the examples on the site

https://aframe.io/aframe/examples/

I noticed the report is filed against 1.1.0. You should be using 1.3.0

Do you have any more specific steps to reproduce? I’m loading the sites on the link above and tracking works as expected. I occasionally see some drift / noise when laying the phone flat on a surface but tracking resumes as expected when picking the phone back.

I tested on Chrome 100

dmarcos avatar Apr 08 '22 16:04 dmarcos

Tracking is functional for me. there might be some drift / noise in certain phones but those are barely perceptible in normal operation as you mentioned.

dmarcos avatar Apr 08 '22 16:04 dmarcos

When we tested we used the example in the following link -> https://aframe.io/examples/showcase/sky/

We opened the link using chrome 100 and the only thing we did was opened the link in the browser.

We're testing right now in a Samsung Galaxy S10 now on Chrome 100. The result is the same. The experience shakes.

Fede-viale avatar Apr 08 '22 16:04 Fede-viale

Is the experience functional? you mention noise is imperceptible on normal operation right?

dmarcos avatar Apr 08 '22 16:04 dmarcos

Yes, It's imperceptible when you're on movement. but, if you pay attention you could see it anyway!

And, what do you mean about Experience functional?

Fede-viale avatar Apr 08 '22 16:04 Fede-viale

Thanks. By functional I mean a user will be able to use the experience without issue or discomfort.

dmarcos avatar Apr 08 '22 16:04 dmarcos

This is probably not a super high priority. The tracking logic is here:

https://github.com/aframevr/aframe/blob/master/vendor/DeviceOrientationControls.js

You’re welcome to have a look and explore solutions. Maybe implementing some kind of filter is possible to reduce noise.

dmarcos avatar Apr 08 '22 17:04 dmarcos

Some filter code could be useful to learn from:

https://github.com/immersive-web/cardboard-vr-display/blob/main/src/sensor-fusion/complementary-filter.js

If googling for info probably look for “quaternion low pass filter” that could be applied to the data coming from the deviceorientation events

dmarcos avatar Apr 08 '22 17:04 dmarcos

Interesting reference https://stackoverflow.com/questions/25744984/implement-a-kalman-filter-to-smooth-data-from-deviceorientation-api

I think filtering the deviceorientation data is the only thing it could be done on the A-Frame side. Interesting that data is cleaner on Safari iOS.

dmarcos avatar Apr 11 '22 02:04 dmarcos

I'm not sure we can do much on the A-Frame side. This doesn't affect normal operation. I'm open to suggestions if someone has more insight and ways to improve. I'm closing for now and can reopen if necessary

dmarcos avatar Nov 21 '22 01:11 dmarcos