test: verify EM observation movement test
This commit is contained in:
@@ -25,6 +25,7 @@ internal static class TrajectoryObservationChecks
|
||||
VerifiesLsPresentationUsesPathSOnHorizontalAxis();
|
||||
VerifiesRollingRequestUsesOnePublishedTrajectorySnapshot();
|
||||
FreezesBootstrapVehicleForRollingRequests();
|
||||
VerifiesEmptyMapBootstrapProducesPublishableReference();
|
||||
}
|
||||
|
||||
private static void VerifiesObservationSourceHasNoActuatorCalls()
|
||||
@@ -259,6 +260,36 @@ internal static class TrajectoryObservationChecks
|
||||
expectedMaximumCurvature, expectedMinimumRadius, "replaced bootstrap job vehicle");
|
||||
}
|
||||
|
||||
private static void VerifiesEmptyMapBootstrapProducesPublishableReference()
|
||||
{
|
||||
var settings = new TrajectoryObservationSettings();
|
||||
CoarsePathPlanningJob job = TrajectoryObservationSetupFactory.CreateBootstrapJob(
|
||||
new Pose2D(0.5d, 0.5d, 0d), new Pose2D(3.5d, 0.5d, 0d), settings,
|
||||
Array.Empty<TrajectoryObservationObstacle>(), 0L);
|
||||
|
||||
TrajectoryObservationBootstrapResult bootstrap = new TrajectoryObservationBootstrapper()
|
||||
.Bootstrap(job, CancellationToken.None);
|
||||
|
||||
Verification.True(bootstrap.Succeeded, "observer empty-map bootstrap succeeds");
|
||||
Verification.True(bootstrap.CoarseResult.MapResult.Succeeded,
|
||||
"observer empty-map bootstrap builds a successful map");
|
||||
Verification.True(bootstrap.Map != null, "observer empty-map bootstrap returns a map");
|
||||
Verification.Equal(PlanningStatus.Success, bootstrap.CoarseResult.PlanningResult.Status,
|
||||
"observer empty-map coarse planning succeeds");
|
||||
Verification.True(bootstrap.SmoothedPath != null && IsPublishableSmoothingStatus(bootstrap.SmoothedPath.Status),
|
||||
"observer empty-map bootstrap returns a publishable smoothing result");
|
||||
Verification.True(bootstrap.Segments.Count > 0,
|
||||
"observer empty-map bootstrap returns at least one direction segment");
|
||||
}
|
||||
|
||||
private static bool IsPublishableSmoothingStatus(PathSmoothingStatus status)
|
||||
{
|
||||
return status == PathSmoothingStatus.Complete ||
|
||||
status == PathSmoothingStatus.PartialImprovement ||
|
||||
status == PathSmoothingStatus.NotNeeded ||
|
||||
status == PathSmoothingStatus.Unchanged;
|
||||
}
|
||||
|
||||
private static void AssertVehicleSnapshot(VehicleParameters actual, double expectedLength, double expectedWidth,
|
||||
double expectedMargin, double? expectedMaximumCurvature, double? expectedMinimumRadius, string name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user