mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-11 19:17:04 +10:00
removed distance-based rejection filter
This commit is contained in:
@@ -982,7 +982,6 @@ List<_PathHop> _buildPathHops(
|
|||||||
: null;
|
: null;
|
||||||
var previousPosition = startPoint;
|
var previousPosition = startPoint;
|
||||||
final distance = Distance();
|
final distance = Distance();
|
||||||
var lastDistance = 0.0;
|
|
||||||
var bestDistance = 0.0;
|
var bestDistance = 0.0;
|
||||||
final hops = <_PathHop>[];
|
final hops = <_PathHop>[];
|
||||||
|
|
||||||
@@ -1029,15 +1028,9 @@ List<_PathHop> _buildPathHops(
|
|||||||
previousPosition = resolvedPosition;
|
previousPosition = resolvedPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the best candidate is much farther than the previous hop, it's likely not the correct match.
|
// NOTE: removed distance-based rejection filter. Accept the best candidate
|
||||||
if (lastDistance + bestDistance > 50000 &&
|
// even if the distance is large — historical filtering could drop valid
|
||||||
candidates != null &&
|
// long-distance links and cause cascading mismatches.
|
||||||
candidates.isNotEmpty) {
|
|
||||||
hopIdx--;
|
|
||||||
lastDistance = bestDistance;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
lastDistance = bestDistance;
|
|
||||||
|
|
||||||
hops.add(
|
hops.add(
|
||||||
_PathHop(
|
_PathHop(
|
||||||
|
|||||||
Reference in New Issue
Block a user