From a09aac7aa5db8c219900f9e98132120fcbd175af Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Tue, 24 Oct 2023 08:07:03 -0700 Subject: [PATCH] [uss_qualifier] Use FlightInfoTemplate for flight intent storage (#276) * Use FlightInfoTemplate for flight intent storage * Address comments --- .../flight_planning/flight_info_template.py | 56 + monitoring/monitorlib/geotemporal.py | 3 +- monitoring/monitorlib/uspace.py | 12 +- .../dev/f3548_self_contained.yaml | 2 +- .../configurations/dev/library/resources.yaml | 30 +- .../flight_planning/flight_intent.py | 84 +- .../flight_intents_resource.py | 70 +- .../uss_qualifier/resources/overrides.py | 14 +- .../flight_intent_validation.md | 5 +- .../flight_intent_validation.py | 5 +- .../conflict_equal_priority_not_permitted.md | 7 +- .../conflict_equal_priority_not_permitted.py | 5 +- .../conflict_higher_priority.md | 5 +- .../conflict_higher_priority.py | 5 +- .../uspace/flight_auth/validation.py | 3 +- .../flight_intents/conflicting_flights.json | 1041 ----------------- .../flight_intents/conflicting_flights.yaml | 210 ++++ .../flight_intents/invalid_flight_auths.json | 138 --- .../flight_intents/invalid_flight_auths.yaml | 62 + .../invalid_flight_intents.yaml | 162 +-- .../test_data/make_flight_intent_kml.py | 230 ++++ .../flight_intents/conflicting_flights.yaml | 122 -- .../invalid_flight_intents.yaml | 117 -- .../flight_intents/priority_preemption.yaml | 238 ---- 24 files changed, 744 insertions(+), 1882 deletions(-) delete mode 100644 monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.json create mode 100644 monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.yaml delete mode 100644 monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.json create mode 100644 monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.yaml create mode 100644 monitoring/uss_qualifier/test_data/make_flight_intent_kml.py delete mode 100644 monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/conflicting_flights.yaml delete mode 100644 monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/invalid_flight_intents.yaml delete mode 100644 monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/priority_preemption.yaml diff --git a/monitoring/monitorlib/clients/flight_planning/flight_info_template.py b/monitoring/monitorlib/clients/flight_planning/flight_info_template.py index eb8ffd4819..a46c7dec2d 100644 --- a/monitoring/monitorlib/clients/flight_planning/flight_info_template.py +++ b/monitoring/monitorlib/clients/flight_planning/flight_info_template.py @@ -13,6 +13,7 @@ FlightInfo, ) from monitoring.monitorlib.geotemporal import Volume4DTemplate, resolve_volume4d +from uas_standards.interuss.automated_testing.scd.v1 import api as scd_api class BasicFlightPlanInformationTemplate(ImplicitDict): @@ -51,3 +52,58 @@ def resolve(self, start_of_test: datetime) -> FlightInfo: kwargs = {k: v for k, v in self.items()} kwargs["basic_information"] = self.basic_information.resolve(start_of_test) return ImplicitDict.parse(kwargs, FlightInfo) + + def scd_inject_request( + self, start_of_test: datetime + ) -> scd_api.InjectFlightRequest: + """Render a legacy SCD injection API request object from this object.""" + + info = self.resolve(start_of_test) + if "astm_f3548_21" not in info or not info.astm_f3548_21: + raise ValueError( + f"Legacy SCD injection API requires astm_f3548_21 operational intent priority to be specified in FlightInfo" + ) + if ( + "uspace_flight_authorisation" not in info + or not info.uspace_flight_authorisation + ): + raise ValueError( + f"Legacy SCD injection API requires uspace_flight_authorisation to be specified in FlightInfo" + ) + volumes = [v.to_interuss_scd_api() for v in info.basic_information.area] + if info.basic_information.usage_state == AirspaceUsageState.Planned: + state = scd_api.OperationalIntentState.Accepted + off_nominal_volumes = [] + elif info.basic_information.usage_state == AirspaceUsageState.InUse: + if info.basic_information.uas_state == UasState.Nominal: + state = scd_api.OperationalIntentState.Activated + off_nominal_volumes = [] + elif info.basic_information.uas_state == UasState.OffNominal: + state = scd_api.OperationalIntentState.Nonconforming + off_nominal_volumes = volumes + volumes = [] + elif info.basic_information.uas_state == UasState.Contingent: + state = scd_api.OperationalIntentState.Contingent + off_nominal_volumes = volumes + volumes = [] + else: + raise ValueError( + f"Unrecognized uas_state '{info.basic_information.uas_state}'" + ) + else: + raise ValueError( + f"Unrecognized usage_state '{info.basic_information.usage_state}'" + ) + operational_intent = scd_api.OperationalIntentTestInjection( + state=state, + priority=scd_api.Priority(info.astm_f3548_21.priority), + volumes=volumes, + off_nominal_volumes=off_nominal_volumes, + ) + flight_authorisation = ImplicitDict.parse( + info.uspace_flight_authorisation, scd_api.FlightAuthorisationData + ) + return scd_api.InjectFlightRequest( + operational_intent=operational_intent, + flight_authorisation=flight_authorisation, + ) diff --git a/monitoring/monitorlib/geotemporal.py b/monitoring/monitorlib/geotemporal.py index a9f648b7b7..a7c00018a1 100644 --- a/monitoring/monitorlib/geotemporal.py +++ b/monitoring/monitorlib/geotemporal.py @@ -10,12 +10,11 @@ from implicitdict import ImplicitDict, StringBasedTimeDelta, StringBasedDateTime from pvlib.solarposition import get_solarposition import s2sphere as s2sphere -from uas_standards.astm.f3411.v22a.api import Polygon from uas_standards.astm.f3548.v21 import api as f3548v21 from uas_standards.interuss.automated_testing.scd.v1 import api as interuss_scd_api from monitoring.monitorlib import geo -from monitoring.monitorlib.geo import LatLngPoint, Circle, Altitude, Volume3D +from monitoring.monitorlib.geo import LatLngPoint, Circle, Altitude, Volume3D, Polygon class OffsetTime(ImplicitDict): diff --git a/monitoring/monitorlib/uspace.py b/monitoring/monitorlib/uspace.py index 28ccc4a144..ed4464112f 100644 --- a/monitoring/monitorlib/uspace.py +++ b/monitoring/monitorlib/uspace.py @@ -1,24 +1,28 @@ from typing import List from urllib.parse import urlparse -from uas_standards.interuss.automated_testing.scd.v1 import api as scd_injection_api +from monitoring.monitorlib.clients.flight_planning.flight_info import ( + FlightAuthorisationData, + UASClass, + FlightAuthorisationDataOperationCategory, +) from uas_standards.ansi_cta_2063_a import SerialNumber from uas_standards.en4709_02 import OperatorRegistrationNumber def problems_with_flight_authorisation( - flight_auth: scd_injection_api.FlightAuthorisationData, + flight_auth: FlightAuthorisationData, ) -> List[str]: problems: List[str] = [] if not SerialNumber(flight_auth.uas_serial_number).valid: problems.append("Invalid serial number") if not OperatorRegistrationNumber(flight_auth.operator_id).valid: problems.append("Invalid operator ID") - if flight_auth.uas_class == scd_injection_api.UASClass.Other: + if flight_auth.uas_class == UASClass.Other: problems.append("Invalid UAS class") if ( flight_auth.operation_category - == scd_injection_api.FlightAuthorisationDataOperationCategory.Unknown + == FlightAuthorisationDataOperationCategory.Unknown ): problems.append("Invalid operation category") if ( diff --git a/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml b/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml index e87ccd0343..5df2d2bcb6 100644 --- a/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml +++ b/monitoring/uss_qualifier/configurations/dev/f3548_self_contained.yaml @@ -53,7 +53,7 @@ v1: specification: planning_time: '0:05:00' file: - path: file://./test_data/che/flight_intents/conflicting_flights.json + path: file://./test_data/che/flight_intents/conflicting_flights.yaml # Details of priority-preemption flights (used in nominal planning priority scenario) priority_preemption_flights: diff --git a/monitoring/uss_qualifier/configurations/dev/library/resources.yaml b/monitoring/uss_qualifier/configurations/dev/library/resources.yaml index bdc07830bd..b3667c5a28 100644 --- a/monitoring/uss_qualifier/configurations/dev/library/resources.yaml +++ b/monitoring/uss_qualifier/configurations/dev/library/resources.yaml @@ -117,7 +117,7 @@ che_invalid_flight_auth_flights: specification: planning_time: '0:05:00' file: - path: file://./test_data/che/flight_intents/invalid_flight_auths.json + path: file://./test_data/che/flight_intents/invalid_flight_auths.yaml che_conflicting_flights: # Includes flight intents for both equal-priority-not-permitted and higher-priority @@ -126,9 +126,9 @@ che_conflicting_flights: specification: planning_time: '0:05:00' file: - path: file://./test_data/che/flight_intents/conflicting_flights.json + path: file://./test_data/che/flight_intents/conflicting_flights.yaml # Note that this hash_sha512 field can be safely deleted if the content changes - hash_sha512: 6467e88fb69702216dabe1f9723b68fe68a1a9d4b1a40e3af5c0b1ed233061a088c9c30be8a0ada447b18f2c6354db52d84aa12c1e7dfd13f99262d91ba173f4 + hash_sha512: 86b7172de3a6029efdb5c39dff00f96578f81d25b65b4a0a9d731a42a1e260ef632a0891b744b6d1f62fd7bec61cdad3cb8e6b6811a16cbc17ec2dbd081cbbf6 che_invalid_flight_intents: $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json @@ -138,30 +138,6 @@ che_invalid_flight_intents: file: path: test_data.che.flight_intents.invalid_flight_intents -kentland_conflicting_flights: - $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file: - path: file://./test_data/usa/kentland/flight_intents/conflicting_flights.yaml - -kentland_priority_preemption_flights: - $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file: - path: test_data.usa.kentland.flight_intents.priority_preemption - -kentland_invalid_flight_intents: - $content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json - resource_type: resources.flight_planning.FlightIntentsResource - specification: - planning_time: '0:05:00' - file: - path: test_data.usa.kentland.flight_intents.invalid_flight_intents - # ===== General flight authorization ===== example_flight_check_table: diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py b/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py index cf04dcf550..1aaf78d06c 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_intent.py @@ -1,24 +1,40 @@ +from __future__ import annotations + +import json from typing import Optional, Dict -from implicitdict import ImplicitDict, StringBasedDateTime, StringBasedTimeDelta +import arrow + +from implicitdict import ImplicitDict, StringBasedDateTime +from monitoring.monitorlib.clients.flight_planning.flight_info_template import ( + FlightInfoTemplate, +) -from monitoring.uss_qualifier.fileio import FileReference from monitoring.uss_qualifier.resources.files import ExternalFile +from monitoring.uss_qualifier.resources.overrides import apply_overrides from uas_standards.interuss.automated_testing.scd.v1.api import InjectFlightRequest class FlightIntent(ImplicitDict): + """DEPRECATED. Use FlightInfoTemplate instead.""" + reference_time: StringBasedDateTime """The time that all other times in the FlightInjectionAttempt are relative to. If this FlightInjectionAttempt is initiated by uss_qualifier at t_test, then each t_volume_original timestamp within test_injection should be adjusted to t_volume_adjusted such that t_volume_adjusted = t_test + planning_time when t_volume_original = reference_time""" request: InjectFlightRequest """Definition of the flight the user wants to create.""" + @staticmethod + def from_flight_info_template(info_template: FlightInfoTemplate) -> FlightIntent: + t = arrow.utcnow().datetime + request = info_template.scd_inject_request(t) + return FlightIntent(reference_time=StringBasedDateTime(t), request=request) + FlightIntentID = str -"""Identifier for a flight intent within a collection of flight intents. +"""Identifier for a flight planning intent within a collection of flight planning intents. -To be used only within uss_qualifier (not visible to participants under test) to select an appropriate flight intent from the collection.""" +To be used only within uss_qualifier (not visible to participants under test) to select an appropriate flight planning intent from the collection.""" class DeltaFlightIntent(ImplicitDict): @@ -28,29 +44,71 @@ class DeltaFlightIntent(ImplicitDict): """Base the flight intent for this element of a FlightIntentCollection on the element of the collection identified by this field.""" mutation: Optional[dict] - """For each subfield specified in this object, override the value in the corresponding subfield of the flight intent for this element with the specified value.""" + """For each leaf subfield specified in this object, override the value in the corresponding subfield of the flight intent for this element with the specified value. + + Consider subfields prefixed with + as leaf subfields.""" class FlightIntentCollectionElement(ImplicitDict): """Definition of a single flight intent within a FlightIntentCollection. Exactly one field must be specified.""" - full: Optional[FlightIntent] - """If specified, the full definition of the flight intent.""" + full: Optional[FlightInfoTemplate] + """If specified, the full definition of the flight planning intent.""" delta: Optional[DeltaFlightIntent] - """If specified, a flight intent based on another flight intent, but with some changes.""" + """If specified, a flight planning intent based on another flight intent, but with some changes.""" class FlightIntentCollection(ImplicitDict): """Specification for a collection of flight intents, each identified by a FlightIntentID.""" intents: Dict[FlightIntentID, FlightIntentCollectionElement] - """Flights that users want to create.""" + """Flight planning actions that users want to perform.""" + + def resolve(self) -> Dict[FlightIntentID, FlightInfoTemplate]: + """Resolve the underlying delta flight intents.""" + + # process intents in order of dependency to resolve deltas + processed_intents: Dict[FlightIntentID, FlightInfoTemplate] = {} + unprocessed_intent_ids = list(self.intents.keys()) + + while unprocessed_intent_ids: + nb_processed = 0 + for intent_id in unprocessed_intent_ids: + unprocessed_intent = self.intents[intent_id] + processed_intent: FlightInfoTemplate + + # copy intent and resolve delta + if unprocessed_intent.has_field_with_value("full"): + processed_intent = ImplicitDict.parse( + json.loads(json.dumps(unprocessed_intent.full)), + FlightInfoTemplate, + ) + elif unprocessed_intent.has_field_with_value("delta"): + if unprocessed_intent.delta.source not in processed_intents: + # delta source has not been processed yet + continue + + processed_intent = apply_overrides( + processed_intents[unprocessed_intent.delta.source], + unprocessed_intent.delta.mutation, + ) + else: + raise ValueError(f"{intent_id} is invalid") + + nb_processed += 1 + processed_intents[intent_id] = processed_intent + unprocessed_intent_ids.remove(intent_id) + + if nb_processed == 0 and unprocessed_intent_ids: + raise ValueError( + "Unresolvable dependency detected between intents: " + + ", ".join(i_id for i_id in unprocessed_intent_ids) + ) + + return processed_intents class FlightIntentsSpecification(ImplicitDict): - planning_time: StringBasedTimeDelta - """Time delta between the time uss_qualifier initiates this FlightInjectionAttempt and when a timestamp within the test_injection equal to reference_time occurs""" - file: ExternalFile - """Location of file to load""" + """Location of file to load, containing a FlightIntentCollection""" diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py b/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py index 8655334f99..8d5ab9c145 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_intents_resource.py @@ -1,85 +1,27 @@ -from datetime import timedelta import json from typing import Dict -import arrow -from implicitdict import ImplicitDict, StringBasedDateTime +from implicitdict import ImplicitDict +from monitoring.monitorlib.clients.flight_planning.flight_info_template import ( + FlightInfoTemplate, +) from monitoring.uss_qualifier.resources.files import load_dict -from monitoring.uss_qualifier.resources.overrides import apply_overrides from monitoring.uss_qualifier.resources.resource import Resource from monitoring.uss_qualifier.resources.flight_planning.flight_intent import ( FlightIntentCollection, FlightIntentsSpecification, - FlightIntent, FlightIntentID, ) class FlightIntentsResource(Resource[FlightIntentsSpecification]): - _planning_time: timedelta _intent_collection: FlightIntentCollection def __init__(self, specification: FlightIntentsSpecification): self._intent_collection = ImplicitDict.parse( load_dict(specification.file), FlightIntentCollection ) - self._planning_time = specification.planning_time.timedelta - - def get_flight_intents(self) -> Dict[FlightIntentID, FlightIntent]: - """Resolve the underlying delta flight intents and shift appropriately times.""" - - # process intents in order of dependency to resolve deltas - processed_intents: Dict[FlightIntentID, FlightIntent] = {} - unprocessed_intent_ids = list(self._intent_collection.intents.keys()) - - while unprocessed_intent_ids: - nb_processed = 0 - for intent_id in unprocessed_intent_ids: - unprocessed_intent = self._intent_collection.intents[intent_id] - processed_intent: FlightIntent - - # copy intent and resolve delta - if unprocessed_intent.has_field_with_value("full"): - processed_intent = ImplicitDict.parse( - json.loads(json.dumps(unprocessed_intent.full)), FlightIntent - ) - elif unprocessed_intent.has_field_with_value("delta"): - if unprocessed_intent.delta.source not in processed_intents: - # delta source has not been processed yet - continue - - processed_intent = apply_overrides( - processed_intents[unprocessed_intent.delta.source], - unprocessed_intent.delta.mutation, - ) - else: - raise ValueError(f"{intent_id} is invalid") - - nb_processed += 1 - processed_intents[intent_id] = processed_intent - unprocessed_intent_ids.remove(intent_id) - - if nb_processed == 0 and unprocessed_intent_ids: - raise ValueError( - "Unresolvable dependency detected between intents: " - + ", ".join(i_id for i_id in unprocessed_intent_ids) - ) - - # shift times - t0 = arrow.utcnow() + self._planning_time - - for intent_id, intent in processed_intents.items(): - dt = t0 - intent.reference_time.datetime - for volume in ( - intent.request.operational_intent.volumes - + intent.request.operational_intent.off_nominal_volumes - ): - volume.time_start.value = StringBasedDateTime( - volume.time_start.value.datetime + dt - ) - volume.time_end.value = StringBasedDateTime( - volume.time_end.value.datetime + dt - ) - return processed_intents + def get_flight_intents(self) -> Dict[FlightIntentID, FlightInfoTemplate]: + return self._intent_collection.resolve() diff --git a/monitoring/uss_qualifier/resources/overrides.py b/monitoring/uss_qualifier/resources/overrides.py index 60283c95ef..4bb504e089 100644 --- a/monitoring/uss_qualifier/resources/overrides.py +++ b/monitoring/uss_qualifier/resources/overrides.py @@ -37,9 +37,19 @@ def _apply_overrides(base_object, overrides): return result_list elif isinstance(overrides, dict): - result = ImplicitDict.parse(base_object, type(base_object)) + if isinstance(base_object, dict): + result = {k: v for k, v in base_object.items()} + else: + raise ValueError( + f"Attempted to override field with type {type(base_object)} with type {type(overrides)} ({json.dumps(base_object)} -> {json.dumps(overrides)})" + ) for field in overrides: - if field in base_object and base_object[field] is not None: + if field.startswith("+"): + replace = True + field = field[1:] + else: + replace = False + if field in base_object and base_object[field] is not None and not replace: result[field] = _apply_overrides(base_object[field], overrides[field]) else: result[field] = overrides[field] diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.md b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.md index d35466b351..fe98dbc53c 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.md @@ -18,9 +18,8 @@ FlightIntentsResource that provides the following flight intents: - `valid_conflict_tiny_overlap`: volumes mutation: has a volume that overlaps with `valid_op_intent` just above IntersectionMinimumPrecision = 1cm in a way that must result as a conflict Because the scenario involves activation of intents, all activated intents must be active during the execution of the -test scenario, i.e. they must start before the reference time plus planning time duration. Additionally, their end time -must leave sufficient time for the execution of the test scenario. For the sake of simplicity, it is recommended to set -the start and end times of all the intents to the same range. +test scenario. Additionally, their end time must leave sufficient time for the execution of the test scenario. For the +sake of simplicity, it is recommended to set the start and end times of all the intents to the same range. ### tested_uss FlightPlannerResource that will be tested for its validation of operational intents. diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py index 733ff43461..f97af01bda 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/flight_intent_validation/flight_intent_validation.py @@ -58,7 +58,10 @@ def __init__( self.tested_uss = tested_uss.flight_planner self.dss = dss.dss - _flight_intents = flight_intents.get_flight_intents() + _flight_intents = { + k: FlightIntent.from_flight_info_template(v) + for k, v in flight_intents.get_flight_intents().items() + } extents = [] for intent in _flight_intents.values(): diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.md b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.md index 323af0aab3..aab2519386 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.md @@ -21,7 +21,7 @@ Otherwise, the FlightIntentsResource must provide the following flight intents: - < + @@ -76,9 +76,8 @@ Otherwise, the FlightIntentsResource must provide the following flight intents:
Flight intent IDFlight intent ID Flight name Priority State
Because the scenario involves activation of intents, all activated intents must be active during the execution of the -test scenario, i.e. they must start before the reference time plus planning time duration. Additionally, their end time -must leave sufficient time for the execution of the test scenario. For the sake of simplicity, it is recommended to set -the start and end times of all the intents to the same range. +test scenario. Additionally, their end time must leave sufficient time for the execution of the test scenario. For the +sake of simplicity, it is recommended to set the start and end times of all the intents to the same range. ### tested_uss FlightPlannerResource that is under test and will manage flight 1. diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py index b25af16ffc..1d7dd6fdbd 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py @@ -84,7 +84,10 @@ def __init__( ) raise ScenarioCannotContinueError(msg) - _flight_intents = flight_intents.get_flight_intents() + _flight_intents = { + k: FlightIntent.from_flight_info_template(v) + for k, v in flight_intents.get_flight_intents().items() + } extents = [] for intent in _flight_intents.values(): diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.md b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.md index debfc437a0..3c9bd1dbad 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.md +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.md @@ -74,9 +74,8 @@ FlightIntentsResource that provides the following flight intents: Because the scenario involves activation of intents, all activated intents must be active during the execution of the -test scenario, i.e. they must start before the reference time plus planning time duration. Additionally, their end time -must leave sufficient time for the execution of the test scenario. For the sake of simplicity, it is recommended to set -the start and end times of all the intents to the same range. +test scenario. Additionally, their end time must leave sufficient time for the execution of the test scenario. For the +sake of simplicity, it is recommended to set the start and end times of all the intents to the same range. ### tested_uss FlightPlannerResource that is under test and will manage flight 1. diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py index d660ae127f..0aa29e08d5 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_higher_priority/conflict_higher_priority.py @@ -75,7 +75,10 @@ def __init__( self.control_uss = control_uss.flight_planner self.dss = dss.dss - _flight_intents = flight_intents.get_flight_intents() + _flight_intents = { + k: FlightIntent.from_flight_info_template(v) + for k, v in flight_intents.get_flight_intents().items() + } extents = [] for intent in _flight_intents.values(): diff --git a/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py b/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py index 4adecdda32..8a362342d1 100644 --- a/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py +++ b/monitoring/uss_qualifier/scenarios/uspace/flight_auth/validation.py @@ -46,7 +46,8 @@ def __init__( ) self.invalid_flight_intents = [] - for fID, flight_intent in intents.items(): + for fID, info_template in intents.items(): + flight_intent = FlightIntent.from_flight_info_template(info_template) problems = problems_with_flight_authorisation( flight_intent.request.flight_authorisation ) diff --git a/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.json b/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.json deleted file mode 100644 index dbeb97d9a1..0000000000 --- a/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.json +++ /dev/null @@ -1,1041 +0,0 @@ -{ - "intents": { - "flight_1_planned_vol_A": { - "full": { - "reference_time": "2023-02-12T10:34:14.483425+00:00", - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 7.477423822749622, - "lat": 46.97491999984008 - }, - { - "lng": 7.477423821039847, - "lat": 46.97538499982026 - }, - { - "lng": 7.477424770457274, - "lat": 46.97539822817162 - }, - { - "lng": 7.477427609667229, - "lat": 46.975411329130466 - }, - { - "lng": 7.477432311328011, - "lat": 46.975424176527724 - }, - { - "lng": 7.477438830161459, - "lat": 46.97543664663613 - }, - { - "lng": 7.477447103388957, - "lat": 46.975448619361856 - }, - { - "lng": 7.477457051335981, - "lat": 46.975459979401066 - }, - { - "lng": 7.477468578199379, - "lat": 46.97547061735031 - }, - { - "lng": 7.477481572969964, - "lat": 46.97548043076024 - }, - { - "lng": 7.4774959105015855, - "lat": 46.97548932512221 - }, - { - "lng": 7.477511452716338, - "lat": 46.97549721477847 - }, - { - "lng": 7.47752804993433, - "lat": 46.97550402374711 - }, - { - "lng": 7.477545542315188, - "lat": 46.975509686453854 - }, - { - "lng": 7.477563761397435, - "lat": 46.97551414836356 - }, - { - "lng": 7.477582531720886, - "lat": 46.9755173665054 - }, - { - "lng": 7.477601672516463, - "lat": 46.975519309886806 - }, - { - "lng": 7.477620999447144, - "lat": 46.97551995979184 - }, - { - "lng": 7.478057000544437, - "lat": 46.97551995980457 - }, - { - "lng": 7.478076327475301, - "lat": 46.975519309900726 - }, - { - "lng": 7.478095468271412, - "lat": 46.97551736652059 - }, - { - "lng": 7.478114238595763, - "lat": 46.97551414838003 - }, - { - "lng": 7.478132457679282, - "lat": 46.97550968647161 - }, - { - "lng": 7.478149950061773, - "lat": 46.97550402376608 - }, - { - "lng": 7.478166547281737, - "lat": 46.97549721479852 - }, - { - "lng": 7.4781820894987705, - "lat": 46.97548932514323 - }, - { - "lng": 7.478196427032943, - "lat": 46.97548043078203 - }, - { - "lng": 7.478209421806301, - "lat": 46.97547061737267 - }, - { - "lng": 7.478220948672645, - "lat": 46.975459979423775 - }, - { - "lng": 7.478230896622737, - "lat": 46.97544861938469 - }, - { - "lng": 7.4782391698533655, - "lat": 46.97543664665883 - }, - { - "lng": 7.4782456886899595, - "lat": 46.975424176550064 - }, - { - "lng": 7.4782503903538515, - "lat": 46.97541132915219 - }, - { - "lng": 7.478253229566841, - "lat": 46.97539822819251 - }, - { - "lng": 7.478254178987183, - "lat": 46.975384999840095 - }, - { - "lng": 7.478254177277408, - "lat": 46.974919999820244 - }, - { - "lng": 7.478253227761765, - "lat": 46.97490677142331 - }, - { - "lng": 7.4782503884602685, - "lat": 46.97489367042681 - }, - { - "lng": 7.4782456867183855, - "lat": 46.97488082300081 - }, - { - "lng": 7.478239167817867, - "lat": 46.974868352873266 - }, - { - "lng": 7.478230894540598, - "lat": 46.974856380138455 - }, - { - "lng": 7.478220946563947, - "lat": 46.974845020100375 - }, - { - "lng": 7.478209419693374, - "lat": 46.974834382162385 - }, - { - "lng": 7.47819642493976, - "lat": 46.974824568773556 - }, - { - "lng": 7.4781820874502785, - "lat": 46.97481567444202 - }, - { - "lng": 7.478166545303149, - "lat": 46.97480778482489 - }, - { - "lng": 7.478149948177879, - "lat": 46.9748009759033 - }, - { - "lng": 7.4781324559137685, - "lat": 46.97479531325065 - }, - { - "lng": 7.478114236970597, - "lat": 46.97479085140123 - }, - { - "lng": 7.478095466806278, - "lat": 46.9747876333249 - }, - { - "lng": 7.478076326187155, - "lat": 46.97478569001336 - }, - { - "lng": 7.478056999447158, - "lat": 46.974785040181715 - }, - { - "lng": 7.477621000544429, - "lat": 46.97478504019445 - }, - { - "lng": 7.477601673804613, - "lat": 46.974785690027296 - } - ] - }, - "altitude_lower": { - "value": 605.0, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 635.0, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2023-02-12T10:27:14.483425+00:00", - "format": "RFC3339" - }, - "time_end": { - "value": "2023-02-12T10:52:14.483425+00:00", - "format": "RFC3339" - } - } - ], - "state": "Accepted", - "off_nominal_volumes": [], - "priority": 0 - }, - "flight_authorisation": { - "uas_serial_number": "1AF49UL5CC5J6K", - "operation_category": "Open", - "operation_mode": "Vlos", - "uas_class": "C0", - "identification_technologies": [ - "ASTMNetRID" - ], - "connectivity_methods": [ - "cellular" - ], - "endurance_minutes": 30, - "emergency_procedure_url": "https://example.interussplatform.org/emergency", - "operator_id": "CHEo5kut30e0mt01-qwe", - "uas_id": "", - "uas_type_certificate": "" - } - } - } - }, - "flight_1_activated_vol_A": { - "delta": { - "source": "flight_1_planned_vol_A", - "mutation": { - "request": { - "operational_intent": { - "state": "Activated" - } - } - } - } - }, - "flight_1_planned_vol_A_extended": { - "delta": { - "source": "flight_1_planned_vol_A", - "mutation": { - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "altitude_lower": { - "value": 575.0 - } - } - } - ] - } - } - } - } - }, - "flight_1_activated_vol_A_extended": { - "delta": { - "source": "flight_1_planned_vol_A_extended", - "mutation": { - "request": { - "operational_intent": { - "state": "Activated" - } - } - } - } - }, - "flight_1_planned_vol_B": { - "delta": { - "source": "flight_1_planned_vol_A", - "mutation": { - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "altitude_lower": { - "value": 650.0 - }, - "altitude_upper": { - "value": 705.0 - } - } - } - ] - } - } - } - } - }, - "flight_1_activated_vol_B": { - "delta": { - "source": "flight_1_planned_vol_B", - "mutation": { - "request": { - "operational_intent": { - "state": "Activated" - } - } - } - } - }, - "flight_2_planned_vol_A": { - "full": { - "reference_time": "2023-02-12T10:34:14.483425+00:00", - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 7.474315728091042, - "lat": 46.97716400145211 - }, - { - "lng": 7.474303247689658, - "lat": 46.97717412304557 - }, - { - "lng": 7.474292276891787, - "lat": 46.9771850331586 - }, - { - "lng": 7.474282921352688, - "lat": 46.97719662672131 - }, - { - "lng": 7.474275271172041, - "lat": 46.97720879208173 - }, - { - "lng": 7.474269400026217, - "lat": 46.97722141208117 - }, - { - "lng": 7.4742653644586845, - "lat": 46.977234365182404 - }, - { - "lng": 7.474263203335437, - "lat": 46.97724752664021 - }, - { - "lng": 7.474262937470636, - "lat": 46.97726076970267 - }, - { - "lng": 7.474264569426098, - "lat": 46.97727396683188 - }, - { - "lng": 7.47426808348659, - "lat": 46.97728699093222 - }, - { - "lng": 7.474273445811106, - "lat": 46.97729971657432 - }, - { - "lng": 7.474280604758724, - "lat": 46.97731202120303 - }, - { - "lng": 7.4742894913859015, - "lat": 46.97732378631779 - }, - { - "lng": 7.47430002011039, - "lat": 46.977334898613684 - }, - { - "lng": 7.474312089535409, - "lat": 46.97734525107282 - }, - { - "lng": 7.4743255834261335, - "lat": 46.97735474399491 - }, - { - "lng": 7.47434037182908, - "lat": 46.977363285957416 - }, - { - "lng": 7.474356312323634, - "lat": 46.97737079469613 - }, - { - "lng": 7.47437325139364, - "lat": 46.977377197897326 - }, - { - "lng": 7.474391025905868, - "lat": 46.97738243389426 - }, - { - "lng": 7.474409464681103, - "lat": 46.977386452261086 - }, - { - "lng": 7.474428390142731, - "lat": 46.97738921429845 - }, - { - "lng": 7.4744476200269405, - "lat": 46.97739069340619 - }, - { - "lng": 7.474466969138073, - "lat": 46.97739087533958 - }, - { - "lng": 7.474486251132214, - "lat": 46.97738975834647 - }, - { - "lng": 7.474505280311834, - "lat": 46.97738735318418 - }, - { - "lng": 7.47452387341421, - "lat": 46.97738368301589 - }, - { - "lng": 7.474541851376407, - "lat": 46.97737878318756 - }, - { - "lng": 7.474559041059788, - "lat": 46.97737270088755 - }, - { - "lng": 7.474575276917473, - "lat": 46.9773654946921 - }, - { - "lng": 7.474590402588685, - "lat": 46.977357234001225 - }, - { - "lng": 7.474604272404609, - "lat": 46.97734799837037 - }, - { - "lng": 7.4780602717187445, - "lat": 46.97480899404357 - }, - { - "lng": 7.478072750859629, - "lat": 46.97479887202181 - }, - { - "lng": 7.47808372039712, - "lat": 46.97478796152745 - }, - { - "lng": 7.478093074689058, - "lat": 46.97477636763495 - }, - { - "lng": 7.478100723649223, - "lat": 46.97476420200029 - }, - { - "lng": 7.478106593614889, - "lat": 46.974751581785505 - }, - { - "lng": 7.478110628056212, - "lat": 46.97473862853046 - }, - { - "lng": 7.4781127881205816, - "lat": 46.9747254669823 - }, - { - "lng": 7.478113053006759, - "lat": 46.97471222389403 - }, - { - "lng": 7.478111420165148, - "lat": 46.974699026803876 - }, - { - "lng": 7.478107905322289, - "lat": 46.97468600280696 - }, - { - "lng": 7.478102542329355, - "lat": 46.974673277331334 - }, - { - "lng": 7.478095382836098, - "lat": 46.97466097293006 - }, - { - "lng": 7.478086495793389, - "lat": 46.9746492081009 - }, - { - "lng": 7.478075966789133, - "lat": 46.97463809614524 - }, - { - "lng": 7.47806389722399, - "lat": 46.97462774407688 - }, - { - "lng": 7.478050403334804, - "lat": 46.97461825159139 - }, - { - "lng": 7.4780356150751714, - "lat": 46.97460971010614 - }, - { - "lng": 7.478019674863899, - "lat": 46.97460220187985 - }, - { - "lng": 7.478002736213457, - "lat": 46.97459579922035 - }, - { - "lng": 7.477984962251586, - "lat": 46.97459056378839 - }, - { - "lng": 7.477966524150307, - "lat": 46.974586546003664 - }, - { - "lng": 7.477947599477487, - "lat": 46.974583784559336 - }, - { - "lng": 7.477928370486799, - "lat": 46.97458230604945 - }, - { - "lng": 7.477909022362576, - "lat": 46.974582124712704 - }, - { - "lng": 7.4778897414364325, - "lat": 46.97458324229544 - }, - { - "lng": 7.47787071339284, - "lat": 46.974585648034825 - }, - { - "lng": 7.477852121480946, - "lat": 46.974589318762405 - }, - { - "lng": 7.477834144749823, - "lat": 46.974594219127326 - }, - { - "lng": 7.47781695632419, - "lat": 46.97460030193667 - }, - { - "lng": 7.477800721737151, - "lat": 46.97460750861006 - }, - { - "lng": 7.47778559733606, - "lat": 46.974615769743735 - }, - { - "lng": 7.477771728776835, - "lat": 46.97462500577891 - } - ] - }, - "altitude_lower": { - "value": 605.0, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 635.0, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2023-02-12T10:27:14.483425+00:00", - "format": "RFC3339" - }, - "time_end": { - "value": "2023-02-12T10:52:14.483425+00:00", - "format": "RFC3339" - } - } - ], - "state": "Accepted", - "off_nominal_volumes": [], - "priority": 100 - }, - "flight_authorisation": { - "uas_serial_number": "1AF49UL5CC5J6K", - "operation_category": "Open", - "operation_mode": "Vlos", - "uas_class": "C0", - "identification_technologies": [ - "ASTMNetRID" - ], - "connectivity_methods": [ - "cellular" - ], - "endurance_minutes": 30, - "emergency_procedure_url": "https://example.interussplatform.org/emergency", - "operator_id": "CHEo5kut30e0mt01-qwe", - "uas_id": "", - "uas_type_certificate": "" - } - } - } - }, - "flight_2_activated_vol_A": { - "delta": { - "source": "flight_2_planned_vol_A", - "mutation": { - "request": { - "operational_intent": { - "state": "Activated" - } - } - } - } - }, - "flight_2_activated_vol_B": { - "delta": { - "source": "flight_2_activated_vol_A", - "mutation": { - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "altitude_lower": { - "value": 650.0 - }, - "altitude_upper": { - "value": 705.0 - } - } - } - ] - } - } - } - } - }, - "flight_2_equal_prio_planned_vol_B": { - "delta": { - "source": "flight_2_activated_vol_B", - "mutation": { - "request": { - "operational_intent": { - "state": "Accepted", - "priority": 0 - } - } - } - } - }, - "flight_2_equal_prio_activated_vol_B": { - "delta": { - "source": "flight_2_equal_prio_planned_vol_B", - "mutation": { - "request": { - "operational_intent": { - "state": "Activated" - } - } - } - } - }, - "flight_2_equal_prio_nonconforming_vol_A": { - "delta": { - "source": "flight_2_equal_prio_activated_vol_B", - "mutation": { - "request": { - "operational_intent": { - "state": "Nonconforming", - "off_nominal_volumes": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 7.474315728091042, - "lat": 46.97716400145211 - }, - { - "lng": 7.474303247689658, - "lat": 46.97717412304557 - }, - { - "lng": 7.474292276891787, - "lat": 46.9771850331586 - }, - { - "lng": 7.474282921352688, - "lat": 46.97719662672131 - }, - { - "lng": 7.474275271172041, - "lat": 46.97720879208173 - }, - { - "lng": 7.474269400026217, - "lat": 46.97722141208117 - }, - { - "lng": 7.4742653644586845, - "lat": 46.977234365182404 - }, - { - "lng": 7.474263203335437, - "lat": 46.97724752664021 - }, - { - "lng": 7.474262937470636, - "lat": 46.97726076970267 - }, - { - "lng": 7.474264569426098, - "lat": 46.97727396683188 - }, - { - "lng": 7.47426808348659, - "lat": 46.97728699093222 - }, - { - "lng": 7.474273445811106, - "lat": 46.97729971657432 - }, - { - "lng": 7.474280604758724, - "lat": 46.97731202120303 - }, - { - "lng": 7.4742894913859015, - "lat": 46.97732378631779 - }, - { - "lng": 7.47430002011039, - "lat": 46.977334898613684 - }, - { - "lng": 7.474312089535409, - "lat": 46.97734525107282 - }, - { - "lng": 7.4743255834261335, - "lat": 46.97735474399491 - }, - { - "lng": 7.47434037182908, - "lat": 46.977363285957416 - }, - { - "lng": 7.474356312323634, - "lat": 46.97737079469613 - }, - { - "lng": 7.47437325139364, - "lat": 46.977377197897326 - }, - { - "lng": 7.474391025905868, - "lat": 46.97738243389426 - }, - { - "lng": 7.474409464681103, - "lat": 46.977386452261086 - }, - { - "lng": 7.474428390142731, - "lat": 46.97738921429845 - }, - { - "lng": 7.4744476200269405, - "lat": 46.97739069340619 - }, - { - "lng": 7.474466969138073, - "lat": 46.97739087533958 - }, - { - "lng": 7.474486251132214, - "lat": 46.97738975834647 - }, - { - "lng": 7.474505280311834, - "lat": 46.97738735318418 - }, - { - "lng": 7.47452387341421, - "lat": 46.97738368301589 - }, - { - "lng": 7.474541851376407, - "lat": 46.97737878318756 - }, - { - "lng": 7.474559041059788, - "lat": 46.97737270088755 - }, - { - "lng": 7.474575276917473, - "lat": 46.9773654946921 - }, - { - "lng": 7.474590402588685, - "lat": 46.977357234001225 - }, - { - "lng": 7.474604272404609, - "lat": 46.97734799837037 - }, - { - "lng": 7.4780602717187445, - "lat": 46.97480899404357 - }, - { - "lng": 7.478072750859629, - "lat": 46.97479887202181 - }, - { - "lng": 7.47808372039712, - "lat": 46.97478796152745 - }, - { - "lng": 7.478093074689058, - "lat": 46.97477636763495 - }, - { - "lng": 7.478100723649223, - "lat": 46.97476420200029 - }, - { - "lng": 7.478106593614889, - "lat": 46.974751581785505 - }, - { - "lng": 7.478110628056212, - "lat": 46.97473862853046 - }, - { - "lng": 7.4781127881205816, - "lat": 46.9747254669823 - }, - { - "lng": 7.478113053006759, - "lat": 46.97471222389403 - }, - { - "lng": 7.478111420165148, - "lat": 46.974699026803876 - }, - { - "lng": 7.478107905322289, - "lat": 46.97468600280696 - }, - { - "lng": 7.478102542329355, - "lat": 46.974673277331334 - }, - { - "lng": 7.478095382836098, - "lat": 46.97466097293006 - }, - { - "lng": 7.478086495793389, - "lat": 46.9746492081009 - }, - { - "lng": 7.478075966789133, - "lat": 46.97463809614524 - }, - { - "lng": 7.47806389722399, - "lat": 46.97462774407688 - }, - { - "lng": 7.478050403334804, - "lat": 46.97461825159139 - }, - { - "lng": 7.4780356150751714, - "lat": 46.97460971010614 - }, - { - "lng": 7.478019674863899, - "lat": 46.97460220187985 - }, - { - "lng": 7.478002736213457, - "lat": 46.97459579922035 - }, - { - "lng": 7.477984962251586, - "lat": 46.97459056378839 - }, - { - "lng": 7.477966524150307, - "lat": 46.974586546003664 - }, - { - "lng": 7.477947599477487, - "lat": 46.974583784559336 - }, - { - "lng": 7.477928370486799, - "lat": 46.97458230604945 - }, - { - "lng": 7.477909022362576, - "lat": 46.974582124712704 - }, - { - "lng": 7.4778897414364325, - "lat": 46.97458324229544 - }, - { - "lng": 7.47787071339284, - "lat": 46.974585648034825 - }, - { - "lng": 7.477852121480946, - "lat": 46.974589318762405 - }, - { - "lng": 7.477834144749823, - "lat": 46.974594219127326 - }, - { - "lng": 7.47781695632419, - "lat": 46.97460030193667 - }, - { - "lng": 7.477800721737151, - "lat": 46.97460750861006 - }, - { - "lng": 7.47778559733606, - "lat": 46.974615769743735 - }, - { - "lng": 7.477771728776835, - "lat": 46.97462500577891 - } - ] - }, - "altitude_lower": { - "value": 605.0, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 635.0, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2023-02-12T10:27:14.483425+00:00", - "format": "RFC3339" - }, - "time_end": { - "value": "2023-02-12T10:52:14.483425+00:00", - "format": "RFC3339" - } - } - ] - } - } - } - } - } - } -} diff --git a/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.yaml b/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.yaml new file mode 100644 index 0000000000..b4f295cec5 --- /dev/null +++ b/monitoring/uss_qualifier/test_data/che/flight_intents/conflicting_flights.yaml @@ -0,0 +1,210 @@ +intents: + flight_1_planned_vol_A: + full: + basic_information: + usage_state: Planned + uas_state: Nominal + area: + - outline_polygon: + vertices: + - lng: 7.477419 + lat: 46.974785 + - lng: 7.478261 + lat: 46.974776 + - lng: 7.478263 + lat: 46.975519 + - lng: 7.477415 + lat: 46.975528 + altitude_lower: + value: 605.01 + reference: W84 + units: M + altitude_upper: + value: 635 + reference: W84 + units: M + start_time: + offset_from: + starting_from: + start_of_test: {} + offset: -1s + end_time: + offset_from: + starting_from: + start_of_test: {} + offset: 8m + + astm_f3548_21: + priority: 0 + + uspace_flight_authorisation: + uas_serial_number: 1AF49UL5CC5J6K + operation_category: Open + operation_mode: Vlos + uas_class: C0 + identification_technologies: + - ASTMNetRID + connectivity_methods: + - cellular + endurance_minutes: 30 + emergency_procedure_url: https://example.interussplatform.org/emergency + operator_id: CHEo5kut30e0mt01-qwe + uas_id: '' + uas_type_certificate: '' + + flight_1_activated_vol_A: + delta: + source: flight_1_planned_vol_A + mutation: + basic_information: + usage_state: InUse + area: + - altitude_lower: + value: 605.02 + + flight_1_planned_vol_A_extended: + delta: + source: flight_1_planned_vol_A + mutation: + basic_information: + area: + - outline_polygon: + altitude_lower: + value: 575.03 + + flight_1_planned_vol_B: + delta: + source: flight_1_planned_vol_A + mutation: + basic_information: + area: + - altitude_lower: + value: 650.04 + altitude_upper: + value: 705 + + flight_1_activated_vol_A_extended: + delta: + source: flight_1_planned_vol_A_extended + mutation: + basic_information: + usage_state: InUse + area: + - altitude_lower: + value: 575.05 + + flight_1_activated_vol_B: + delta: + source: flight_1_planned_vol_B + mutation: + basic_information: + usage_state: InUse + area: + - altitude_lower: + value: 650.06 + + flight_2_planned_vol_A: + full: + basic_information: + usage_state: Planned + uas_state: Nominal + area: + - outline_polygon: + vertices: + - lng: 7.477918 + lat: 46.974515 + - lng: 7.478182 + lat: 46.974719 + - lng: 7.474489 + lat: 46.977435 + - lng: 7.474139 + lat: 46.977289 + altitude_lower: + value: 605.07 + reference: W84 + units: M + altitude_upper: + value: 635 + reference: W84 + units: M + start_time: + offset_from: + starting_from: + start_of_test: {} + offset: -1s + end_time: + offset_from: + starting_from: + start_of_test: {} + offset: 8m + + astm_f3548_21: + priority: 100 + + uspace_flight_authorisation: + uas_serial_number: 1AF49UL5CC5J6K + operation_category: Open + operation_mode: Vlos + uas_class: C0 + identification_technologies: + - ASTMNetRID + connectivity_methods: + - cellular + endurance_minutes: 30 + emergency_procedure_url: https://example.interussplatform.org/emergency + operator_id: CHEo5kut30e0mt01-qwe + uas_id: '' + uas_type_certificate: '' + + flight_2_activated_vol_A: + delta: + source: flight_2_planned_vol_A + mutation: + basic_information: + usage_state: InUse + area: + - altitude_lower: + value: 605.08 + + flight_2_activated_vol_B: + delta: + source: flight_2_activated_vol_A + mutation: + basic_information: + area: + - altitude_lower: + value: 650.09 + altitude_upper: + value: 705 + + flight_2_equal_prio_planned_vol_B: + delta: + source: flight_2_activated_vol_B + mutation: + basic_information: + usage_state: Planned + area: + - altitude_lower: + value: 650.10 + astm_f3548_21: + priority: 0 + + flight_2_equal_prio_activated_vol_B: + delta: + source: flight_2_equal_prio_planned_vol_B + mutation: + basic_information: + usage_state: InUse + area: + - altitude_lower: + value: 650.11 + + flight_2_equal_prio_nonconforming_vol_A: + delta: + source: flight_2_equal_prio_activated_vol_B + mutation: + basic_information: + uas_state: OffNominal + area: + - altitude_lower: + value: 605.12 diff --git a/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.json b/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.json deleted file mode 100644 index 2a72a323d3..0000000000 --- a/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "intents": { - "invalid_flight_auth": { - "full": { - "reference_time": "2023-02-12T10:34:14.681217+00:00", - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 7.477504823470508, - "lat": 46.97472299984816 - }, - { - "lng": 7.477504820370851, - "lat": 46.97556599981216 - }, - { - "lng": 7.477505769789705, - "lat": 46.97557922815897 - } - ] - }, - "altitude_lower": { - "value": 605.0, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 635.0, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2023-02-12T10:27:05.359502+00:00", - "format": "RFC3339" - }, - "time_end": { - "value": "2023-02-12T10:52:05.359502+00:00", - "format": "RFC3339" - } - } - ], - "state": "Accepted", - "off_nominal_volumes": [], - "priority": 0 - }, - "flight_authorisation": { - "uas_serial_number": "My serial number", - "operation_category": "Open", - "operation_mode": "Vlos", - "uas_class": "C0", - "identification_technologies": [ - "ASTMNetRID" - ], - "connectivity_methods": [ - "cellular" - ], - "endurance_minutes": 30, - "emergency_procedure_url": "https://example.interussplatform.org/emergency", - "operator_id": "CHEo5kut30e0mt01-qwe" - } - } - } - }, - "valid_flight_auth": { - "full": { - "reference_time": "2023-02-12T10:34:14.681217+00:00", - "request": { - "operational_intent": { - "volumes": [ - { - "volume": { - "outline_polygon": { - "vertices": [ - { - "lng": 7.477504823470508, - "lat": 46.97472299984816 - }, - { - "lng": 7.477504820370851, - "lat": 46.97556599981216 - }, - { - "lng": 7.477505769789705, - "lat": 46.97557922815897 - } - ] - }, - "altitude_lower": { - "value": 605.0, - "reference": "W84", - "units": "M" - }, - "altitude_upper": { - "value": 635.0, - "reference": "W84", - "units": "M" - } - }, - "time_start": { - "value": "2023-02-12T10:27:05.359502+00:00", - "format": "RFC3339" - }, - "time_end": { - "value": "2023-02-12T10:52:05.359502+00:00", - "format": "RFC3339" - } - } - ], - "state": "Accepted", - "off_nominal_volumes": [], - "priority": 0 - }, - "flight_authorisation": { - "uas_serial_number": "1AF49UL5CC5J6K", - "operation_category": "Open", - "operation_mode": "Vlos", - "uas_class": "C0", - "identification_technologies": [ - "ASTMNetRID" - ], - "connectivity_methods": [ - "cellular" - ], - "endurance_minutes": 30, - "emergency_procedure_url": "https://example.interussplatform.org/emergency", - "operator_id": "CHEo5kut30e0mt01-qwe" - } - } - } - } - } -} diff --git a/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.yaml b/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.yaml new file mode 100644 index 0000000000..ad1eb3eb85 --- /dev/null +++ b/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_auths.yaml @@ -0,0 +1,62 @@ +intents: + invalid_flight_auth: + full: + basic_information: + usage_state: Planned + uas_state: Nominal + area: + - outline_polygon: + vertices: + - lng: 7.477504823470508 + lat: 46.97472299984816 + - lng: 7.477504820370851 + lat: 46.97556599981216 + - lng: 7.477505769789705 + lat: 46.97557922815897 + altitude_lower: + value: 605 + reference: W84 + units: M + altitude_upper: + value: 635 + reference: W84 + units: M + start_time: + offset_from: + starting_from: + start_of_test: {} + offset: -1s + duration: 5m + + astm_f3548_21: + priority: 0 + + uspace_flight_authorisation: + uas_serial_number: My serial number + operation_category: Open + operation_mode: Vlos + uas_class: C0 + identification_technologies: + - ASTMNetRID + connectivity_methods: + - cellular + endurance_minutes: 30 + emergency_procedure_url: https://uav.example.com/emergency + operator_id: CHEo5kut30e0mt01-qwe + + valid_flight_auth: + delta: + source: invalid_flight_auth + mutation: + uspace_flight_authorisation: + uas_serial_number: 1AF49UL5CC5J6K + operation_category: Open + operation_mode: Vlos + uas_class: C0 + identification_technologies: + - ASTMNetRID + connectivity_methods: + - cellular + endurance_minutes: 30 + emergency_procedure_url: https://uav.example.com/emergency + operator_id: CHEo5kut30e0mt01-qwe diff --git a/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_intents.yaml b/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_intents.yaml index 31d2e98e7e..f3cb2f07a3 100644 --- a/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_intents.yaml +++ b/monitoring/uss_qualifier/test_data/che/flight_intents/invalid_flight_intents.yaml @@ -1,117 +1,81 @@ intents: valid_flight: full: - reference_time: '2023-02-12T10:34:14.681217+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 46.1929645 - lng: 6.1965395 - - lat: 46.192911 - lng: 6.196423 - - lat: 46.192918 - lng: 6.196678 - altitude_lower: - value: 605 - reference: W84 - units: M - altitude_upper: - value: 635 - reference: W84 - units: M - time_start: - value: '2023-02-12T10:27:05.359502+00:00' - format: RFC3339 - time_end: - value: '2023-02-12T10:52:05.359502+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 0 - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Vlos - uas_class: C0 - identification_technologies: - - ASTMNetRID - connectivity_methods: - - cellular - endurance_minutes: 30 - emergency_procedure_url: https://example.interussplatform.org/emergency - operator_id: CHEo5kut30e0mt01-qwe + basic_information: + usage_state: Planned + uas_state: Nominal + area: + - outline_polygon: + vertices: + - lat: 46.1929645 + lng: 6.1965395 + - lat: 46.192911 + lng: 6.196423 + - lat: 46.192918 + lng: 6.196678 + altitude_lower: + value: 605 + reference: W84 + units: M + altitude_upper: + value: 635 + reference: W84 + units: M + start_time: + offset_from: + starting_from: + start_of_test: {} + offset: -1s + duration: 5m - valid_activated: - delta: - source: valid_flight - mutation: - request: - operational_intent: - state: Activated + astm_f3548_21: + priority: 0 - invalid_accepted_offnominal: - delta: - source: valid_flight - mutation: - request: - operational_intent: - off_nominal_volumes: - - volume: - outline_polygon: - vertices: - - lat: 46.1929645 - lng: 6.1965395 - - lat: 46.192911 - lng: 6.196423 - - lat: 46.192918 - lng: 6.196678 - altitude_lower: - value: 605 - reference: W84 - units: M - altitude_upper: - value: 635 - reference: W84 - units: M - time_start: - value: '2023-02-12T10:27:05.359502+00:00' - format: RFC3339 - time_end: - value: '2023-02-12T10:57:05.359502+00:00' - format: RFC3339 + uspace_flight_authorisation: + uas_serial_number: 1AF49UL5CC5J6K + operation_category: Open + operation_mode: Vlos + uas_class: C0 + identification_technologies: + - ASTMNetRID + connectivity_methods: + - cellular + endurance_minutes: 30 + emergency_procedure_url: https://uav.example.com/emergency + operator_id: CHEo5kut30e0mt01-qwe - invalid_activated_offnominal: + valid_activated: delta: - source: invalid_accepted_offnominal + source: valid_flight mutation: - request: - operational_intent: - state: Activated + basic_information: + usage_state: InUse invalid_too_far_away: delta: source: valid_flight mutation: - # reference time pulled back of 32 days > OiMaxPlanHorizon = 30 days - reference_time: '2023-01-10T10:34:14.681217+00:00' + # 32 days > OiMaxPlanHorizon = 30 days + basic_information: + area: + - start_time: + offset_from: + starting_from: + start_of_test: { } + offset: 32d valid_conflict_tiny_overlap: delta: source: valid_flight mutation: - request: - operational_intent: - volumes: - - volume: - outline_polygon: - # polygon overlaps with polygon of valid_flight, distance between first vertex of each is 1.112cm - vertices: - - lat: 46.1929644 - lng: 6.1965395 - - lat: 46.193236 - lng: 6.196235 - - lat: 46.193174 - lng: 6.196925 + basic_information: + area: + - outline_polygon: + # polygon overlaps with polygon of valid_flight, distance between first vertex of each is 1.112cm + vertices: + - lat: 46.1929644 + lng: 6.1965395 + - lat: 46.193236 + lng: 6.196235 + - lat: 46.193174 + lng: 6.196925 diff --git a/monitoring/uss_qualifier/test_data/make_flight_intent_kml.py b/monitoring/uss_qualifier/test_data/make_flight_intent_kml.py new file mode 100644 index 0000000000..357eef2347 --- /dev/null +++ b/monitoring/uss_qualifier/test_data/make_flight_intent_kml.py @@ -0,0 +1,230 @@ +#!env/bin/python3 + +import argparse +import json +import os +import sys + +import arrow +from loguru import logger +from lxml import etree +from pykml.factory import KML_ElementMaker as kml +from pykml.util import format_xml_with_cdata +import yaml + +from implicitdict import ImplicitDict, StringBasedDateTime +from monitoring.monitorlib.geo import AltitudeDatum, Altitude, DistanceUnits +from monitoring.uss_qualifier.fileio import load_dict_with_references, resolve_filename +from monitoring.uss_qualifier.resources.flight_planning.flight_intent import ( + FlightIntentCollection, +) + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + description="Produce a KML file showing a FlightIntentCollection" + ) + + parser.add_argument( + "flight_intent_collection", + help="Path to file containing FlightIntentCollection (*.yaml or *.json). When using the file system, prefix with file://", + ) + + parser.add_argument( + "--start_of_test", + default=None, + help="When start_of_test should be. Defaults to now.", + ) + + parser.add_argument( + "--geoid_offset", + default=None, + help="Height of the EGM96 geoid above the WGS84 ellipsoid in the area (meters). Can be obtained as 'EGM96' at https://geographiclib.sourceforge.io/cgi-bin/GeoidEval", + ) + + return parser.parse_args() + + +def _altitude_mode_of(altitude: Altitude) -> str: + if altitude.reference == AltitudeDatum.W84: + return "absolute" + else: + raise NotImplementedError( + f"Altitude reference {altitude.reference} not yet supported" + ) + + +def _altitude_value_of(altitude: Altitude) -> float: + if altitude.units == DistanceUnits.M: + return altitude.value + else: + raise NotImplementedError(f"Altitude units {altitude.units} not yet supported") + + +def main() -> int: + args = parse_args() + + path = args.flight_intent_collection + output_path = os.path.splitext(resolve_filename(path))[0] + ".kml" + + start_of_test = StringBasedDateTime(args.start_of_test or arrow.utcnow().datetime) + if args.geoid_offset is None: + logger.warning( + "geoid_offset was not provided. Assuming 0 offset, and this may cause altitude errors of up to tens of meters." + ) + geoid_offset = 0 + else: + geoid_offset = float(args.geoid_offset) + + raw = load_dict_with_references(path) + collection: FlightIntentCollection = ImplicitDict.parse(raw, FlightIntentCollection) + flight_intents = collection.resolve() + + folders = [] + for name, template in flight_intents.items(): + flight_intent = template.resolve(start_of_test.datetime) + non_basic_info = json.loads( + json.dumps( + {k: v for k, v in flight_intent.items() if k != "basic_information"} + ) + ) + description = yaml.dump(non_basic_info) if non_basic_info else None + folder = kml.Folder(kml.name(name)) + basic_info = flight_intent.basic_information + for i, v4 in enumerate(basic_info.area): + if "outline_polygon" in v4.volume and v4.volume.outline_polygon: + # Create placemark + placemark = kml.Placemark( + kml.name(f"{name}: volume {i}"), + kml.styleUrl( + f"#{basic_info.usage_state.value}_{basic_info.uas_state.value}" + ), + ) + if description: + placemark.append(kml.description("
" + description + "
")) + + # Set time range + timespan = None + if "time_start" in v4 and v4.time_start: + timespan = kml.TimeSpan( + kml.begin(v4.time_start.datetime.isoformat()) + ) + if "time_end" in v4 and v4.time_end: + if timespan is None: + timespan = kml.TimeSpan() + timespan.append(kml.end(v4.time_end.datetime.isoformat())) + if timespan is not None: + placemark.append(timespan) + + # Create top and bottom of the volume + vertices = v4.volume.outline_polygon.vertices + lower_coords = [] + upper_coords = [] + alt_lo = _altitude_value_of(v4.volume.altitude_lower) - geoid_offset + alt_hi = _altitude_value_of(v4.volume.altitude_upper) - geoid_offset + for vertex in vertices: + lower_coords.append((vertex.lng, vertex.lat, alt_lo)) + upper_coords.append((vertex.lng, vertex.lat, alt_hi)) + geo = kml.MultiGeometry( + kml.Polygon( + kml.altitudeMode(_altitude_mode_of(v4.volume.altitude_lower)), + kml.outerBoundaryIs( + kml.LinearRing( + kml.coordinates( + " ".join( + ",".join(str(v) for v in c) + for c in lower_coords + ) + ) + ) + ), + ), + kml.Polygon( + kml.altitudeMode(_altitude_mode_of(v4.volume.altitude_upper)), + kml.outerBoundaryIs( + kml.LinearRing( + kml.coordinates( + " ".join( + ",".join(str(v) for v in c) + for c in upper_coords + ) + ) + ) + ), + ), + ) + + # We can only create the sides of the volume if the altitude references are the same + if ( + v4.volume.altitude_lower.reference + == v4.volume.altitude_upper.reference + ): + indices = list(range(len(vertices))) + for i1, i2 in zip(indices, indices[1:] + [0]): + coords = [ + (vertices[i1].lng, vertices[i1].lat, alt_lo), + (vertices[i1].lng, vertices[i1].lat, alt_hi), + (vertices[i2].lng, vertices[i2].lat, alt_hi), + (vertices[i2].lng, vertices[i2].lat, alt_lo), + ] + geo.append( + kml.Polygon( + kml.altitudeMode( + _altitude_mode_of(v4.volume.altitude_lower) + ), + kml.outerBoundaryIs( + kml.LinearRing( + kml.coordinates( + " ".join( + ",".join(str(v) for v in c) + for c in coords + ) + ) + ) + ), + ) + ) + + placemark.append(geo) + folder.append(placemark) + else: + raise NotImplementedError("Volume footprint type not supported") + folders.append(folder) + doc = kml.kml( + kml.Document( + kml.Style( + kml.LineStyle(kml.color("ff00c000"), kml.width(3)), + kml.PolyStyle(kml.color("80808080")), + id="Planned_Nominal", + ), + kml.Style( + kml.LineStyle(kml.color("ff00c000"), kml.width(3)), + kml.PolyStyle(kml.color("8000ff00")), + id="InUse_Nominal", + ), + kml.Style( + kml.LineStyle(kml.color("ff00ffff"), kml.width(5)), + kml.PolyStyle(kml.color("8000ff00")), + id="InUse_OffNominal", + ), + kml.Style( + kml.LineStyle(kml.color("ff0000ff"), kml.width(5)), + kml.PolyStyle(kml.color("8000ff00")), + id="InUse_Contingent", + ), + *folders, + ) + ) + + with open(output_path, "w") as f: + f.write( + etree.tostring(format_xml_with_cdata(doc), pretty_print=True).decode( + "utf-8" + ) + ) + + return os.EX_OK + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/conflicting_flights.yaml b/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/conflicting_flights.yaml deleted file mode 100644 index cf7f2a9794..0000000000 --- a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/conflicting_flights.yaml +++ /dev/null @@ -1,122 +0,0 @@ -intents: - first_flight: - full: - reference_time: '2023-01-01T00:12:00+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19330428406196 - lng: -80.59314014213832 - - lat: 37.19026757574101 - lng: -80.59428502333573 - - lat: 37.18526788213324 - lng: -80.59005346211121 - - lat: 37.1837232669677 - lng: -80.58471856692397 - - lat: 37.18696946882951 - lng: -80.58072507989046 - - lat: 37.19117638063535 - lng: -80.57796221630451 - - lat: 37.19735957232225 - lng: -80.56931360695863 - - lat: 37.19892943598067 - lng: -80.57104154088566 - - lat: 37.19763628976819 - lng: -80.57674276197271 - - lat: 37.19465764212709 - lng: -80.58235632399915 - - lat: 37.19637327692024 - lng: -80.58569665094863 - altitude_lower: - value: 474 - reference: W84 - units: M - altitude_upper: - value: 560 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:17:00+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 0 - # TODO: Remove flight_authorisation section when it is optional - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Bvlos - uas_class: C0 - identification_technologies: [ 'N/A' ] - connectivity_methods: [ 'N/A' ] - endurance_minutes: 30 - emergency_procedure_url: https://example.uav.com/emergency - operator_id: CHEo5kut30e0mt01-qwe - uas_id: '' - uas_type_certificate: '' - - first_flight_activated: - delta: - source: first_flight - mutation: - request: - operational_intent: - state: Activated - - conflicting_flight: - full: - reference_time: '2023-01-01T00:12:00+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19060214692082 - lng: -80.57754923361475 - - lat: 37.1954872363992 - lng: -80.57106342715623 - - lat: 37.19906626886441 - lng: -80.56532842695125 - - lat: 37.19958021621874 - lng: -80.56597582177831 - - lat: 37.19672366937564 - lng: -80.57147209739449 - - lat: 37.19115600938851 - lng: -80.57855594239999 - altitude_lower: - value: 480 - reference: W84 - units: M - altitude_upper: - value: 540 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:06:20+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:20:40+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 0 - # TODO: Remove flight_authorisation section when it is optional - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Bvlos - uas_class: C0 - identification_technologies: [ 'N/A' ] - connectivity_methods: [ 'N/A' ] - endurance_minutes: 30 - emergency_procedure_url: https://example.uav.com/emergency - operator_id: CHEo5kut30e0mt01-qwe - uas_id: '' - uas_type_certificate: '' diff --git a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/invalid_flight_intents.yaml b/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/invalid_flight_intents.yaml deleted file mode 100644 index 01ddb804a7..0000000000 --- a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/invalid_flight_intents.yaml +++ /dev/null @@ -1,117 +0,0 @@ -intents: - valid_flight: - full: - reference_time: '2023-01-01T00:12:00+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19330428406196 - lng: -80.59314014213832 - - lat: 37.1837232669677 - lng: -80.58471856692397 - - lat: 37.19735957232225 - lng: -80.56931360695863 - altitude_lower: - value: 474 - reference: W84 - units: M - altitude_upper: - value: 560 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:17:00+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 0 - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Bvlos - uas_class: C0 - identification_technologies: [ 'N/A' ] - connectivity_methods: [ 'N/A' ] - endurance_minutes: 30 - emergency_procedure_url: https://example.uav.com/emergency - operator_id: CHEo5kut30e0mt01-qwe - uas_id: '' - uas_type_certificate: '' - - valid_activated: - delta: - source: valid_flight - mutation: - request: - operational_intent: - state: Activated - - invalid_accepted_offnominal: - delta: - source: valid_flight - mutation: - request: - operational_intent: - off_nominal_volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19330428406196 - lng: -80.59314014213832 - - lat: 37.1837232669677 - lng: -80.58471856692397 - - lat: 37.19735957232225 - lng: -80.56931360695863 - altitude_lower: - value: 474 - reference: W84 - units: M - altitude_upper: - value: 560 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:20:00+00:00' - format: RFC3339 - - invalid_activated_offnominal: - delta: - source: invalid_accepted_offnominal - mutation: - request: - operational_intent: - state: Activated - - invalid_too_far_away: - delta: - source: valid_flight - mutation: - # reference time pulled back of 32 days > OiMaxPlanHorizon = 30 days - reference_time: '2022-11-30T00:00:00+00:00' - - valid_conflict_tiny_overlap: - delta: - source: valid_flight - mutation: - request: - operational_intent: - volumes: - - volume: - outline_polygon: - # polygon overlaps with polygon of valid_flight, distance between first vertex of each is 1.112cm - vertices: - - lat: 37.1837231669677 - lng: -80.58471856692397 - - lat: 37.176167 - lng: -80.593150 - - lat: 37.176663 - lng: -80.575597 diff --git a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/priority_preemption.yaml b/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/priority_preemption.yaml deleted file mode 100644 index fd663fd895..0000000000 --- a/monitoring/uss_qualifier/test_data/usa/kentland/flight_intents/priority_preemption.yaml +++ /dev/null @@ -1,238 +0,0 @@ -intents: - flight_1_planned_vol_A: - full: - reference_time: '2023-01-01T00:12:00+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19330428406196 - lng: -80.59314014213832 - - lat: 37.19026757574101 - lng: -80.59428502333573 - - lat: 37.18526788213324 - lng: -80.59005346211121 - - lat: 37.1837232669677 - lng: -80.58471856692397 - - lat: 37.18696946882951 - lng: -80.58072507989046 - - lat: 37.19117638063535 - lng: -80.57796221630451 - - lat: 37.19735957232225 - lng: -80.56931360695863 - - lat: 37.19892943598067 - lng: -80.57104154088566 - - lat: 37.19763628976819 - lng: -80.57674276197271 - - lat: 37.19465764212709 - lng: -80.58235632399915 - - lat: 37.19637327692024 - lng: -80.58569665094863 - altitude_lower: - value: 474 - reference: W84 - units: M - altitude_upper: - value: 560 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:17:00+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 0 - # TODO: Remove flight_authorisation section when it is optional - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Bvlos - uas_class: C0 - identification_technologies: [ 'N/A' ] - connectivity_methods: [ 'N/A' ] - endurance_minutes: 30 - emergency_procedure_url: https://example.uav.com/emergency - operator_id: CHEo5kut30e0mt01-qwe - uas_id: '' - uas_type_certificate: '' - - flight_1_activated_vol_A: - delta: - source: flight_1_planned_vol_A - mutation: - request: - operational_intent: - state: Activated - - flight_1_planned_vol_A_extended: - delta: - source: flight_1_planned_vol_A - mutation: - request: - operational_intent: - volumes: - - volume: - altitude_lower: - value: 425 - - flight_1_activated_vol_A_extended: - delta: - source: flight_1_planned_vol_A_extended - mutation: - request: - operational_intent: - state: Activated - - flight_1_planned_vol_B: - delta: - source: flight_1_planned_vol_A - mutation: - request: - operational_intent: - volumes: - - volume: - altitude_lower: - value: 602 - altitude_upper: - value: 750 - - flight_1_activated_vol_B: - delta: - source: flight_1_planned_vol_B - mutation: - request: - operational_intent: - state: Activated - - flight_2_planned_vol_A: - full: - reference_time: '2023-01-01T00:12:00+00:00' - request: - operational_intent: - volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19389846157564 - lng: -80.57843722762006 - - lat: 37.19542873284961 - lng: -80.57744077506473 - - lat: 37.19621141165609 - lng: -80.578531141435 - - lat: 37.19610765396546 - lng: -80.57910946528506 - - lat: 37.19626017503177 - lng: -80.57953226320937 - - lat: 37.19516471659203 - lng: -80.58067042878767 - altitude_lower: - value: 483 - reference: W84 - units: M - altitude_upper: - value: 519 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:17:00+00:00' - format: RFC3339 - state: Accepted - off_nominal_volumes: [ ] - priority: 100 - # TODO: Remove flight_authorisation section when it is optional - flight_authorisation: - uas_serial_number: 1AF49UL5CC5J6K - operation_category: Open - operation_mode: Bvlos - uas_class: C0 - identification_technologies: [ 'N/A' ] - connectivity_methods: [ 'N/A' ] - endurance_minutes: 30 - emergency_procedure_url: https://example.uav.com/emergency - operator_id: CHEo5kut30e0mt01-qwe - uas_id: '' - uas_type_certificate: '' - - flight_2_activated_vol_A: - delta: - source: flight_2_planned_vol_A - mutation: - request: - operational_intent: - state: Activated - - flight_2_activated_vol_B: - delta: - source: flight_2_activated_vol_A - mutation: - request: - operational_intent: - volumes: - - volume: - altitude_lower: - value: 483 - altitude_upper: - value: 519 - - flight_2_equal_prio_planned_vol_B: - delta: - source: flight_2_activated_vol_B - mutation: - request: - operational_intent: - state: Accepted - priority: 0 - - flight_2_equal_prio_activated_vol_B: - delta: - source: flight_2_equal_prio_planned_vol_B - mutation: - request: - operational_intent: - state: Activated - - flight_2_equal_prio_nonconforming_vol_A: - delta: - source: flight_2_equal_prio_activated_vol_B - mutation: - request: - operational_intent: - state: Nonconforming - off_nominal_volumes: - - volume: - outline_polygon: - vertices: - - lat: 37.19389846157564 - lng: -80.57843722762006 - - lat: 37.19542873284961 - lng: -80.57744077506473 - - lat: 37.19621141165609 - lng: -80.578531141435 - - lat: 37.19610765396546 - lng: -80.57910946528506 - - lat: 37.19626017503177 - lng: -80.57953226320937 - - lat: 37.19516471659203 - lng: -80.58067042878767 - altitude_lower: - value: 483 - reference: W84 - units: M - altitude_upper: - value: 519 - reference: W84 - units: M - time_start: - value: '2023-01-01T00:05:00+00:00' - format: RFC3339 - time_end: - value: '2023-01-01T00:17:00+00:00' - format: RFC3339