chore: save current workspace progress
This commit is contained in:
@@ -17,6 +17,7 @@ internal static class TrajectoryObservationSegmentChecks
|
||||
RejectsNonTerminalOrMismatchedGearTrajectory();
|
||||
ResetsConfirmationForInvalidDirectionEvidence();
|
||||
CompletesOneSegmentWithoutIndexingPastTheEnd();
|
||||
CompletesSingleForwardGoalTrajectory();
|
||||
}
|
||||
|
||||
private static void RejectsHardcodedActiveSegmentIndex()
|
||||
@@ -112,6 +113,22 @@ internal static class TrajectoryObservationSegmentChecks
|
||||
Verification.Equal(0, tracker.State.ActiveSegmentIndex, "completed tracker retains final segment index");
|
||||
}
|
||||
|
||||
private static void CompletesSingleForwardGoalTrajectory()
|
||||
{
|
||||
DateTimeOffset t0 = new DateTimeOffset(2026, 8, 6, 3, 30, 0, TimeSpan.Zero);
|
||||
var tracker = new TrajectoryObservationSegmentTracker(new[]
|
||||
{
|
||||
CreateSegment(0, TravelDirection.Forward, 0d, 1d, false, 0d, EmBoundaryType.None, EmBoundaryType.Goal),
|
||||
}, CreateSettings(), 0.01d);
|
||||
|
||||
TrajectoryObservationSegmentUpdate completed = tracker.Update(t0, StateAtSwitch(0d, t0, 1L),
|
||||
GoalTerminal(t0));
|
||||
|
||||
Verification.True(completed.Completed, "single forward Goal trajectory reports completion");
|
||||
Verification.Equal(TrajectoryObservationSegmentPhase.Completed, tracker.State.Phase,
|
||||
"single forward Goal reaches completed without requiring a gear-switch terminal");
|
||||
}
|
||||
|
||||
private static void AssertConfirmationReset(DateTimeOffset t0, VehicleMotionState invalidState,
|
||||
EmTrajectory invalidTrajectory, string name)
|
||||
{
|
||||
@@ -196,4 +213,16 @@ internal static class TrajectoryObservationSegmentChecks
|
||||
direction, EmBoundaryType.GearSwitchApproach, 0d, 0d),
|
||||
});
|
||||
}
|
||||
|
||||
private static EmTrajectory GoalTerminal(DateTimeOffset effectiveAtUtc)
|
||||
{
|
||||
var metadata = new EmTrajectoryMetadata("goal-terminal-" + effectiveAtUtc.Ticks, effectiveAtUtc,
|
||||
effectiveAtUtc, 1L, "segment-check", 1L, string.Empty, 0, TravelDirection.Forward,
|
||||
EmTerminalType.Goal, EmLongitudinalMode.ExactStopAtBoundary, EmPlanningScope.FullDirectionSegment);
|
||||
return new EmTrajectory(metadata, new[]
|
||||
{
|
||||
new EmTrajectoryPoint(1d, 0d, 0d, 0d, 0d, 0d, 0, 1d, 1d,
|
||||
TravelDirection.Forward, EmBoundaryType.Goal, 0d, 0d),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user