diff --git a/monitoring/mock_uss/riddp/routes_observation.py b/monitoring/mock_uss/riddp/routes_observation.py index 3426974426..af892f2897 100644 --- a/monitoring/mock_uss/riddp/routes_observation.py +++ b/monitoring/mock_uss/riddp/routes_observation.py @@ -159,16 +159,26 @@ def riddp_display_data() -> Tuple[str, int]: @requires_scope([Scope.Read]) def riddp_flight_details(flight_id: str) -> Tuple[str, int]: """Implements get flight details endpoint per automated testing API.""" - rid_version: RIDVersion = webapp.config[KEY_RID_VERSION] - tx = db.value flight_info = tx.flights.get(flight_id) if not flight_info: - return 'Flight "{}" not found'.format(flight_id), 404 + return f'Flight "{flight_id}" not found', 404 + rid_version: RIDVersion = webapp.config[KEY_RID_VERSION] flight_details = fetch.flight_details(flight_info.flights_url, flight_id, True, rid_version, utm_client) - return flask.jsonify( - observation_api.GetDetailsResponse( - operator_id=flight_details.details.operator_id, + if rid_version == RIDVersion.f3411_19: + # TODO: Implement details for F3411-19 + return flask.jsonify(observation_api.GetDetailsResponse(id=flight_id)) + elif rid_version == RIDVersion.f3411_22a: + result = observation_api.GetDetailsResponse( + id=flight_id, + operator_id=flight_details.details.v22a_value.get("operator_id"), + uas_id=flight_details.details.v22a_value.get("uas_id"), + operator_location=flight_details.details.v22a_value.get("operator_location"), + operational_status=flight_details.details.v22a_value.get("operational_status"), + ) + return flask.jsonify( + result ) - ) + else: + return f"Support for RID version {rid_version} not yet implemented", 501 diff --git a/monitoring/monitorlib/fetch/rid.py b/monitoring/monitorlib/fetch/rid.py index ab69a8ffa7..a24acf0163 100644 --- a/monitoring/monitorlib/fetch/rid.py +++ b/monitoring/monitorlib/fetch/rid.py @@ -306,10 +306,6 @@ def raw( def id(self) -> str: return self.raw.id - @property - def operator_id(self) -> Optional[str]: - return self.raw.operator_id - class Subscription(ImplicitDict): """Version-independent representation of a F3411 subscription.""" diff --git a/monitoring/monitorlib/rid_automated_testing/observation_api.py b/monitoring/monitorlib/rid_automated_testing/observation_api.py index 0946563aef..978d8c5d23 100644 --- a/monitoring/monitorlib/rid_automated_testing/observation_api.py +++ b/monitoring/monitorlib/rid_automated_testing/observation_api.py @@ -1,6 +1,7 @@ from typing import List, Optional from implicitdict import ImplicitDict +from uas_standards.astm.f3411 import v22a # Mirrors of types defined in remote ID automated testing observation API @@ -28,9 +29,8 @@ class Flight(ImplicitDict): recent_paths: Optional[List[Path]] -class GetDetailsResponse(ImplicitDict): - operator_id: Optional[str] - +class GetDetailsResponse(v22a.api.RIDFlightDetails): + pass class GetDisplayDataResponse(ImplicitDict): diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/common_dictionary_evaluator.py b/monitoring/uss_qualifier/scenarios/astm/netrid/common_dictionary_evaluator.py index 6634006c8d..af8de16d8c 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/common_dictionary_evaluator.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/common_dictionary_evaluator.py @@ -1,15 +1,17 @@ from typing import List, Optional + +from uas_standards.ansi_cta_2063_a import SerialNumber +from uas_standards.astm.f3411 import v22a + from monitoring.monitorlib.fetch.rid import ( - FetchedFlights, - FlightDetails + FetchedFlights ) +from monitoring.monitorlib.fetch.rid import FetchedUSSFlightDetails, FetchedUSSFlights, FlightDetails +from monitoring.monitorlib.geo import validate_lat, validate_lng +from monitoring.monitorlib.rid import RIDVersion from monitoring.uss_qualifier.common_data_definitions import Severity from monitoring.uss_qualifier.resources.netrid.evaluation import EvaluationConfiguration from monitoring.uss_qualifier.scenarios.scenario import TestScenarioType -from monitoring.monitorlib.rid import RIDVersion -from monitoring.monitorlib.geo import validate_lat, validate_lng -from uas_standards.ansi_cta_2063_a import SerialNumber -from uas_standards.astm.f3411 import v22a class RIDCommonDictionaryEvaluator(object): @@ -43,10 +45,15 @@ def evaluate_sp_details(self, details: FlightDetails, participants: List[str]): details.v22a_value.get("operator_location"), participants ) - def evaluate_dp_response(self, observed_flight_details: Optional[FlightDetails], injected_flight, participants): + def evaluate_dp_details(self, observed_details: Optional[FlightDetails], injected_flight, participants): self.evaluate_operator_id( - observed_flight_details.get("operator_id"), - participants, + observed_details.get("operator_id"), participants + ) + self.evaluate_uas_id( + observed_details.get("uas_id"), participants + ) + self.evaluate_operator_location( + observed_details.get("operator_location"), participants ) def evaluate_uas_id(self, value: Optional[v22a.api.UASID], participants: List[str]): @@ -82,6 +89,7 @@ def evaluate_uas_id(self, value: Optional[v22a.api.UASID], participants: List[st check.record_failed( f"Invalid uas_id serial number: {serial_number}", participants=participants, + severity=Severity.Medium, ) else: check.record_passed() diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/display_data_evaluator.py b/monitoring/uss_qualifier/scenarios/astm/netrid/display_data_evaluator.py index cd4d207281..a7f4035d74 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/display_data_evaluator.py +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/display_data_evaluator.py @@ -372,7 +372,7 @@ def _evaluate_normal_observation( details, query = observer.observe_flight_details(mapping.observed_flight.id) self._test_scenario.record_query(query) - self._common_dictionary_evaluator.evaluate_dp_response( + self._common_dictionary_evaluator.evaluate_dp_details( details, mapping.injected_flight, participants=[ diff --git a/monitoring/uss_qualifier/scenarios/astm/netrid/v22a/nominal_behavior.md b/monitoring/uss_qualifier/scenarios/astm/netrid/v22a/nominal_behavior.md index 5445676f99..307272afe4 100644 --- a/monitoring/uss_qualifier/scenarios/astm/netrid/v22a/nominal_behavior.md +++ b/monitoring/uss_qualifier/scenarios/astm/netrid/v22a/nominal_behavior.md @@ -173,10 +173,33 @@ Taking into account the propagation time of the injected flights, if the total n For a display area with a diagonal greather than *NetDetailsMaxDisplayAreaDiagonal* and less than *NetMaxDisplayAreaDiagonal*, **[astm.f3411.v22a.NET0480](../../../../requirements/astm/f3411/v22a.md)** requires that a Display provider shall cluster UAs in close proximity to each other using a circular or polygonal area covering no less than *NetMinClusterSize* percent of the display area size. This check validates that the display area of a cluster, measured and provided in square meters by the test harness, is no less than *NetMinClusterSize* percent of the display area. +#### UAS ID presence in flight details check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that the UAS ID is present in the information sent by the Display Provider. (**[astm.f3411.v22a.NET0470,Table1,1](../../../../requirements/astm/f3411/v22a.md)**) + +#### UAS ID (Serial Number format) consistency with Common Dictionary check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that the UAS ID is in serial number format. (**[astm.f3411.v22a.NET0470,Table1,1a](../../../../requirements/astm/f3411/v22a.md)**) + +#### Operational Status consistency with Common Dictionary check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that the Operational Status, if present, is valid. (**[astm.f3411.v22a.NET0470,Table1,7](../../../../requirements/astm/f3411/v22a.md)**) + #### Operator ID consistency with Common Dictionary check **[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall (NET0470) provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that the Operator ID, if present, is valid. (**[astm.f3411.v22a.NET0470,Table1,9](../../../../requirements/astm/f3411/v22a.md)**) +#### Operator Location consistency with Common Dictionary check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that the Operator Latitude (**[astm.f3411.v22a.NET0470,Table1,23](../../../../requirements/astm/f3411/v22a.md)**) and Longitude (**[astm.f3411.v22a.NET0470,Table1,24](../../../../requirements/astm/f3411/v22a.md)**), if present, are valid. + +#### Operator Altitude consistency with Common Dictionary check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that if the Operator Altitude is based on WGS-84 height above ellipsoid (HAE), is provided in meters and must have a minimum resolution of 1 m. (**[astm.f3411.v22a.NET0470,Table1,25](../../../../requirements/astm/f3411/v22a.md)**) + +#### Operator Altitude Type consistency with Common Dictionary check + +**[astm.f3411.v22a.NET0470](../../../../requirements/astm/f3411/v22a.md)** requires that Net-RID Display Provider shall provide access to required and optional fields to Remote ID Display Applications according to the Common Dictionary. This check validates that if the Operator Altitude Type is valid, if present. (**[astm.f3411.v22a.NET0470,Table1,26](../../../../requirements/astm/f3411/v22a.md)**) ## Cleanup