73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
namespace RobotNet10.RobotApp.Services.Navigation.CSharp;
|
||
|
||
public enum ApproachResult
|
||
{
|
||
/// <summary>
|
||
/// Approach waypoints đã sinh và prepend thành công
|
||
/// </summary>
|
||
ApproachGenerated,
|
||
|
||
/// <summary>
|
||
/// Robot đã trên path, không cần approach
|
||
/// </summary>
|
||
AlreadyOnPath,
|
||
|
||
/// <summary>
|
||
/// Robot quá xa path, fallback Rotate cũ
|
||
/// </summary>
|
||
TooFarFromPath,
|
||
|
||
/// <summary>
|
||
/// LocalPlanner tắt hoặc path quá ngắn
|
||
/// </summary>
|
||
Disabled
|
||
}
|
||
|
||
public class LocalPlannerConfig
|
||
{
|
||
/// <summary>
|
||
/// Bật/tắt Local Planner
|
||
/// </summary>
|
||
public bool Enabled { get; set; } = true;
|
||
|
||
/// <summary>
|
||
/// Khoảng cách dưới mức này coi robot đã trên path, không cần approach (m)
|
||
/// </summary>
|
||
public double OnPathThreshold { get; set; } = 0.3;
|
||
|
||
/// <summary>
|
||
/// Khoảng cách trên mức này thì fallback Rotate cũ (m)
|
||
/// </summary>
|
||
public double MaxApproachDistance { get; set; } = 3.0;
|
||
|
||
/// <summary>
|
||
/// Hệ số tính merge distance: mergeDistance = MergeDistanceGain × distToPath
|
||
/// </summary>
|
||
public double MergeDistanceGain { get; set; } = 2.0;
|
||
|
||
/// <summary>
|
||
/// Merge distance tối thiểu (m)
|
||
/// </summary>
|
||
public double MergeDistanceMin { get; set; } = 0.3;
|
||
|
||
/// <summary>
|
||
/// Merge distance tối đa (m)
|
||
/// </summary>
|
||
public double MergeDistanceMax { get; set; } = 2.0;
|
||
|
||
/// <summary>
|
||
/// Tỷ lệ control arm phía robot (P1): d1 = ratio × dist(P0, P3)
|
||
/// </summary>
|
||
public double ControlArmRatioStart { get; set; } = 0.4;
|
||
|
||
/// <summary>
|
||
/// Tỷ lệ control arm phía path (P2): d2 = ratio × dist(P0, P3)
|
||
/// </summary>
|
||
public double ControlArmRatioEnd { get; set; } = 0.4;
|
||
|
||
/// <summary>
|
||
/// Bước sample approach curve (m), nên giống PurePursuitConfig.ResolutionSplit
|
||
/// </summary>
|
||
public double ResolutionSplit { get; set; } = 0.05;
|
||
}
|