feat: add lateral optimization model

This commit is contained in:
梁薄云
2026-08-04 00:50:10 +08:00
parent 113d0c9d9b
commit c225b17d37
8 changed files with 625 additions and 2 deletions
@@ -0,0 +1,29 @@
using System;
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
/// <summary>Result of the lateral stage; only independently validated paths may be successful.</summary>
public sealed class LateralPlanningResult
{
public LateralPlanningResult(EmPlanningStatus status, LateralPath path, string failureReason)
{
if (!Enum.IsDefined(typeof(EmPlanningStatus), status))
throw new ArgumentOutOfRangeException(nameof(status));
bool successful = status == EmPlanningStatus.Success || status == EmPlanningStatus.SuccessWithFallback;
if (successful && (path == null || path.Points.Count == 0 || !path.IsIndependentlyValidated))
throw new ArgumentException("Successful lateral results require a non-empty independently validated path.", nameof(path));
if (!successful && path != null)
throw new ArgumentException("Failed lateral results cannot contain a path.", nameof(path));
Status = status;
Path = path;
FailureReason = failureReason ?? string.Empty;
}
public EmPlanningStatus Status { get; }
public LateralPath Path { get; }
public string FailureReason { get; }
}