Skip to content

Commit

Permalink
Prevent localisation mission in safe zone
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jul 30, 2024
1 parent d0a9ebb commit 2492875
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/api/Services/MissionSchedulingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public async Task StartNextMissionRunIfSystemIsAvailable(string robotId)
return;
}

if (robot.MissionQueueFrozen)
{
logger.LogInformation("Robot {robotName} was ready to start a mission but its mission queue was frozen", robot.Name);
return;
}

logger.LogInformation("Robot {robotName} has status {robotStatus} and current area {areaName}", robot.Name, robot.Status, robot.CurrentArea?.Name);

MissionRun? missionRun;
Expand All @@ -56,7 +62,6 @@ public async Task StartNextMissionRunIfSystemIsAvailable(string robotId)
if (missionRun == null)
{
logger.LogInformation("The robot was ready to start mission, but no mission is scheduled");
if (robot.MissionQueueFrozen) { return; }

if (!await localizationService.RobotIsLocalized(robotId))
{
Expand Down

0 comments on commit 2492875

Please sign in to comment.