Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Inspection Target #1400

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/api.test/Client/AreaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ public async Task MissionIsCreatedInArea()
new()
{
Inspections = inspections,
InspectionTarget = new Position(),
TagId = "test",
RobotPose = new Pose(),
TaskOrder = 0
Expand Down
7 changes: 0 additions & 7 deletions backend/api.test/Client/MissionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,12 @@ public async Task ScheduleDuplicateCustomMissionDefinitions()
{
RobotPose = new Pose(new Position(23, 14, 4), new Orientation()),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 0
},
new()
{
RobotPose = new Pose(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 1
}
]
Expand Down Expand Up @@ -535,7 +533,6 @@ public async Task GetNextRun()
{
RobotPose = new Pose(),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 0
}
]
Expand Down Expand Up @@ -718,14 +715,12 @@ public async Task MissionDoesNotStartIfRobotIsNotInSameInstallationAsMission()
{
RobotPose = new Pose(),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 0
},
new()
{
RobotPose = new Pose(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 1
}
]
Expand Down Expand Up @@ -788,14 +783,12 @@ public async Task MissionFailsIfRobotIsNotInSameDeckAsMission()
{
RobotPose = new Pose(new Position(1, 9, 4), new Orientation()),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 0
},
new()
{
RobotPose = new Pose(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f),
Inspections = [],
InspectionTarget = new Position(),
TaskOrder = 1
}
]
Expand Down
2 changes: 1 addition & 1 deletion backend/api/Controllers/MissionSchedulingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ [FromBody] ScheduledMissionQuery scheduledMissionQuery
.SelectMany(
t =>
{
return t.Inspections.Select(i => new MissionTask(t, i.InspectionPoint)).ToList();
return t.Inspections.Select(i => new MissionTask(t)).ToList();
}
)
.ToList();
Expand Down
2 changes: 0 additions & 2 deletions backend/api/Controllers/Models/CustomMissionQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public struct CustomTaskQuery
{
public int TaskOrder { get; set; }

public Position InspectionTarget { get; set; }

public string? TagId { get; set; }

public string? Description { get; set; }
Expand Down
1 change: 0 additions & 1 deletion backend/api/Database/Context/FlotillaDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<MissionTask>(missionTaskEntity =>
{
if (isSqlLite) { AddConverterForDateTimeOffsets(ref missionTaskEntity); }
missionTaskEntity.OwnsOne(task => task.InspectionTarget);
missionTaskEntity.OwnsOne(
task => task.RobotPose,
poseEntity =>
Expand Down
14 changes: 7 additions & 7 deletions backend/api/Database/Context/InitDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Successful
};
Expand All @@ -446,7 +446,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Failed
};
Expand All @@ -466,7 +466,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.PartiallySuccessful
};
Expand All @@ -486,7 +486,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Cancelled
};
Expand All @@ -506,7 +506,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Failed
};
Expand All @@ -526,7 +526,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Failed
};
Expand All @@ -546,7 +546,7 @@ private static List<MissionTask> GetMissionTasks()
{
new()
}
}, new Position(1.0f, 1.0f, 1.0f))
})
{
Status = TaskStatus.Failed
};
Expand Down
9 changes: 1 addition & 8 deletions backend/api/Database/Models/MissionTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ public class MissionTask
public MissionTask() { }

// ReSharper disable once NotNullOrRequiredMemberIsNotInitialized
public MissionTask(EchoTag echoTag, Position tagPosition)
public MissionTask(EchoTag echoTag)
{
Inspections = echoTag.Inspections
.Select(inspection => new Inspection(inspection))
.ToList();
EchoTagLink = echoTag.URL;
TagId = echoTag.TagId;
InspectionTarget = tagPosition;
RobotPose = echoTag.Pose;
EchoPoseId = echoTag.PoseId;
TaskOrder = echoTag.PlanOrder;
Expand All @@ -39,7 +38,6 @@ public MissionTask(CustomTaskQuery taskQuery)
.ToList();
TagId = taskQuery.TagId;
Description = taskQuery.Description;
InspectionTarget = taskQuery.InspectionTarget;
RobotPose = taskQuery.RobotPose;
TaskOrder = taskQuery.TaskOrder;
Status = TaskStatus.NotStarted;
Expand All @@ -56,7 +54,6 @@ public MissionTask(Pose robotPose, MissionTaskType type)
RobotPose = robotPose;
TaskOrder = 0;
Status = TaskStatus.NotStarted;
InspectionTarget = new Position();
Inspections = new List<Inspection>();
break;
case MissionTaskType.DriveTo:
Expand All @@ -65,7 +62,6 @@ public MissionTask(Pose robotPose, MissionTaskType type)
RobotPose = robotPose;
TaskOrder = 0;
Status = TaskStatus.NotStarted;
InspectionTarget = new Position();
Inspections = new List<Inspection>();
break;
default:
Expand All @@ -81,7 +77,6 @@ public MissionTask(MissionTask copy, TaskStatus? status = null)
IsarTaskId = status == null ? "" : null;
Description = copy.Description;
EchoTagLink = copy.EchoTagLink;
InspectionTarget = new Position(copy.InspectionTarget);
RobotPose = new Pose(copy.RobotPose);
EchoPoseId = copy.EchoPoseId;
Status = status ?? copy.Status;
Expand Down Expand Up @@ -111,8 +106,6 @@ public MissionTask(MissionTask copy, TaskStatus? status = null)
[MaxLength(200)]
public Uri? EchoTagLink { get; set; }

public Position? InspectionTarget { get; set; }

[Required]
public Pose RobotPose { get; set; }

Expand Down
Loading
Loading