Search Unity

Managing Trackables

Discussion in 'AR' started by GreeneMachine, Oct 3, 2018.

  1. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Hey

    Using the ARFoundation Samples project as an example, what is the best/correct approach to hide planes and point clouds in the scene once you have placed the object?

    I understand you can disable the managers to stop the session detecting and adding more, but to clean out what has already been detected what is required.

    For example: I can get access to the list of current of ARPlanes detected via the ARPlaneManager.GetAllPlanes(), and can either disable the MeshRenderer or disable the entire game object. Then disable the PlaneManager component on the session origin.

    But is there more to be done to avoid issues?

    Cheers
    R
     
    chedabob likes this.
  2. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Just to add to the above.. I'm not sure if I am misunderstanding how ARFoundation is supposed to be used or if I have a bug.

    I added the following code to the PlaceOnPlane.cs on ARSessionOrigin

    Code (CSharp):
    1. planeManager = gameObject.GetComponent<ARPlaneManager>();
    2. planeManager.enabled = false;
    3.  
    ... just after you instantiate the spawnedObject.

    My understanding is, disabling the ARPlaneManager will stop the session detecting and drawing new planes. And ultimately I can do the same for ARPointCloudManager.. but Im just trying to get one working on IOS now!

    It appears to work fine on Android (ie.stops generating new planes) and anchors the spawnedObject in the scene.. but it causes the session to stop tracking/stall for a couple of seconds on IOS. The result is the existing planes, point cloud and placed object float away from their anchor point as I move the camera, the point cloud also appears to freeze (like its not updating), then the point cloud starts to update again and the plane and placed object anchor in the scene..

    The code works fine in Android build.

    Unity 2018.2.10
    ARFoundation 18
    ARCore 19
    ARKit 14

    Samsung S8
    iPad 2017
     
  3. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Here is the profiler when I disable the plane manager. Appears the XRUpdate stops calling InvokePointCloud... for the duration of the stall I am experiencing during tracking.

    Anyone else having trouble disabling the ARPlaneManager on IOS? All I've added to the Sample scene is the lines of code mentioned above. This does not occur on Android. I have another issue on Android, in that changing from an AR scene to another scene stalls for 5+ secs... and that doesnt happen on IOS.

    I am using ARFoundation because I want the scale functionality... but Im only trying to test the simple sample scene provided for now to get familiar

    Screen Shot 2018-10-04 at 10.12.19.png Screen Shot 2018-10-04 at 10.12.39.png
     
    Last edited: Oct 5, 2018
  4. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    @jimmya Any thoughts on this? Anything I can check on my build settings? All I am doing in my test at the moment is disabling ARPlaneManager in the SampleScene after I have placed the cube and it causes AR to loose tracking and the point cloud to stop updating for 6seconds? Only on IOS.

    Cheers
     
    Apadmi likes this.
  5. ApadmiUP

    ApadmiUP

    Joined:
    Jul 23, 2018
    Posts:
    1
    We're experiencing the same issue - Disabling or destroying the manager is causing the placed object to float off for a few seconds and then snap back. Only evident on iOS, android is much more stable.
    It might be a shot in the dark too, but it does appear to be more common/worse looking on iOS 12/beta.
     
    Last edited: Oct 5, 2018
    Apadmi, chedabob and GreeneMachine like this.
  6. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
  7. Edur-Games

    Edur-Games

    Joined:
    Nov 21, 2017
    Posts:
    48
    Hello!
    I'm experiencing problems on this subject.
    I will try to clean only the planes and leave activated the ARPlaneManager.
    It certainly is a little unstable
     
  8. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
  9. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    @Edur-Games Hey, this is being discussed again on another thread. I never got it solved 100%.. Did you ever sort it?
    Thanks
     
  10. Edur-Games

    Edur-Games

    Joined:
    Nov 21, 2017
    Posts:
    48
    Hello!
    I haven't solved it either. We will have to wait for some update on this, meanwhile continue with the Arkit plugin that seems more stable..
     
  11. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    @tdmowrer hi, are you experiencing this issue on ios? Ie. Tracking stalls when ARPlanemanager is disabled... and planes, cloud & placed object floats for a number of seconds before eventually snapping to original location and anchoring.
    Thks
     
  12. ryaneugenekelley

    ryaneugenekelley

    Joined:
    Jul 8, 2015
    Posts:
    3
    @tdmowrer I would love to know if there is a fix the floating issue or even a work around if you know of one for iOS. I have a App Store push at the end of the week.
     
  13. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    There was a bug in the ARKit package, which was fixed earlier this week. Please update to the latest ARKit package in Window > Package Manager within Unity.
     
  14. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
    Glad to hear this should be fixed.

    Does this require a min ver of unity, arfoundatiin and target ios? I want to test this.

    Thanks
     
  15. GreeneMachine

    GreeneMachine

    Joined:
    Jul 3, 2015
    Posts:
    126
  16. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Unity 2018.1, iOS 11.3 (12 to use ARWorldMap). The latest version of the ARFoundation package is only needed to support some features of ARWorldMap.
     
    GreeneMachine likes this.
  17. Edur-Games

    Edur-Games

    Joined:
    Nov 21, 2017
    Posts:
    48
    Hello!
    It seems that the problem has been solved that there were vibrations and stability. I've tried it on my project and it works a lot better.
    Thank you very much and congratulations on the update!