From baa9b8f32049da3cb771748bf929572ca89abfbd Mon Sep 17 00:00:00 2001 From: ioes Date: Fri, 9 Oct 2026 21:07:40 +0900 Subject: [PATCH] Continue checked coastal routing within cached terrain during source outages --- README.ko.md | 7 +++++++ README.md | 7 +++++++ src/posim_routing/regional.py | 21 ++++++++++++++----- tests/test_regional_outage.py | 39 +++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 tests/test_regional_outage.py diff --git a/README.ko.md b/README.ko.md index 883dc5e..18e5f8a 100644 --- a/README.ko.md +++ b/README.ko.md @@ -119,6 +119,13 @@ path = planner.route(start, goal) 멈춥니다. 물리 계산과 센서 수신은 계속합니다. 선택적인 해안 경로 준비에 실패하거나 결과가 비어 있어도 검증된 해안 경로를 외해 목표로 바꾸지 않습니다. +기본 지형 자료 서버에 연결할 수 없으면 더 작은 구역으로 경로를 계산합니다. +검증된 자료를 사용하며 수심과 육지 확인 기준은 같습니다. + +- 일반 구역: 20 km × 20 km +- 자료 서버 장애 시 재시도 구역: 6 km × 6 km +- 두 구역 모두 자료 부족: 추진을 멈추고 재시도 + ## 시험과 이용 조건 ```sh diff --git a/README.md b/README.md index 8e1c5da..e29538a 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,13 @@ checked replacement is ready. Physics and sensor sampling continue during the wait. Failed or empty optional renewal cannot replace a checked coastal route with an offshore goal. +When the baseline terrain provider is unavailable, regional planning tries a +smaller region. It uses verified source data and the same depth and land checks. + +- Normal region: 20 km × 20 km +- Source outage retry: 6 km × 6 km +- Missing data in both regions: hold thrust and retry + ## Tests and terms ```sh diff --git a/src/posim_routing/regional.py b/src/posim_routing/regional.py index e636764..209f9d2 100644 --- a/src/posim_routing/regional.py +++ b/src/posim_routing/regional.py @@ -254,6 +254,21 @@ async def prepare_port(self,state,target,key): value.update(route_key=key,job=state['native']['job'],source='resident collision terrain', policy=REGIONAL_POLICY,probe_position=current,mapped_land_checked=guard is not None) return value + async def terrain_region(self, centre, extent): + """Try a smaller verified region when the baseline provider is offline.""" + for width in (extent, 6000) if extent > 6000 else (extent,): + job=await self.rpc('/terrain/jobs',dict(latitude=centre[1],longitude=centre[0], + width_m=width,height_m=width,samples=257,source_policy='auto'),20) + end=time.monotonic()+620 + while job['status'] in ('queued','running') and time.monotonic()