mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
The streaming simplifier tested the previous candidate against a line that re-aimed at the newest sample each step. That test point always sits beside the moving chord endpoint, where cross-track is ~0, so a long gentle curve slipped through one sub-min_delta step at a time and collapsed into a single chord deviating arbitrarily far from the real track. Switch to a fixed-corridor (Reumann-Witkam) test: anchor the line at the last committed vertex aimed at the first sample of the run (_dir), and test each *newest* sample against that fixed direction. Deviation is now bounded to ~min_delta, while a straight road still costs only its two endpoints. Also count the uncommitted candidate (_pending) in totalDistanceMeters() so the live distance/speed readout no longer stalls across a long straight run, where the whole stretch is held as one pending point until a bend commits it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>