- Issue category: Plane Detection
- Device type & OS version: Android
- Host machine & OS version: Windows
- Issue Environment : On Device
- ARDK version: 1.0.1
- Unity version: 2020.3.22f1
Description of the issue: I’m trying to follow this tutorial about detecting planes. I’ve implemented a class that creates an AR Session and detecting planes by following the tutorial. It seems working about finding planes. But I feel like there is something missing about merging them. When I try to detect the top of my bed with ARPlaneManager, it seems like there is only one plane detected. When I try with my custom class, it detects the same plane again and again which casues the PlanePrefab to be generated multiple times on top of itself. I tried to check the ARPlaneManager to see differences and implemented OnAnchorsUpdated and OnAnchorsRemoved accordingly as well like this:
private void OnAnchorsRemoved(AnchorsArgs args) {
foreach (var anchor in args.Anchors) {
if (anchor.AnchorType == AnchorType.Plane) {
Destroy(PlaneLookup[anchor.Identifier]);
PlaneLookup.Remove(anchor.Identifier);
}
}
}
private void OnAnchorsUpdated(AnchorsArgs args) {
foreach (IARPlaneAnchor anchor in args.Anchors) {
if (PlaneLookup.TryGetValue(anchor.Identifier, out GameObject plane)) {
plane.transform.position = anchor.Transform.ToPosition();
plane.transform.rotation = anchor.Transform.ToRotation();
plane.transform.localScale = anchor.Extent;
}
}
}
It doesn’t seem like it changed anything. Here are pictures from two different scenes with the same view, my bed. First is with my custom class and second one is with ARPlaneManager. I hope the difference is visible. (Putting link to second image since I can’t post 2 images)
Another issue or question I have is, is this the correct way to let my session detect both horizontal and vertical planes?
config.PlaneDetection = PlaneDetection.Horizontal | PlaneDetection.Vertical;
From the pictures it’s also can be seen that the walls aren’t being detected quite well. Is this something caused by my test case and the texture of my wall? Or am I doing something wrong?
Thanks for all the answers/suggestions in advance!