Arcore-unity-sdk: Pause plane tracking

Created on 1 Mar 2018  路  18Comments  路  Source: google-ar/arcore-unity-sdk

Can I pause plane tracking without losing the tracked plane and anchor?

bug fixed in upcoming release

Most helpful comment

Java answer to stop tracking is :

Config config = new Config(mSession);
config.setPlaneFindingMode(Config.PlaneFindingMode.DISABLED);
mSession.configure(config);

All 18 comments

If you mean disabling the visualization of tracked planes, follow this https://stackoverflow.com/questions/47254092/disable-toggle-visualization-of-tracked-planes-in-arcore-unity

I mean temporary disable the expansion of plane. I tried that before, disable the visualization doesn't stop the expansion of plane.

Hi, Thanks for the report. Currently the way to do this is to modify the session configuration with EnablePlaneFinding = false and then disable and reenable the ARCoreSession. That would disable plane finding but would keep existing planes as they were at the moment.

If you don't want to disable the session you could force an OnEnable() call on the session without disabling it:
var session = GameObject.Find("ARCore Device").GetComponent<ARCoreSession>(); session.SessionConfig.EnablePlaneFinding = false; session.OnEnable();

We'll be looking into this for next releases.

@pablisho I used this but the plane and the object spawned disapears. Is there a way to stop plane finding but keep rendering the plane and the object?

@paulodgn The plane is lost, because the following code in TrackedPlaneVisualizer.cs :

else if (m_TrackedPlane.TrackingState != TrackingState.Tracking)
            {
                 m_MeshRenderer.enabled = false;
                 return;
            }

If you remove this one, the plane still render.

You can keep the rendering the way @ReiiYuki said but it won't be having tracking updates because it should be in Paused state. Anyway, after a few seconds ARCore should recognize the same space and the plane should go to tracking state again.

Hi, this issue has been fixed in ARCore Unity SDK v1.1.0. Feel free to reopen if you still experience the issue.

Hi, sorry to bump this issue again. I tried "session.SessionConfig.EnablePlaneFinding = false; session.OnEnable();" while a session is running. The plane detection still goes on with old planes continued to expand and new planes continued to be added. I'm using Unity SDK v1.1.0.

I also tried "session.SessionConfig.PlaneFindingMode = GoogleARCore.DetectedPlaneFindingMode.Disabled; session.OnEnable();" on SDK 1.2.0, equally ineffective to stop plane detection. Additionally, the ar screen gets a glitch while doing so.

Am I doing something wrong?

It's worked with my code. Maybe you might have to check again that you really call that code by logging or something.

OK, I was using instant preview when testing this. Seems to be an issue with instant preview. It works as expected when testing as an apk. Thanks @ReiiYuki all the same:)

Java answer to stop tracking is :

Config config = new Config(mSession);
config.setPlaneFindingMode(Config.PlaneFindingMode.DISABLED);
mSession.configure(config);

Can you be more specific about stop detecting Plane Detection? Actually classes are being changed in revised version of ARCore, so above mentioned procedures are not working on this version. @pablisho

Is there any way in which the blue points appearing for feature detection can be paused? (Java)

@pablisho If I use the code:

var session = GameObject.Find("ARCore Device").GetComponent<ARCoreSession>(); 
                session.SessionConfig.EnablePlaneFinding = false; 
                session.OnEnable();

The objects and the plane disappears. What @ReiiYuki suggested also does not work because the planes that have already been detected are not tracked by ARCore anymore. How can I stop plane detection without stopping the tracking of existing planes and objects on those planes ? I am using ARCore 1.4.1 in unity

@Shahrukh95 You're right that if you disable plane finding, your existing planes will become paused. You can adapt your visualizer to keep rendering them even if they are paused but they won't receive any pose updates from ARCore.

@pablisho That will be a problem because I need the tracking capability of ARCore to instantiate multiple objects on the plane even after stopping plane detection. Isn't there some logic we can create that does this ?

I would not pause plane detection if you want your planes to still be detected. I think you can do some logic to either ignore new planes and/or not update existing plane visualization depending on what you actual need.

@pablisho I tried ignoring new planes by adding some code in the "DetectedPlaneGenerator" script but it didn't. If i stop instantiating the plane prefab in this script maybe it may work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChiefBreakeverything picture ChiefBreakeverything  路  6Comments

pshah123 picture pshah123  路  6Comments

Goya- picture Goya-  路  5Comments

pIuszak picture pIuszak  路  6Comments

iBicha picture iBicha  路  4Comments