AR Foundation....how to use ARReferencePointManager.

Greetings,
i need an help to undestand this. I see the ARReferencePointManager in the components of Ar Foundation.
How to use this? I have to manually set an ARReferencePoint or is something that Foundation do by itself? This help to improve tracking ability? I see this Tutorial but even the guy that makes this video could not elaborate exactly how to use this component…

I have to put any object as a child of the Anchor created by the Reference Point Manager?
I ask this because i need a good tracking performance for my apps, and i have always a little bit of jitter and bad or lossy tracking…
Thanks for any response

I figured out how to use it:
I use ArReferencePointManager.TryAttachReferencePoint for create a Reference Point attached to the virtual floor.
Then i put any gameobject i instantiateas a child of this gameobject. The Tracking is improved a lot!!!

I’ve also been trying to understand how to use Reference Points… If ARFoundation has found a ground plane, and I’ve attached my game objects as a child of this ground plane, is that the same thing as if I were to manually create a Reference Point to attach my objects to?

Good question!
I serch everywhere for solution about this topic…even the official course by Unity on Coursera don’t show the use of the reference point :frowning:

Does anyone have a clue about this? The documentation is very limited around this. Could someone from Unity team explain what is the difference between attaching child object directly to the ARPlane vs adding reference point for this ARPlane and adding children under that ref point instead?

Thanks!

I’m waiting for a similar response…

Does anyone have a definite way to make tracking better? Even when using MakeContentAppearAt(), my created objects are floating around a little bit.

where / how do you get the reference point ( the one you make a children )? Because for arReferencePointManager.addReferencePoint method, it takes Pose. And I can’t figure out how to link a referencePoint i made in script with that pose i passed to addReferncePoint method.

hey @Edisyo Can try with this, hope it helps, cheers

TrackableId trackableTypeHit_ID = s_Hits[0].trackableId;

m_TrackableTypeHit = c_ARPlaneManager.GetPlane(trackableTypeHit_ID);

ARReferencePoint thisRefPoint = c_ARRefPointManager.AttachReferencePoint(m_TrackableTypeHit, hitPose);

1 Like

Thanks, thats a good advice. But i forgot to mention that I use Image Tracking, sorry :confused: therefore I dont use planeManager.

                pos = cannon.transform.position; //same position and rotation as trackedImage
                rot = cannon.transform.rotation;
                Pose pose = new Pose(pos, rot);
                refPoint = aRReferencePointManager.AddReferencePoint(pose);
                refPoint.transform.position = new Vector3(pos.x - 2, pos.y + yValueChange, pos.z + 50);

                foreach (Boat go in battleshipsGameScript.spawnedBoatList)//each boat added as child of refpoint
                {
                    //go.gameObject.transform.SetParent(refPoint.transform);
                    //go.gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
                }

                battleshipsGameScript.spawnPoints[0].transform.SetParent(refPoint.transform);
                battleshipsGameScript.spawnPoints[1].transform.SetParent(refPoint.transform);

I get the referencePoint working, but it still follows camera movements. And when I enable commented script, the objects spawn in cameras position. Is this the correct way to use referencePoint for ImageTracking?

Hi,I’m trying to figure out the same problem. did you solve it by any chance??

Nope, got rid of reference points. :confused: they didn’t work or I just couldn’t get them to work.

Bump, sorry for the necro, I am also trying to distinguish the difference between placing an object on a plane and setting its position and rotation from the hit[0].pose (which seems prone to sliding around a bit) - vs reference points? Reference points sound much more robust, but they also sound like they are performance heavy. That is all I could really find on them. Any more insight would be greatly appreciated.

1 Like

Hi guys, I think that I have the answers for you all.
My background is native ARKit developer so I think I know what stands behind reference points.
First of all - reference points are basically ARKit ARAnchor objects, it means that the session is trying to learn the environment around them for better relocalization. On the contrary when you just add game object the session doesn’t learn then environment and that’s why you experiencing jittering and floating.
Apart from it, Reference points are also being stored in the WorldMap for persistence and multi-players AR sessions(again similar to native ARAnchors).

2 Likes