Skip to content

Commit

Permalink
[rid] NET0470 UAS ID, Operator Location, Operator Altitude and Operat…
Browse files Browse the repository at this point in the history
…ional Status checks
  • Loading branch information
barroco committed Aug 4, 2023
1 parent c7f8ea5 commit 1c49510
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 24 deletions.
24 changes: 17 additions & 7 deletions monitoring/mock_uss/riddp/routes_observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions monitoring/monitorlib/fetch/rid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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]):
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1c49510

Please sign in to comment.