ARPlane not firing .subsumedBy

Hello,
it seems that in [Unity 6.0.16f1 and newest AR Foundation] the ARPlane subsumedBy field is not set.
I am testing this with the XR Simulator. Could anybody confirm this?

I am trying to select an ARPlane, and when it gets subsumed, i want the newly merged ARPlane to be selected. For this I would want to look at newPlane = oldPlane.subsumedBy. This just never seems to be set. I’ve tried catching it in update, i’ve tried catching it OnTrackablesChanged of ARPlaneManager.

Here is some sample code:

    private void OnTrackablesChanged(ARTrackablesChangedEventArgs<ARPlane> changes)
    {
        if (SelectedARPlane == null) return;

        ReadOnlyList<KeyValuePair<TrackableId, ARPlane>> removedNow = changes.removed;
        
        
        //V1
        foreach (var removedPlane in removedNow)
        {
            // Compare the TrackableId of the removed plane with SelectedARPlane's TrackableId
            if (removedPlane.Key == SelectedARPlane.trackableId)
            {
                Debug.Log($"Selected plane {SelectedARPlane.trackableId} has been removed.");
                // ARPlane mergedPlane = SelectedARPlane.subsumedBy;
                // Debug.Log($"It was subsumed by {mergedPlane.trackableId}");
                // Handle the case where the selected plane has been removed
                break;
            }
        }
        
        //V2
        if (SelectedARPlane.subsumedBy != null)
        {
            // Get the new merged plane and update the selection
            ARPlane mergedPlane = SelectedARPlane.subsumedBy;
        
            Debug.Log($"Selected plane {SelectedARPlane.trackableId} was subsumed by {mergedPlane.trackableId}");
        
            // Select the new merged plane
            Select(mergedPlane);
        }
    }

If anyone has any ideas, please let me know.
Kind regards,
Z

As far as I know, only ARCore uses plane subsumption.

Since you say you are testing this with XR simulation, I wouldn’t expect any ARPlanes to be subsumed there.

Here’s more about plane subsumption from Google’s ARCore docs.

1 Like

Note our docs:

Some platforms support the concept of planes subsuming each other, or merging together. When one plane subsumes another, its boundary expands to contain that plane’s detected surface area, and the other plane is removed. The removed plane’s subsumedBy property may contain a reference to the plane that subsumed it if the AR platform supports this.

I can confirm that XR Simulation does not support the subsumedBy property.

1 Like

Thanks for clearing that up. Would love a table about which platforms do and do not support certain features. Especially since XR Simulation is provided by Unity/ARFoundation :slight_smile:

We do have such a table, but unfortunately at the time plane subsumption was implemented, they did not update the XRPlaneSubsystemDescriptor to include this information.

https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.0/manual/features/plane-detection/platform-support.html#optional-features

I’ve gone ahead and created a tech debt task in our backlog to add this to the subsystem descriptor, but this is a low priority for us, so I can’t promise any particular timeframe.

1 Like