Hi, I’ve wanted to fix transform of attached object on marker, and I guessed the solution is stop update trackables position.
I’ve already tried to disable ARTrackedImageManager. However, world origin transform was continuously moving due to the update method in ARSessionOrigin method.
So I thought skipping the method might be a solution. (Also not a solution I guess)
This one is what I tried to.
private bool isPinned = false;
public bool IsPinned { get { return isPinned; } set { isPinned = value; } }
void Update()
{
if (camera && ! isPinned)
{
var pose = GetCameraOriginPose();
trackablesParent.position = pose.position;
trackablesParent.rotation = pose.rotation;
}
}
And this way didn’t work. ARTrackedImageManager was disabled, isPinned was true, and world vector still moved.
Is there any way to prevent moving world origin vector/transform?
It is my goal to fix some GameObject on top of a detected image, and prevent moving unity world according to the camera position/rotation.
For now, I succeeded to spawn some GameObject on top of a marker using Image Tracking, and set disable ARTrackedImageManager.cs to pin the GameObjects.
This video might be helpful to understand the issue what I’ve faced.
Watch after 0:16.
Video flow is like this: An object is attached to the html marker. And I push the “pin” button on the right upper side to set disable ARTrackedImageManager. You can see the position on the left upper side in the screen. It doesn’t change even the GameObject move to strange position.
I don’t think ARSession is to blame here. What I saw in the video is an issue with ARKit/ARCore drifting. The underlying subsystem doesn’t have enough feature points do determine its position in space and it tries to guess it.
Please try not to hold your image marker in front of your phone. The image marker is constantly moving and AR Subsystem can’t understand its location properly.
Thank you for your advice. But it makes me confused. So let me explain what I understood.
I’d like to move my image marker, cause it is necessary to check whether the gameobject is fixed in the world or not after turning off the Tracked Image Manager script.
Just for make sure, let me elaborate my goal once more. My goal is anchoring object using marker, and if the object spawned and be fixed, people could be watching it while walking around the object without detect any markers.
I knew that there is an issue with AR sdk drifting, but didn’t think this is also the same issue because I already turned the manager script off.
Is there no way to prevent drifting object when I turn off image tracking? Did I understand right?
Although you turned the ARTrackedImageManager off, the AR System keeps running to update its position in space.
The drifting is not related to Image Tracking. To reduce drifting and to improve tracking quality it’s not recommended for moving objects to be in camera frame.