fix: reject overflowing curvature transitions

This commit is contained in:
梁薄云
2026-07-30 16:56:22 +08:00
parent 0fc64f7693
commit 1e307bc89f
3 changed files with 48 additions and 1 deletions
@@ -46,6 +46,11 @@ internal sealed class CurvatureTransitionDetector
CoarsePathPoint left = request.CoarsePath[leftIndex];
CoarsePathPoint right = request.CoarsePath[leftIndex + 1];
double delta = right.VehicleCurvature - left.VehicleCurvature;
if (!NumericGuard.IsFinite(delta))
{
reason = "局部 G2 曲率事件跳变溢出。";
return false;
}
if (Math.Abs(delta) >= threshold)
{
detected.Add(new CurvatureTransition(