Files
I150/srcs/RobotNet10/RobotApp/RobotNet10.RobotApp/Services/Navigation/CSharp/LocalPlannerConfig.cs
2026-07-03 16:37:12 +07:00

73 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}