using System.Collections.Generic; using System.Collections.ObjectModel; namespace MultiWheelC.TrajectoryPlanning.PathSmoothing; /// 路径平滑的公共配置;所有距离使用 m。 public sealed class PathSmoothingConfiguration { /// 创建带有安全默认值的平滑配置。 public PathSmoothingConfiguration() { OutputSpacingMeters = 0.05d; MaximumCollisionCheckStepMeters = 0.025d; MinimumClearanceReserveMeters = 0.02d; SmoothingStrength = 1d; AllowFallbackToCoarsePath = true; RetryStrengthScales = new ReadOnlyCollection( new List { 1d, 0.75d, 0.50d, 0.25d }); } /// 正式单算法入口使用的方法。 public SmoothingMethod Method { get; set; } /// 输出路径的目标弧长采样间距,单位 m。 public double OutputSpacingMeters { get; set; } /// 扫掠碰撞检查的最大步长,单位 m。 public double MaximumCollisionCheckStepMeters { get; set; } /// 平滑候选必须在最小净空之外保留的额外余量,单位 m。 public double MinimumClearanceReserveMeters { get; set; } /// 算法初始平滑强度。 public double SmoothingStrength { get; set; } /// 所有平滑尝试失败时是否允许发布经过复核的原粗路径。 public bool AllowFallbackToCoarsePath { get; set; } /// 有限且严格递减的平滑强度重试比例。 public IReadOnlyList RetryStrengthScales { get; } /// 三次 B 样条专用参数。 public CubicBSplineOptions CubicBSpline { get; } = new CubicBSplineOptions(); /// 局部三次 Bézier 专用参数。 public LocalCubicBezierOptions LocalCubicBezier { get; } = new LocalCubicBezierOptions(); /// 分段五次多项式专用参数。 public PiecewiseQuinticOptions PiecewiseQuintic { get; } = new PiecewiseQuinticOptions(); }