Skip to content

AR view draws the battery over people and objects in front of it (R-4) #41

Open

Description

@AidenJohnston

Seen in device field test run 2: TestFlight build 3.1, beta at ad91620, capture code t3/ios-mvf e9e405d, server e106acb. The exported scan was lost before it was copied off the phone, so this comes from the screen recording and the code at ad91620. Times are in the recording. b7f51ba and 49a676e on t3/ios-mvf don't change this.

This is the first time the AR view was reached on a device.

What happens. "See it on your wall" showed "The spot an installer will check / 1 ft 3 in left of your meter, 1 ft
of cable". The drawing stayed in place relative to the meter while the tester walked around for about 11 s, which is
good. But:

  • at 4:14–4:16 the battery is drawn over a person standing at the wall (runbook R-4, predicted);
  • at 4:17–4:24, seen from beside the end of the mock wall, it is drawn through the wooden post at the wall's end.

The tester: "see it on the wall, that's not correct, yeah, that's very not correct".

Cause.

  • The overlay is a SwiftUI Canvas projection, BatteryOverlay, drawn on top of the camera image
    (ResultARScreen.swift#L15-L19).
  • Nothing in ios/HouseScan uses personSegmentationWithDepth or scene depth for occlusion. The session has
    sceneDepth and the mesh when the phone supports them (LiveCapture.swift#L61-L73), so
    both are already available.

Placement itself follows the meter's anchor with .gravity alignment, as intended. R-5 (hide while relocalizing) is
handled in code at the same ResultARScreen.swift lines but wasn't tried on the device.

Possible fixes (your call):

  • add .personSegmentationWithDepth on the AR screen and mask the canvas with it;
  • or render the box in RealityKit with scene-understanding occlusion from the mesh, which also hides it behind posts
    and equipment.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    size:M30-99 effective changed lines.
    on Sep 26, 2026
  2. self-assigned this
    on Sep 26, 2026
  3. added a commit that references this issue on Sep 26, 2026
  4. AidenJohnston commented on Sep 27, 2026

    @AidenJohnston
    CollaboratorAuthor

    Build 4.1 field test (TestFlight 4.1, beta 45017ba, iPhone 14 without LiDAR, three runs on 2026-09-26): the RealityKit move draws nothing at all now; see #67.

    • Run 1, 6:10–6:25, and run 2, 4:36–4:56: "See it on your wall" showed only the card ("The spot an installer will check…"). No battery, cable or tint appeared, even when aimed at the meter and conduit where the cable starts. Run 2 had the correct ground height, so geometry doesn't explain it. Run 3 didn't open the AR view.
    • So occlusion (R-4) couldn't be tested.
    • Separately, the walk's gap patches and outlines are still drawn through objects: through the existing battery (run 1, 4:33 and 5:24–5:35) and through office furniture (run 2, 4:02–4:10 and 4:30).
    • Walk overlays also drifted off their objects after a walk (AR overlays drift off their objects after walking away (window outline drawn over the panel) #73), so the result may be off once it draws.

    Analyses: PR #60 (run 1, run 2).

  5. AidenJohnston commented on Sep 27, 2026

    @AidenJohnston
    CollaboratorAuthor

    Decision needed: how far AR occlusion should go for the demo (#41)

    Where the code is now (t3/ios-mvf): on the live camera the result is drawn in RealityKit. Mesh occlusion is turned on for LiDAR phones, and on every A12+ phone people occlusion is turned on by re-running the session just after the battery is added (LiveCapture.setOcclusion). On build 4.1 (iPhone 14, no LiDAR) that path drew nothing (#67), so R-4 couldn't be tested.

    The planned fix for #67 (not in a pull request yet) has phones without LiDAR draw the result with the 2D Canvas overlay (BatteryOverlay), which has no occlusion. LiDAR phones switch to RealityKit only once it is confirmed to draw. The fix also removes the mid-screen session re-run, because that re-run is the main suspect for #67. So the question is what to add after that:

    • (A) Accept the limit. LiDAR phones get mesh occlusion, which covers posts, equipment and people. Phones without LiDAR draw over people and objects, and we say so. People occlusion on LiDAR phones could come back by turning it on when the session starts (no re-run), with a performance check during the walk. (Recommended.)
    • (B) Also hide the overlay behind people on phones without LiDAR, using ARKit's person segmentation (segmentationBuffer) as a mask on the Canvas. Objects still aren't occluded. This needs a per-frame mask pipeline, and the mask has to be rotated and scaled with the landscape camera image into the portrait view (only that part can be unit-tested).
    • (C) On-device ML depth for object occlusion. Too big and too risky before the demo.

    Also from build 4.1: the walk's gap patches and outlines (CameraOverlays) are also 2D and were drawn through an existing battery and office furniture. Under A or B that stays as it is on phones without LiDAR; only depth would fix it.

    What unblocks it: a pick, and a device check (runbook R-4) on a LiDAR phone once the #67 fix is on TestFlight. That check also shows whether #67 happens on LiDAR phones at all.

    🤖 Generated with Claude Code

  6. AidenJohnston commented on Sep 27, 2026

    @AidenJohnston
    CollaboratorAuthor

    Team decision (2026-09-27): option A. LiDAR phones get mesh occlusion, and phones without LiDAR draw over people and objects (see #100). No further occlusion work before the deadline.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething is broken or behaving incorrectly.size:M30-99 effective changed lines.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions