Files
ParkingRobot/ClumsyPilot/ParkrobTrajplanner/PathSmoothing/Contracts/SmoothedPathSegment.cs
T

49 lines
1.9 KiB
C#

using MultiWheelC.TrajectoryPlanning.CoarsePath;
namespace MultiWheelC.TrajectoryPlanning.PathSmoothing;
/// <summary>平滑路径中方向一致的连续点范围;起止索引均包含在内。</summary>
public sealed class SmoothedPathSegment
{
/// <summary>创建覆盖平滑路径连续索引范围的方向段。</summary>
/// <param name="segmentIndex">从零开始的方向段编号。</param>
/// <param name="direction">该段实际行驶方向。</param>
/// <param name="startIndex">该段首点在完整平滑路径中的包含式索引。</param>
/// <param name="endIndex">该段末点在完整平滑路径中的包含式索引。</param>
/// <param name="startsAtGearSwitch">是否从换向后保留的新方向点开始。</param>
/// <param name="endsAtGearSwitch">是否在紧邻下一方向段的换向对之前结束。</param>
public SmoothedPathSegment(
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>本段在平滑路径中的起始包含式索引。</summary>
public int StartIndex { get; }
/// <summary>本段在平滑路径中的结束包含式索引。</summary>
public int EndIndex { get; }
/// <summary>本段首点是否为换向后保留的新方向点。</summary>
public bool StartsAtGearSwitch { get; }
/// <summary>本段末点是否紧邻下一方向段的换向对。</summary>
public bool EndsAtGearSwitch { get; }
}