I am new to ARCore and I try to write an Android app using it. What I want to do is to estimate the current position based on augmented images that hang at a fixed place on a wall. An app which does something like this is for example this one: https://www.youtube.com/watch?v=eQXKEnrHMxw I want to have an environment where everything is at a predefined position. The input of the app will be for example:
- Picture 1 hangs at Pose 1
- Picture 2 hangs at Pose 2
- Picture 3 hangs at Pose 3
- Object 4 should be displayed at Pose 4
The input can be considered consistent.
To start, I took the "Hello AR" app as a starting point. I created an AugmentedImageDatabase and added images to it and am able to detect them like described in the docs here: https://developers.google.com/ar/develop/java/augmented-images/guide?hl=en The behavior until this point is, that the Pose where the app starts is considered the origin and the pictures pose is detected in relation to this origin.
How can I attach a predefined pose to the scanned image? And as a result change the Pose of the user? So that I can display an object at the predefined position? Or which walkaround exists for that problem?
Additional question: In the docs under https://developers.google.com/ar/develop/augmented-images?hl=en is said: "If your image will never move from its initial position (for example, a poster affixed to a wall), you can attach a global anchor to the image to increase tracking stability." I couldn't find anything about it in the docs. Is the following the way to do it?
val centerPose = img.centerPose
val anchor = session.createAnchor(centerPose)
I'm very thankful for your answers.