Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question How can I exclude the hole made by an open door from AR planes in Unity's AR Foundation?

Discussion in 'AR' started by BipolarBears, May 2, 2024.

  1. BipolarBears

    BipolarBears

    Joined:
    Jan 23, 2022
    Posts:
    3
    Hi,

    As the title suggests, I have a problem where, If I am inside of a room with a door to another room open, that is still identified as a wall, although, there is nothing there (see pictures below).

    Is it possible to fix this issue? I'm deploying to an iPad pro with LiDAR so it should not be a problem with the depth. It also creates additional walls behind the wall segment covering the door hole, further proving that it "knows" there isn't a wall there.



    IMG_2140.png IMG_2140.png IMG_2145.png
    IMG_2145.png IMG_2145.png
     
  2. WyattBUnity

    WyattBUnity

    Unity Technologies

    Joined:
    Mar 27, 2023
    Posts:
    53
    If you are able to check the classification of the plane, can you check if it is a door? It's possible for ARFoundation to report planes with the classification of a "door", and perhaps that is what you are seeing? Plane tracking | Apple ARKit XR Plugin | 6.0.1 (unity3d.com)

    If not, ARFoundation is not in control of how planes are generated or chosen, as we're polling ARKit (on the case of an ipad) for planes and we're not in control of what planes are detected in this instance.
     
    andyb-unity and jakem-unity like this.
  3. BipolarBears

    BipolarBears

    Joined:
    Jan 23, 2022
    Posts:
    3
    Hi WyattBUnity!
    Thank you very much for your reply!

    I have not checked whether I can use the labels, will try it out. Thanks! But will the whole wall be considered a door, then? Or just the part that's covering the "door hole"? Could you please clarify?

    Reading between the lines in your last paragraph, "ARFoundation is not in control of how planes are generated or chosen, as we're polling ARKit [...]", it isn't possible to manipulate the planes to not include for example, door frames and paintings? Given this, is there a method within Unity for modifying detected planes to exclude certain elements, like door frames or decorations? For example, could developing a plugin, perhaps for ARKit, help achieve this, or would such modifications be more effectively handled by working directly with ARKit on a native level?

    Thanks yet again for your insights!
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,151
    The only modification ARKit allows you to make to the plane detection algorithm is whether it should include horizontal or vertical planes. There is no mechanism to "pre-filter" planes from your app based on their classification. Therefore, AR Foundation cannot filter door planes out for you.

    Another thing you might want to try is Meshing. Mesh detection will be more successful at identifying the shape of your room, including open doors.
     
    BipolarBears likes this.
  5. BipolarBears

    BipolarBears

    Joined:
    Jan 23, 2022
    Posts:
    3
    Hi again,
    Sorry for the late reply. The classifiation did not work and it was not precise enough, I'll try meshing via the ARMeshManager! By the looks of it, it seems I have more control but also doesn't get as much help from ARFoundation as with ARPlaneManager.

    Thank you very much!
     
    Last edited: May 20, 2024
    andyb-unity likes this.