feat: execute EM gear-switch boundaries

This commit is contained in:
梁薄云
2026-08-04 13:01:59 +08:00
parent 55119de1c7
commit de402e61ee
6 changed files with 394 additions and 1 deletions
@@ -0,0 +1,35 @@
using System;
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
/// <summary>Immutable trajectory-execution outcome without controller or hardware coupling.</summary>
public sealed class TrajectoryExecutionState
{
internal TrajectoryExecutionState(EmTrajectoryPoint selectedPoint, GearSwitchStateUpdate gearSwitchUpdate)
{
SelectedPoint = selectedPoint ?? throw new ArgumentNullException(nameof(selectedPoint));
if (gearSwitchUpdate == null)
throw new ArgumentNullException(nameof(gearSwitchUpdate));
GearSwitchState = gearSwitchUpdate.State;
HoldZero = gearSwitchUpdate.HoldZero;
RequestDirectionChange = gearSwitchUpdate.RequestDirectionChange;
AllowsTrajectoryMotion = gearSwitchUpdate.AllowsTrajectoryMotion;
IsTrajectoryComplete = gearSwitchUpdate.IsTrajectoryComplete;
Reason = gearSwitchUpdate.Reason;
}
public EmTrajectoryPoint SelectedPoint { get; }
public GearSwitchState GearSwitchState { get; }
public bool HoldZero { get; }
public bool RequestDirectionChange { get; }
public bool AllowsTrajectoryMotion { get; }
public bool IsTrajectoryComplete { get; }
public string Reason { get; }
}