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