namespace MultiWheelC.TrajectoryPlanning.CoarsePath; /// 粗路径中方向一致的一段连续点范围;索引两端均包含在段内。 public sealed class PathSegment { /// /// 创建方向分段。 /// 参数:segmentIndex 为从零开始的段序号;startIndex 与 endIndex 为 的包含式索引;两个换向标记描述段首或段尾是否位于换向对。 /// public PathSegment(int segmentIndex, TravelDirection direction, int startIndex, int endIndex, bool startsAtGearSwitch, bool endsAtGearSwitch) { SegmentIndex = segmentIndex; Direction = direction; StartIndex = startIndex; EndIndex = endIndex; StartsAtGearSwitch = startsAtGearSwitch; EndsAtGearSwitch = endsAtGearSwitch; } /// 从零开始的方向段序号。 public int SegmentIndex { get; } /// 此段所有连续运动点对应的行驶方向。 public TravelDirection Direction { get; } /// 此段在 中的起始索引,包含该点。 public int StartIndex { get; } /// 此段在 中的结束索引,包含该点。 public int EndIndex { get; } /// 此段首点是否为换向后保留的新方向点。 public bool StartsAtGearSwitch { get; } /// 此段尾点是否紧邻下一方向段的换向对。 public bool EndsAtGearSwitch { get; } }