WorldAlignment also for Android?

Hi! Are there any plans to make the WorldAlignment parameter available for Android as well? Specifically GravityAndHeading would be really nice to have :slight_smile:

Thanks in advance!

2 Likes

Hello Felix,

Thank you for getting in touch with us. Your suggestion has been passed on to our internal teams for consideration.

1 Like

Hi, sorry to bother you - has there been any updates on this request to enable WorldAlignment (and especially GravityAndHeading) for Android as well?

Thanks in advance, Felix

Hello Felix,

I apologize for the delay in getting back to you!

As far as I know, there is no configuration to control this on ARCore as there is for ARKit. We’re simply using the underlying configuration on ARKit as shown in this document. May I ask what you’re hoping to achieve with this setting? Understanding your use case will help us better assist you. Thank you!

1 Like

Hi! No worries - thanks for your answer, that explains the difference between the two platforms, which I was mainly wondering about.

I’ll try to explain the use-case “briefly”: in the project my team and I are currently working on we are trying to geo-locate 3D models to real-world WGS coordinates, but without relying on (the full) VPS functionality, so we’re not using Wayspot-based anchors for now at least. We have a mobile app for Android & iOS and when we launch it we query the device’s GPS and also the compass, using Unity’s Input.compass.trueHeading - which does not work reliably for us (but maybe we’re doing something wrong here). Upon starting the ARSession we currently apply the acquired heading y-rotation to the “origin” of the running session, under which all objects will be loaded - and that’s where the workflow would differ between Android & iOS, having the GravityAndHeading-setting:

  • starting the session on iOS would automagically init the session in a way that physically looking north will always mean y-rotation == 0 (from the perspective of a single model), with z-direction always being aligned north/south.
  • if we want to achieve the same on Android, we have to manually “turn” the origin around the y-axis to align with the current heading we got from the compass, in order to align all objects in the scene in the same direction. Again, with the goal of rotation.y == 0 should face the “real” north.

Imagine the following example on Android, but without application of the compass-alignment:

  • you start the session on Android while physically facing north and you save an object 2m in front of you
  • you close that app, then turn around to face south and re-open the app
  • the object would still be in front of you while in reality it should be behind you

And that’s where I hoped that you could solve that for us under the hood, similar to how ARkit already does this :wink: Hoping that you have more developer-power or some secret sauce to get more consistent heading from Unity/Android or, even better, automagically have the session always face north :slight_smile:

Hello Felix,

Thank you for your response!

Unfortunately, there currently is not an ARDK supported solution unless you use VPS, which is what that feature was made for. The best you could do for now is what you’re currently doing: use Input.compass.trueHeading (which can be pretty inaccurate) and put a root transform at the top of your scene that can be used to provide the rotated origin of the scene. However, I’m uncertain how you will find the origin of your scene in this case.

Another method which involves Image Anchors might be to put images rotated the right way at the real world location to try and match it up. This can be error prone as you get further away from the image, so you might want multiple images that are placed in the world.

1 Like