Skip to content

Commit

Permalink
Fix that scheduling fails if no map
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Feb 3, 2025
1 parent fbe4928 commit 3f83834
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions backend/api/Controllers/MissionSchedulingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,19 @@ [FromBody] CustomMissionQuery customMissionQuery
InspectionArea = inspectionArea,
};

customMissionDefinition.Map ??= await mapService.ChooseMapFromPositions(
[.. missionTasks.Select(t => t.RobotPose.Position)],
customMissionQuery.InstallationCode
);
try
{
customMissionDefinition.Map ??= await mapService.ChooseMapFromPositions(
[.. missionTasks.Select(t => t.RobotPose.Position)],
customMissionQuery.InstallationCode
);
}
catch (ArgumentOutOfRangeException e)

Check failure on line 576 in backend/api/Controllers/MissionSchedulingController.cs

View workflow job for this annotation

GitHub Actions / test_backend

The variable 'e' is declared but never used

Check failure on line 576 in backend/api/Controllers/MissionSchedulingController.cs

View workflow job for this annotation

GitHub Actions / test_backend

The variable 'e' is declared but never used

Check warning on line 576 in backend/api/Controllers/MissionSchedulingController.cs

View workflow job for this annotation

GitHub Actions / build_backend

The variable 'e' is declared but never used

Check warning on line 576 in backend/api/Controllers/MissionSchedulingController.cs

View workflow job for this annotation

GitHub Actions / build_backend

The variable 'e' is declared but never used
{
logger.LogWarning(
$"Could not find a suitable map for mission definition {customMissionDefinition.Id}"
);
}

if (existingMissionDefinition == null)
{
Expand Down

0 comments on commit 3f83834

Please sign in to comment.