mapbox-ar-unity icon indicating copy to clipboard operation
mapbox-ar-unity copied to clipboard

Weird changes in camera euler angles at runtime (observed on Android)

Open TevfikUfuk opened this issue 9 years ago • 5 comments

I think Focus square causes lots of ugly height values and sometimes weird tilt orientation of maproot relative to x or z axis. Is it possible to remove focus square and give an constant value to _lastHeight ? Does Focus square exist only for getting _latHeight value? If not, it is better not to use it and we can manually align maproot height or give a constant value since sometimes it rotates maproot around x or z axis.

TevfikUfuk avatar Nov 27 '17 15:11 TevfikUfuk

I'm not sure what you mean by "ugly height values," but the idea of the focus square is just to show the user that the device knows where the "ground" is (recommended UX by Apple). That said, we do use _lastHeight from PlaneAddedHandler to know how high the map should be. This is relative to your start height and will adapt as you walk (up or down a hill, for example). If you don't do this, you will start to notice floating/sunken virtual objects. Does this answer your question?

david-rhodes avatar Nov 27 '17 16:11 david-rhodes

Yeah it works great to find where the "ground" is but on Android rendering issues causes maproot to tilt which I tried to express ugly height values. If I remove focus square and give _lastHeight a constant value, will I get rid of rendering issues? Of course it is trade off I think.

TevfikUfuk avatar Nov 28 '17 06:11 TevfikUfuk

This is the issue I am talking about: https://drive.google.com/open?id=1Cv-b2cervCqfaET3TICNblH5tOj9wvBZ

I put 2 boxes at (0,0,2) and (0,0,4) to better understand where unity north is: https://drive.google.com/open?id=1-mbXjpcZ7OnJp4sYPlmfVwHWbvq7spXO May be this triggered this issue?

TevfikUfuk avatar Nov 28 '17 08:11 TevfikUfuk

I just don't see how the focus square is related to the issue you are describing. I've never seen this behavior before. Perhaps your AR session is initialized without gravity? Check your camera and map root euler angles at runtime, please.

david-rhodes avatar Nov 28 '17 15:11 david-rhodes

Yeah, it is not related to the focus square. I checked camera and maproot euler angles. Maproot is not tilted during runtime so it is probably due to either camera euler angles which could be caused by gyroscope error or the issue that ARCore/ARKIT occasionally gets confused as the user is walking through a scene as described here: https://github.com/ProjectDent/ARKit-CoreLocation#issues

TevfikUfuk avatar Dec 01 '17 06:12 TevfikUfuk