diff --git a/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs
new file mode 100644
index 000000000..e81ee992a
--- /dev/null
+++ b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.Designer.cs
@@ -0,0 +1,1231 @@
+//
+using System;
+using Api.Database.Context;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Api.Migrations
+{
+ [DbContext(typeof(FlotillaDbContext))]
+ [Migration("20231009102654_AddDefaultLocalizationPoseToDeckAndArea")]
+ partial class AddDefaultLocalizationPoseToDeckAndArea
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("DeckId")
+ .HasColumnType("text");
+
+ b.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b.Property("InstallationId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("PlantId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DeckId");
+
+ b.HasIndex("DefaultLocalizationPoseId");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantId");
+
+ b.ToTable("Areas");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Deck", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b.Property("InstallationId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("PlantId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("DefaultLocalizationPoseId");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantId");
+
+ b.ToTable("Decks");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("DefaultLocalizationPoses");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Installation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InstallationCode")
+ .IsUnique();
+
+ b.ToTable("Installations");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionDefinition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("AreaId")
+ .HasColumnType("text");
+
+ b.Property("Comment")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("InspectionFrequency")
+ .HasColumnType("bigint");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("IsDeprecated")
+ .HasColumnType("boolean");
+
+ b.Property("LastRunId")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("SourceId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.HasIndex("LastRunId");
+
+ b.HasIndex("SourceId");
+
+ b.ToTable("MissionDefinitions");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionRun", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("AreaId")
+ .HasColumnType("text");
+
+ b.Property("Comment")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("Description")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.Property("DesiredStartTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EndTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("EstimatedDuration")
+ .HasColumnType("bigint");
+
+ b.Property("InstallationCode")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("IsarMissionId")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("MissionId")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("StartTime")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("StatusReason")
+ .HasMaxLength(450)
+ .HasColumnType("character varying(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.HasIndex("RobotId");
+
+ b.ToTable("MissionRuns");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Plant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("InstallationId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("PlantCode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("character varying(10)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InstallationId");
+
+ b.HasIndex("PlantCode")
+ .IsUnique();
+
+ b.ToTable("Plants");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Robot", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("BatteryLevel")
+ .HasColumnType("real");
+
+ b.Property("CurrentAreaId")
+ .HasColumnType("text");
+
+ b.Property("CurrentInstallation")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CurrentMissionId")
+ .HasColumnType("text");
+
+ b.Property("Enabled")
+ .HasColumnType("boolean");
+
+ b.Property("Host")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("IsarId")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("ModelId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Port")
+ .HasColumnType("integer");
+
+ b.Property("PressureLevel")
+ .HasColumnType("real");
+
+ b.Property("SerialNumber")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CurrentAreaId");
+
+ b.HasIndex("ModelId");
+
+ b.ToTable("Robots");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.RobotBatteryTimeseries", b =>
+ {
+ b.Property("BatteryLevel")
+ .HasColumnType("real");
+
+ b.Property("MissionId")
+ .HasColumnType("text");
+
+ b.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Time")
+ .HasColumnType("timestamp with time zone");
+
+ b.ToTable("RobotBatteryTimeseries");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.RobotModel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("AverageDurationPerTag")
+ .HasColumnType("real");
+
+ b.Property("BatteryWarningThreshold")
+ .HasColumnType("real");
+
+ b.Property("LowerPressureWarningThreshold")
+ .HasColumnType("real");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UpperPressureWarningThreshold")
+ .HasColumnType("real");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Type")
+ .IsUnique();
+
+ b.ToTable("RobotModels");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.RobotPoseTimeseries", b =>
+ {
+ b.Property("MissionId")
+ .HasColumnType("text");
+
+ b.Property("OrientationW")
+ .HasColumnType("real");
+
+ b.Property("OrientationX")
+ .HasColumnType("real");
+
+ b.Property("OrientationY")
+ .HasColumnType("real");
+
+ b.Property("OrientationZ")
+ .HasColumnType("real");
+
+ b.Property("PositionX")
+ .HasColumnType("real");
+
+ b.Property("PositionY")
+ .HasColumnType("real");
+
+ b.Property("PositionZ")
+ .HasColumnType("real");
+
+ b.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Time")
+ .HasColumnType("timestamp with time zone");
+
+ b.ToTable("RobotPoseTimeseries");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.RobotPressureTimeseries", b =>
+ {
+ b.Property("MissionId")
+ .HasColumnType("text");
+
+ b.Property("Pressure")
+ .HasColumnType("real");
+
+ b.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Time")
+ .HasColumnType("timestamp with time zone");
+
+ b.ToTable("RobotPressureTimeseries");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.SafePosition", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("AreaId")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AreaId");
+
+ b.ToTable("SafePositions");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Source", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.Property("SourceId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Sources");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.HasOne("Api.Database.Models.Deck", "Deck")
+ .WithMany()
+ .HasForeignKey("DeckId")
+ .OnDelete(DeleteBehavior.Restrict);
+
+ b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose")
+ .WithMany()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Api.Database.Models.Plant", "Plant")
+ .WithMany()
+ .HasForeignKey("PlantId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.MapMetadata", "MapMetadata", b1 =>
+ {
+ b1.Property("AreaId")
+ .HasColumnType("text");
+
+ b1.Property("MapName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.HasKey("AreaId");
+
+ b1.ToTable("Areas");
+
+ b1.WithOwner()
+ .HasForeignKey("AreaId");
+
+ b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 =>
+ {
+ b2.Property("MapMetadataAreaId")
+ .HasColumnType("text");
+
+ b2.Property("X1")
+ .HasColumnType("double precision");
+
+ b2.Property("X2")
+ .HasColumnType("double precision");
+
+ b2.Property("Y1")
+ .HasColumnType("double precision");
+
+ b2.Property("Y2")
+ .HasColumnType("double precision");
+
+ b2.Property("Z1")
+ .HasColumnType("double precision");
+
+ b2.Property("Z2")
+ .HasColumnType("double precision");
+
+ b2.HasKey("MapMetadataAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataAreaId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 =>
+ {
+ b2.Property("MapMetadataAreaId")
+ .HasColumnType("text");
+
+ b2.Property("C1")
+ .HasColumnType("double precision");
+
+ b2.Property("C2")
+ .HasColumnType("double precision");
+
+ b2.Property("D1")
+ .HasColumnType("double precision");
+
+ b2.Property("D2")
+ .HasColumnType("double precision");
+
+ b2.HasKey("MapMetadataAreaId");
+
+ b2.ToTable("Areas");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataAreaId");
+ });
+
+ b1.Navigation("Boundary")
+ .IsRequired();
+
+ b1.Navigation("TransformationMatrices")
+ .IsRequired();
+ });
+
+ b.Navigation("Deck");
+
+ b.Navigation("DefaultLocalizationPose");
+
+ b.Navigation("Installation");
+
+ b.Navigation("MapMetadata")
+ .IsRequired();
+
+ b.Navigation("Plant");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Deck", b =>
+ {
+ b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose")
+ .WithMany()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.HasOne("Api.Database.Models.Plant", "Plant")
+ .WithMany()
+ .HasForeignKey("PlantId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("DefaultLocalizationPose");
+
+ b.Navigation("Installation");
+
+ b.Navigation("Plant");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b =>
+ {
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b1.HasKey("DefaultLocalizationPoseId");
+
+ b1.ToTable("DefaultLocalizationPoses");
+
+ b1.WithOwner()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseDefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseDefaultLocalizationPoseId");
+
+ b2.ToTable("DefaultLocalizationPoses");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseDefaultLocalizationPoseId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseDefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseDefaultLocalizationPoseId");
+
+ b2.ToTable("DefaultLocalizationPoses");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseDefaultLocalizationPoseId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.Navigation("Pose")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionDefinition", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "Area")
+ .WithMany()
+ .HasForeignKey("AreaId");
+
+ b.HasOne("Api.Database.Models.MissionRun", "LastRun")
+ .WithMany()
+ .HasForeignKey("LastRunId");
+
+ b.HasOne("Api.Database.Models.Source", "Source")
+ .WithMany()
+ .HasForeignKey("SourceId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Area");
+
+ b.Navigation("LastRun");
+
+ b.Navigation("Source");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.MissionRun", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "Area")
+ .WithMany()
+ .HasForeignKey("AreaId");
+
+ b.HasOne("Api.Database.Models.Robot", "Robot")
+ .WithMany()
+ .HasForeignKey("RobotId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.MapMetadata", "Map", b1 =>
+ {
+ b1.Property("MissionRunId")
+ .HasColumnType("text");
+
+ b1.Property("MapName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.HasKey("MissionRunId");
+
+ b1.ToTable("MissionRuns");
+
+ b1.WithOwner()
+ .HasForeignKey("MissionRunId");
+
+ b1.OwnsOne("Api.Database.Models.Boundary", "Boundary", b2 =>
+ {
+ b2.Property("MapMetadataMissionRunId")
+ .HasColumnType("text");
+
+ b2.Property("X1")
+ .HasColumnType("double precision");
+
+ b2.Property("X2")
+ .HasColumnType("double precision");
+
+ b2.Property("Y1")
+ .HasColumnType("double precision");
+
+ b2.Property("Y2")
+ .HasColumnType("double precision");
+
+ b2.Property("Z1")
+ .HasColumnType("double precision");
+
+ b2.Property("Z2")
+ .HasColumnType("double precision");
+
+ b2.HasKey("MapMetadataMissionRunId");
+
+ b2.ToTable("MissionRuns");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataMissionRunId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.TransformationMatrices", "TransformationMatrices", b2 =>
+ {
+ b2.Property("MapMetadataMissionRunId")
+ .HasColumnType("text");
+
+ b2.Property("C1")
+ .HasColumnType("double precision");
+
+ b2.Property("C2")
+ .HasColumnType("double precision");
+
+ b2.Property("D1")
+ .HasColumnType("double precision");
+
+ b2.Property("D2")
+ .HasColumnType("double precision");
+
+ b2.HasKey("MapMetadataMissionRunId");
+
+ b2.ToTable("MissionRuns");
+
+ b2.WithOwner()
+ .HasForeignKey("MapMetadataMissionRunId");
+ });
+
+ b1.Navigation("Boundary")
+ .IsRequired();
+
+ b1.Navigation("TransformationMatrices")
+ .IsRequired();
+ });
+
+ b.OwnsMany("Api.Database.Models.MissionTask", "Tasks", b1 =>
+ {
+ b1.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b1.Property("Description")
+ .HasMaxLength(500)
+ .HasColumnType("character varying(500)");
+
+ b1.Property("EchoPoseId")
+ .HasColumnType("integer");
+
+ b1.Property("EchoTagLink")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.Property("EndTime")
+ .HasColumnType("timestamp with time zone");
+
+ b1.Property("IsarTaskId")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.Property("MissionRunId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b1.Property("StartTime")
+ .HasColumnType("timestamp with time zone");
+
+ b1.Property("Status")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b1.Property("TagId")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.Property("TaskOrder")
+ .HasColumnType("integer");
+
+ b1.HasKey("Id");
+
+ b1.HasIndex("MissionRunId");
+
+ b1.ToTable("MissionTask");
+
+ b1.WithOwner()
+ .HasForeignKey("MissionRunId");
+
+ b1.OwnsMany("Api.Database.Models.Inspection", "Inspections", b2 =>
+ {
+ b2.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b2.Property("AnalysisType")
+ .HasColumnType("text");
+
+ b2.Property("EndTime")
+ .HasColumnType("timestamp with time zone");
+
+ b2.Property("InspectionType")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b2.Property("InspectionUrl")
+ .HasMaxLength(250)
+ .HasColumnType("character varying(250)");
+
+ b2.Property("IsarStepId")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b2.Property("MissionTaskId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b2.Property("StartTime")
+ .HasColumnType("timestamp with time zone");
+
+ b2.Property("Status")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b2.Property("VideoDuration")
+ .HasColumnType("real");
+
+ b2.HasKey("Id");
+
+ b2.HasIndex("MissionTaskId");
+
+ b2.ToTable("Inspection");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "InspectionTarget", b2 =>
+ {
+ b2.Property("MissionTaskId")
+ .HasColumnType("text");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("MissionTaskId");
+
+ b2.ToTable("MissionTask");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Pose", "RobotPose", b2 =>
+ {
+ b2.Property("MissionTaskId")
+ .HasColumnType("text");
+
+ b2.HasKey("MissionTaskId");
+
+ b2.ToTable("MissionTask");
+
+ b2.WithOwner()
+ .HasForeignKey("MissionTaskId");
+
+ b2.OwnsOne("Api.Database.Models.Orientation", "Orientation", b3 =>
+ {
+ b3.Property("PoseMissionTaskId")
+ .HasColumnType("text");
+
+ b3.Property("W")
+ .HasColumnType("real");
+
+ b3.Property("X")
+ .HasColumnType("real");
+
+ b3.Property("Y")
+ .HasColumnType("real");
+
+ b3.Property("Z")
+ .HasColumnType("real");
+
+ b3.HasKey("PoseMissionTaskId");
+
+ b3.ToTable("MissionTask");
+
+ b3.WithOwner()
+ .HasForeignKey("PoseMissionTaskId");
+ });
+
+ b2.OwnsOne("Api.Database.Models.Position", "Position", b3 =>
+ {
+ b3.Property("PoseMissionTaskId")
+ .HasColumnType("text");
+
+ b3.Property("X")
+ .HasColumnType("real");
+
+ b3.Property("Y")
+ .HasColumnType("real");
+
+ b3.Property("Z")
+ .HasColumnType("real");
+
+ b3.HasKey("PoseMissionTaskId");
+
+ b3.ToTable("MissionTask");
+
+ b3.WithOwner()
+ .HasForeignKey("PoseMissionTaskId");
+ });
+
+ b2.Navigation("Orientation")
+ .IsRequired();
+
+ b2.Navigation("Position")
+ .IsRequired();
+ });
+
+ b1.Navigation("InspectionTarget")
+ .IsRequired();
+
+ b1.Navigation("Inspections");
+
+ b1.Navigation("RobotPose")
+ .IsRequired();
+ });
+
+ b.Navigation("Area");
+
+ b.Navigation("Map");
+
+ b.Navigation("Robot");
+
+ b.Navigation("Tasks");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Plant", b =>
+ {
+ b.HasOne("Api.Database.Models.Installation", "Installation")
+ .WithMany()
+ .HasForeignKey("InstallationId")
+ .OnDelete(DeleteBehavior.Restrict)
+ .IsRequired();
+
+ b.Navigation("Installation");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Robot", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", "CurrentArea")
+ .WithMany()
+ .HasForeignKey("CurrentAreaId");
+
+ b.HasOne("Api.Database.Models.RobotModel", "Model")
+ .WithMany()
+ .HasForeignKey("ModelId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("RobotId")
+ .HasColumnType("text");
+
+ b1.HasKey("RobotId");
+
+ b1.ToTable("Robots");
+
+ b1.WithOwner()
+ .HasForeignKey("RobotId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseRobotId")
+ .HasColumnType("text");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseRobotId");
+
+ b2.ToTable("Robots");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseRobotId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseRobotId")
+ .HasColumnType("text");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseRobotId");
+
+ b2.ToTable("Robots");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseRobotId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.OwnsMany("Api.Database.Models.VideoStream", "VideoStreams", b1 =>
+ {
+ b1.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b1.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.Property("RobotId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b1.Property("ShouldRotate270Clockwise")
+ .HasColumnType("boolean");
+
+ b1.Property("Type")
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
+
+ b1.Property("Url")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b1.HasKey("Id");
+
+ b1.HasIndex("RobotId");
+
+ b1.ToTable("VideoStream");
+
+ b1.WithOwner()
+ .HasForeignKey("RobotId");
+ });
+
+ b.Navigation("CurrentArea");
+
+ b.Navigation("Model");
+
+ b.Navigation("Pose")
+ .IsRequired();
+
+ b.Navigation("VideoStreams");
+ });
+
+ modelBuilder.Entity("Api.Database.Models.SafePosition", b =>
+ {
+ b.HasOne("Api.Database.Models.Area", null)
+ .WithMany("SafePositions")
+ .HasForeignKey("AreaId");
+
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("SafePositionId")
+ .HasColumnType("text");
+
+ b1.HasKey("SafePositionId");
+
+ b1.ToTable("SafePositions");
+
+ b1.WithOwner()
+ .HasForeignKey("SafePositionId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseSafePositionId")
+ .HasColumnType("text");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseSafePositionId");
+
+ b2.ToTable("SafePositions");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseSafePositionId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseSafePositionId")
+ .HasColumnType("text");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseSafePositionId");
+
+ b2.ToTable("SafePositions");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseSafePositionId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.Navigation("Pose")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Api.Database.Models.Area", b =>
+ {
+ b.Navigation("SafePositions");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs
new file mode 100644
index 000000000..e9d7572aa
--- /dev/null
+++ b/backend/api/Migrations/20231009102654_AddDefaultLocalizationPoseToDeckAndArea.cs
@@ -0,0 +1,176 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Api.Migrations
+{
+ ///
+ public partial class AddDefaultLocalizationPoseToDeckAndArea : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_W",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_X",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_Y",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Orientation_Z",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_X",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_Y",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPose_Position_Z",
+ table: "Areas");
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPoseId",
+ table: "Decks",
+ type: "text",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPoseId",
+ table: "Areas",
+ type: "text",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "DefaultLocalizationPoses",
+ columns: table => new
+ {
+ Id = table.Column(type: "text", nullable: false),
+ Pose_Position_X = table.Column(type: "real", nullable: false),
+ Pose_Position_Y = table.Column(type: "real", nullable: false),
+ Pose_Position_Z = table.Column(type: "real", nullable: false),
+ Pose_Orientation_X = table.Column(type: "real", nullable: false),
+ Pose_Orientation_Y = table.Column(type: "real", nullable: false),
+ Pose_Orientation_Z = table.Column(type: "real", nullable: false),
+ Pose_Orientation_W = table.Column(type: "real", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_DefaultLocalizationPoses", x => x.Id);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Decks_DefaultLocalizationPoseId",
+ table: "Decks",
+ column: "DefaultLocalizationPoseId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Areas_DefaultLocalizationPoseId",
+ table: "Areas",
+ column: "DefaultLocalizationPoseId");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Areas_DefaultLocalizationPoses_DefaultLocalizationPoseId",
+ table: "Areas",
+ column: "DefaultLocalizationPoseId",
+ principalTable: "DefaultLocalizationPoses",
+ principalColumn: "Id");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Decks_DefaultLocalizationPoses_DefaultLocalizationPoseId",
+ table: "Decks",
+ column: "DefaultLocalizationPoseId",
+ principalTable: "DefaultLocalizationPoses",
+ principalColumn: "Id");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Areas_DefaultLocalizationPoses_DefaultLocalizationPoseId",
+ table: "Areas");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Decks_DefaultLocalizationPoses_DefaultLocalizationPoseId",
+ table: "Decks");
+
+ migrationBuilder.DropTable(
+ name: "DefaultLocalizationPoses");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Decks_DefaultLocalizationPoseId",
+ table: "Decks");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Areas_DefaultLocalizationPoseId",
+ table: "Areas");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPoseId",
+ table: "Decks");
+
+ migrationBuilder.DropColumn(
+ name: "DefaultLocalizationPoseId",
+ table: "Areas");
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_W",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_X",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_Y",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Orientation_Z",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_X",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_Y",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+
+ migrationBuilder.AddColumn(
+ name: "DefaultLocalizationPose_Position_Z",
+ table: "Areas",
+ type: "real",
+ nullable: false,
+ defaultValue: 0f);
+ }
+ }
+}
diff --git a/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs b/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs
index 5c7b28533..6765b25cf 100644
--- a/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs
+++ b/backend/api/Migrations/FlotillaDbContextModelSnapshot.cs
@@ -31,6 +31,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property("DeckId")
.HasColumnType("text");
+ b.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
b.Property("InstallationId")
.IsRequired()
.HasColumnType("text");
@@ -48,6 +51,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("DeckId");
+ b.HasIndex("DefaultLocalizationPoseId");
+
b.HasIndex("InstallationId");
b.HasIndex("PlantId");
@@ -61,6 +66,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("text");
+ b.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
b.Property("InstallationId")
.IsRequired()
.HasColumnType("text");
@@ -76,6 +84,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasKey("Id");
+ b.HasIndex("DefaultLocalizationPoseId");
+
b.HasIndex("InstallationId");
b.HasIndex("PlantId");
@@ -83,6 +93,17 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Decks");
});
+ modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("DefaultLocalizationPoses");
+ });
+
modelBuilder.Entity("Api.Database.Models.Installation", b =>
{
b.Property("Id")
@@ -459,6 +480,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasForeignKey("DeckId")
.OnDelete(DeleteBehavior.Restrict);
+ b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose")
+ .WithMany()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
b.HasOne("Api.Database.Models.Installation", "Installation")
.WithMany()
.HasForeignKey("InstallationId")
@@ -471,72 +496,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
- b.OwnsOne("Api.Database.Models.Pose", "DefaultLocalizationPose", b1 =>
- {
- b1.Property("AreaId")
- .HasColumnType("text");
-
- b1.HasKey("AreaId");
-
- b1.ToTable("Areas");
-
- b1.WithOwner()
- .HasForeignKey("AreaId");
-
- b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
- {
- b2.Property("PoseAreaId")
- .HasColumnType("text");
-
- b2.Property("W")
- .HasColumnType("real");
-
- b2.Property("X")
- .HasColumnType("real");
-
- b2.Property("Y")
- .HasColumnType("real");
-
- b2.Property("Z")
- .HasColumnType("real");
-
- b2.HasKey("PoseAreaId");
-
- b2.ToTable("Areas");
-
- b2.WithOwner()
- .HasForeignKey("PoseAreaId");
- });
-
- b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
- {
- b2.Property("PoseAreaId")
- .HasColumnType("text");
-
- b2.Property("X")
- .HasColumnType("real");
-
- b2.Property("Y")
- .HasColumnType("real");
-
- b2.Property("Z")
- .HasColumnType("real");
-
- b2.HasKey("PoseAreaId");
-
- b2.ToTable("Areas");
-
- b2.WithOwner()
- .HasForeignKey("PoseAreaId");
- });
-
- b1.Navigation("Orientation")
- .IsRequired();
-
- b1.Navigation("Position")
- .IsRequired();
- });
-
b.OwnsOne("Api.Database.Models.MapMetadata", "MapMetadata", b1 =>
{
b1.Property("AreaId")
@@ -619,8 +578,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Navigation("Deck");
- b.Navigation("DefaultLocalizationPose")
- .IsRequired();
+ b.Navigation("DefaultLocalizationPose");
b.Navigation("Installation");
@@ -632,6 +590,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("Api.Database.Models.Deck", b =>
{
+ b.HasOne("Api.Database.Models.DefaultLocalizationPose", "DefaultLocalizationPose")
+ .WithMany()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
b.HasOne("Api.Database.Models.Installation", "Installation")
.WithMany()
.HasForeignKey("InstallationId")
@@ -644,11 +606,85 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
+ b.Navigation("DefaultLocalizationPose");
+
b.Navigation("Installation");
b.Navigation("Plant");
});
+ modelBuilder.Entity("Api.Database.Models.DefaultLocalizationPose", b =>
+ {
+ b.OwnsOne("Api.Database.Models.Pose", "Pose", b1 =>
+ {
+ b1.Property("DefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b1.HasKey("DefaultLocalizationPoseId");
+
+ b1.ToTable("DefaultLocalizationPoses");
+
+ b1.WithOwner()
+ .HasForeignKey("DefaultLocalizationPoseId");
+
+ b1.OwnsOne("Api.Database.Models.Orientation", "Orientation", b2 =>
+ {
+ b2.Property("PoseDefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b2.Property("W")
+ .HasColumnType("real");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseDefaultLocalizationPoseId");
+
+ b2.ToTable("DefaultLocalizationPoses");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseDefaultLocalizationPoseId");
+ });
+
+ b1.OwnsOne("Api.Database.Models.Position", "Position", b2 =>
+ {
+ b2.Property("PoseDefaultLocalizationPoseId")
+ .HasColumnType("text");
+
+ b2.Property("X")
+ .HasColumnType("real");
+
+ b2.Property("Y")
+ .HasColumnType("real");
+
+ b2.Property("Z")
+ .HasColumnType("real");
+
+ b2.HasKey("PoseDefaultLocalizationPoseId");
+
+ b2.ToTable("DefaultLocalizationPoses");
+
+ b2.WithOwner()
+ .HasForeignKey("PoseDefaultLocalizationPoseId");
+ });
+
+ b1.Navigation("Orientation")
+ .IsRequired();
+
+ b1.Navigation("Position")
+ .IsRequired();
+ });
+
+ b.Navigation("Pose")
+ .IsRequired();
+ });
+
modelBuilder.Entity("Api.Database.Models.MissionDefinition", b =>
{
b.HasOne("Api.Database.Models.Area", "Area")