Skip to content

Without LiDAR the wall line stayed 9-11° off the real wall for the whole scan: the refit to a detected plane only runs during the meter close-up #171

Description

@AidenJohnston

On a phone without LiDAR, the meter's wall line was set about 9° off the real wall, and nothing corrected it for the rest of the scan. The corner piece was off by the same amount. ARKit went on to detect the real walls as large planes that agree with each other to within a degree, but refitWallToDetectedPlane only runs during the meter close-up. That close-up lasted about 7 s here and was skipped. Every distance along the walls carries the error: about 1.7 ft out at 10 ft along. It also broke the far-surface detection in the first version of #168.

Seen in the build 7.1 field test on 2026-09-27 (05:50): TestFlight 0.1.0 (7.1) at 7b85a39, iPhone 14 (iPhone14,7, no LiDAR), iOS 26.6.2. The same run as #163 and #164: indoors, a wall phone standing in for the meter, and a corner 1.8 ft right of the meter into a corridor about 6 ft wide.

Data (packet 1.1; headings in the horizontal plane, mod 180°).

line heading detected plane of the same wall its heading off by
wall (the meter's) 169.5° wall-classified, 6.9 × 8.8 ft, centred 2.2 ft from the meter 178.4° 8.9°
wall-right-1 (the corridor) 81.8° two wall-classified planes, 15.1 × 10.1 ft and 24.9 × 15.8 ft (its far side) 92.5°, 93.2° 10.7°
  • The meter's anchor came from the tap on an estimated plane: session.meter_anchor x axis at −10.5°, i.e. 169.5°. The guidance log shows the close-up (g1) was up for 6.8 s and ended skipped.
  • The corner piece came from markNextWall's raycast normal (ScanEngine+Actions.swift#L185-L187). It sits 2.3° from square to the skewed meter line, not to the real corridor wall.
  • Effect: over the corridor, the corridor wall's own detected plane drifts from −0.1 ft to 2.7 ft "out" of the exported line, and the far wall reads 6.1–7.3 ft out rather than a constant distance.

Cause (code at 7b85a39). refitWallToDetectedPlane is gated on state.phase == .meterCloseUp (ScanEngine.swift#L531-L534). Its doc comment says why: coverage can't turn a wall it has already seen (CoverageMap.updateWall), "so a wall found wrong later stays wrong". On phones without LiDAR the large wall planes often arrive after the close-up.

Fix direction.

  • Allow one later re-fit, when a detected plane of the meter's wall (through the meter, wall-classified, several feet wide) disagrees by more than a few degrees. Rebuild the coverage map from the kept views (as recordPastLimits already replays captureOrder), and re-project the marks.
  • Or, as a minimum, orient a new corner piece from the largest detected plane at the hit, not from the raycast's plane normal alone.
  • Log the disagreement in the packet, so field runs show when the line was left skewed.
  • Test (HouseScanKit): a meter line 9° off a later-detected wall plane gets re-fitted, and cells and marks follow.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions