Skip to content

Commit 4a99fb4

Browse files
authored
[uss_qualifier] migrate service_area to new volume resource (#1214)
1 parent d4c6d5f commit 4a99fb4

File tree

20 files changed

+372
-179
lines changed

20 files changed

+372
-179
lines changed

NEXT_RELEASE_NOTES.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,83 @@ planning_area:
108108
base_url: https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/f3548_self_contained/planning_area
109109
```
110110

111+
### Update ServiceAreaResource
112+
113+
Resources of type `resources.ServiceAreaResource` now have their volume specified via a separate `resource.VolumeResource` resource, which needs to be passed as a dependency.
114+
115+
Previously, a service area would be specified as:
116+
117+
118+
```yaml
119+
kentland_service_area:
120+
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
121+
resource_type: resources.netrid.ServiceAreaResource
122+
specification:
123+
base_url: https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/library/resources/kentland_service_area
124+
footprint:
125+
- lat: 37.1853
126+
lng: -80.6140
127+
- lat: 37.2148
128+
lng: -80.6140
129+
- lat: 37.2148
130+
lng: -80.5440
131+
- lat: 37.1853
132+
lng: -80.5440
133+
altitude_min: 0
134+
altitude_max: 3048
135+
reference_time: '2023-01-10T00:00:00.123456+00:00'
136+
time_start: '2023-01-10T00:00:01.123456+00:00'
137+
time_end: '2023-01-10T01:00:01.123456+00:00'
138+
```
139+
140+
The volume needs to ve moved to a separate `VolumeResource`, and references in the `dependencies` of the existing `PlanningAreaResource`:
141+
142+
```yaml
143+
kentland_service_area_volume:
144+
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
145+
resource_type: resources.VolumeResource
146+
specification:
147+
template:
148+
outline_polygon:
149+
vertices:
150+
- lat: 37.1853
151+
lng: -80.6140
152+
- lat: 37.2148
153+
lng: -80.6140
154+
- lat: 37.2148
155+
lng: -80.5440
156+
- lat: 37.1853
157+
lng: -80.5440
158+
altitude_lower:
159+
value: 0
160+
reference: W84
161+
units: M
162+
altitude_upper:
163+
value: 3048
164+
reference: W84
165+
units: M
166+
start_time:
167+
offset_from:
168+
starting_from:
169+
time_during_test: TimeOfEvaluation
170+
offset: 1s
171+
end_time:
172+
offset_from:
173+
starting_from:
174+
time_during_test: TimeOfEvaluation
175+
offset: 1h0m1s
176+
177+
kentland_service_area:
178+
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
179+
resource_type: resources.netrid.ServiceAreaResource
180+
dependencies:
181+
volume: kentland_service_area_volume
182+
specification:
183+
base_url: https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/library/resources/kentland_service_area
184+
```
185+
186+
Do note that the altitude and time bound fields (`altitude_lower`, `altitude_upper`, `start_time`, `end_time`) require some adaptations beyond simple copy-pasting.
187+
111188
## Optional migration tasks
112189

113190
## Important information

monitoring/monitorlib/geo.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,18 @@ def to_flight_planning_api(self) -> fp_api.Altitude:
207207
units=fp_api.AltitudeUnits.M,
208208
)
209209

210+
def to_w84_m(self):
211+
"""This altitude expressed in WGS84 meters, if possible to convert to it."""
212+
if self.reference != AltitudeDatum.W84:
213+
raise NotImplementedError(
214+
f"Cannot convert altitude with reference {self.reference} to WGS84 meters"
215+
)
216+
if self.units != DistanceUnits.M:
217+
raise NotImplementedError(
218+
f"Cannot convert altitude with units {self.units} to WGS84 meters"
219+
)
220+
return self.value
221+
210222
@staticmethod
211223
def from_f3548v21(vol: f3548v21.Altitude | dict) -> Altitude:
212224
return ImplicitDict.parse(vol, Altitude)
@@ -297,7 +309,7 @@ def intersects_vol3(self, vol3_2: Volume3D) -> bool:
297309

298310
return footprint1.intersects(footprint2)
299311

300-
def transform(self, transformation: Transformation):
312+
def transform(self, transformation: Transformation) -> Volume3D:
301313
if (
302314
"relative_translation" in transformation
303315
and transformation.relative_translation

monitoring/monitorlib/geotemporal.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class Volume4DTemplate(ImplicitDict):
4343
transformations: list[Transformation] | None = None
4444
"""If specified, transform this volume according to these transformations in order."""
4545

46-
def resolve(self, times: dict[TimeDuringTest, Time]) -> Volume4D:
47-
"""Resolve Volume4DTemplate into concrete Volume4D."""
48-
# Make 3D volume
46+
def _get_volume(self) -> Volume3D:
4947
kwargs = {}
5048
if self.outline_circle is not None:
5149
kwargs["outline_circle"] = self.outline_circle
@@ -55,11 +53,20 @@ def resolve(self, times: dict[TimeDuringTest, Time]) -> Volume4D:
5553
kwargs["altitude_lower"] = self.altitude_lower
5654
if self.altitude_upper is not None:
5755
kwargs["altitude_upper"] = self.altitude_upper
58-
volume = Volume3D(**kwargs)
56+
return Volume3D(**kwargs)
5957

60-
# Make 4D volume
61-
kwargs = {"volume": volume}
58+
def resolve_3d(self) -> Volume3D:
59+
"""Resolve Volume4DTemplate into concrete Volume3D."""
60+
result = self._get_volume()
61+
if self.transformations:
62+
for xform in self.transformations:
63+
result = result.transform(xform)
64+
return result
6265

66+
def resolve_times(
67+
self, times: dict[TimeDuringTest, Time]
68+
) -> tuple[Time | None, Time | None]:
69+
"""Resolve Volume4DTemplate into concrete temporal bounds (start, end)"""
6370
if self.start_time is not None:
6471
time_start = self.start_time.resolve(times)
6572
else:
@@ -84,18 +91,23 @@ def resolve(self, times: dict[TimeDuringTest, Time]) -> Volume4D:
8491
if time_end is None:
8592
time_end = Time(time_start.datetime + self.duration.timedelta)
8693

94+
return time_start, time_end
95+
96+
def resolve(self, times: dict[TimeDuringTest, Time]) -> Volume4D:
97+
"""Resolve Volume4DTemplate into concrete Volume4D."""
98+
volume = self.resolve_3d()
99+
100+
# Make 4D volume
101+
kwargs = {"volume": volume}
102+
103+
time_start, time_end = self.resolve_times(times)
104+
87105
if time_start is not None:
88106
kwargs["time_start"] = time_start
89107
if time_end is not None:
90108
kwargs["time_end"] = time_end
91109

92-
result = Volume4D(**kwargs)
93-
94-
if self.transformations:
95-
for xform in self.transformations:
96-
result = result.transform(xform)
97-
98-
return result
110+
return Volume4D(**kwargs)
99111

100112

101113
class Volume4D(ImplicitDict):

monitoring/uss_qualifier/configurations/dev/dss_probing.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ v1:
33
test_run:
44
resources:
55
resource_declarations:
6+
kentland_service_area_volume: { $ref: 'library/resources.yaml#/kentland_service_area_volume' }
67
kentland_service_area: { $ref: 'library/resources.yaml#/kentland_service_area' }
78
kentland_planning_area_volume: { $ref: 'library/resources.yaml#/kentland_planning_area_volume' }
89
kentland_planning_area: { $ref: 'library/resources.yaml#/kentland_planning_area' }

monitoring/uss_qualifier/configurations/dev/library/resources.yaml

Lines changed: 78 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,47 @@ id_generator:
2121
client_identity: utm_client_identity
2222
specification: { }
2323

24+
kentland_service_area_volume:
25+
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
26+
resource_type: resources.VolumeResource
27+
specification:
28+
template:
29+
outline_polygon:
30+
vertices:
31+
- lat: 37.1853
32+
lng: -80.6140
33+
- lat: 37.2148
34+
lng: -80.6140
35+
- lat: 37.2148
36+
lng: -80.5440
37+
- lat: 37.1853
38+
lng: -80.5440
39+
altitude_lower:
40+
value: 0
41+
reference: W84
42+
units: M
43+
altitude_upper:
44+
value: 3048
45+
reference: W84
46+
units: M
47+
start_time:
48+
offset_from:
49+
starting_from:
50+
time_during_test: TimeOfEvaluation
51+
offset: 1s
52+
end_time:
53+
offset_from:
54+
starting_from:
55+
time_during_test: TimeOfEvaluation
56+
offset: 1h0m1s
57+
2458
kentland_service_area:
2559
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
2660
resource_type: resources.netrid.ServiceAreaResource
61+
dependencies:
62+
volume: kentland_service_area_volume
2763
specification:
2864
base_url: https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/library/resources/kentland_service_area
29-
footprint:
30-
- lat: 37.1853
31-
lng: -80.6140
32-
- lat: 37.2148
33-
lng: -80.6140
34-
- lat: 37.2148
35-
lng: -80.5440
36-
- lat: 37.1853
37-
lng: -80.5440
38-
altitude_min: 0
39-
altitude_max: 3048
40-
reference_time: '2023-01-10T00:00:00.123456+00:00'
41-
time_start: '2023-01-10T00:00:01.123456+00:00'
42-
time_end: '2023-01-10T01:00:01.123456+00:00'
4365

4466
kentland_planning_area_volume:
4567
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
@@ -104,31 +126,53 @@ kentland_problematically_big_area:
104126
- lat: 38
105127
lng: -80
106128

129+
zurich_service_area_volume:
130+
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
131+
resource_type: resources.VolumeResource
132+
specification:
133+
template:
134+
outline_polygon:
135+
vertices:
136+
- lat: 47.45237618874023
137+
lng: 8.337401667996478
138+
- lat: 47.38882810764797
139+
lng: 8.343217430398902
140+
- lat: 47.3643466256706
141+
lng: 8.389932768382156
142+
- lat: 47.36323038495268
143+
lng: 8.536070011827881
144+
- lat: 47.36909451406398
145+
lng: 8.580678976356925
146+
- lat: 47.4007874493574
147+
lng: 8.57764881798931
148+
- lat: 47.451319730511365
149+
lng: 8.46442103543102
150+
altitude_lower:
151+
value: 0
152+
reference: W84
153+
units: M
154+
altitude_upper:
155+
value: 1000
156+
reference: W84
157+
units: M
158+
start_time:
159+
offset_from:
160+
starting_from:
161+
time_during_test: TimeOfEvaluation
162+
offset: 1s
163+
end_time:
164+
offset_from:
165+
starting_from:
166+
time_during_test: TimeOfEvaluation
167+
offset: 1h0m1s
168+
107169
zurich_service_area:
108170
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json
109171
resource_type: resources.netrid.ServiceAreaResource
172+
dependencies:
173+
volume: zurich_service_area_volume
110174
specification:
111175
base_url: https://testdummy.interuss.org/interuss/monitoring/uss_qualifier/configurations/dev/library/resources/zurich_service_area
112-
footprint:
113-
- lat: 47.45237618874023
114-
lng: 8.337401667996478
115-
- lat: 47.38882810764797
116-
lng: 8.343217430398902
117-
- lat: 47.3643466256706
118-
lng: 8.389932768382156
119-
- lat: 47.36323038495268
120-
lng: 8.536070011827881
121-
- lat: 47.36909451406398
122-
lng: 8.580678976356925
123-
- lat: 47.4007874493574
124-
lng: 8.57764881798931
125-
- lat: 47.451319730511365
126-
lng: 8.46442103543102
127-
altitude_min: 0
128-
altitude_max: 1000
129-
reference_time: '2025-10-15T00:00:00.123456+00:00'
130-
time_start: '2025-10-15T00:00:01.123456+00:00'
131-
time_end: '2025-10-15T01:00:01.123456+00:00'
132176

133177
zurich_planning_area_volume:
134178
$content_schema: monitoring/uss_qualifier/resources/definitions/ResourceDeclaration.json

monitoring/uss_qualifier/configurations/dev/netrid_v19.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ v1:
77
netrid_observation_evaluation_configuration: {$ref: 'library/resources.yaml#/netrid_observation_evaluation_configuration'}
88
utm_client_identity: {$ref: 'library/resources.yaml#/utm_client_identity'}
99
id_generator: {$ref: 'library/resources.yaml#/id_generator'}
10+
kentland_service_area_volume: {$ref: 'library/resources.yaml#/kentland_service_area_volume'}
1011
kentland_service_area: {$ref: 'library/resources.yaml#/kentland_service_area'}
1112
kentland_planning_area_volume: {$ref: 'library/resources.yaml#/kentland_planning_area_volume'}
1213
kentland_planning_area: {$ref: 'library/resources.yaml#/kentland_planning_area'}

monitoring/uss_qualifier/configurations/dev/netrid_v22a.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ v1:
77
netrid_observation_evaluation_configuration: {$ref: 'library/resources.yaml#/netrid_observation_evaluation_configuration'}
88
utm_client_identity: {$ref: 'library/resources.yaml#/utm_client_identity'}
99
id_generator: {$ref: 'library/resources.yaml#/id_generator'}
10+
kentland_service_area_volume: {$ref: 'library/resources.yaml#/kentland_service_area_volume'}
1011
kentland_service_area: {$ref: 'library/resources.yaml#/kentland_service_area'}
1112
kentland_planning_area_volume: {$ref: 'library/resources.yaml#/kentland_planning_area_volume'}
1213
kentland_planning_area: {$ref: 'library/resources.yaml#/kentland_planning_area'}

monitoring/uss_qualifier/configurations/dev/uspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ v1:
1313
netrid_observation_evaluation_configuration: {$ref: 'library/resources.yaml#/netrid_observation_evaluation_configuration'}
1414
utm_client_identity: {$ref: 'library/resources.yaml#/utm_client_identity'}
1515
id_generator: {$ref: 'library/resources.yaml#/id_generator'}
16+
zurich_service_area_volume: {$ref: 'library/resources.yaml#/zurich_service_area_volume'}
1617
zurich_service_area: {$ref: 'library/resources.yaml#/zurich_service_area'}
1718
zurich_planning_area_volume: {$ref: 'library/resources.yaml#/zurich_planning_area_volume'}
1819
zurich_planning_area: {$ref: 'library/resources.yaml#/zurich_planning_area'}

0 commit comments

Comments
 (0)