Files
MeshCore-Solo/examples
MarekZegare4 a67bf9e220 fix(companion): bound trail simplification error on gentle curves + live distance
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>
2026-06-24 17:01:50 +02:00
..
2026-06-06 21:09:38 +10:00
2026-06-06 21:09:38 +10:00
2026-06-06 21:09:38 +10:00