diff --git a/README.ko.md b/README.ko.md index f1e6dee..27a4998 100644 --- a/README.ko.md +++ b/README.ko.md @@ -52,7 +52,8 @@ export GZ_SIM_SYSTEM_PLUGIN_PATH="$PWD/install/lib${GZ_SIM_SYSTEM_PLUGIN_PATH:+: - 추종 차량 속도 상한: 11.9 m/s - 추종 목표 거리: 38 m - 거친 파도 속도 상한: 7 m/s -- 얕은 수역·운하 속도 상한: 4 m/s +- 측정된 얕은 수역 속도 상한: 6 m/s +- 운하·수심 미확인 구간 속도 상한: 4 m/s 추종 차량은 선행 차량의 실측 위치를 따라갑니다. 시계·진행·기울기·파도 정책은 실제 관측을 사용합니다. 복구 함수는 지형을 검사한 이동 후보를 제안합니다. 호출 앱이 보조 복구를 승인하고 표시합니다. diff --git a/README.md b/README.md index afcf370..af77a29 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,8 @@ Send `gz.msgs.Double_V` to `/wwos/promotional/path` as `[mode, speed_mps, count, - Follower speed cap: 11.9 m/s - Follower target separation: 38 m - Rough-water speed cap: 7 m/s -- Shallow-water and canal cap: 4 m/s +- Measured shallow-water cap: 6 m/s +- Canal and unavailable-depth cap: 4 m/s The follower follows measured leader poses. Clock, progress, tilt and rough-water policies use actual observations. Recovery helpers propose terrain-checked motion; the caller authorizes and reports assisted recovery. diff --git a/src/posim_control/speed.py b/src/posim_control/speed.py index 88a3c2f..fcd9e06 100644 --- a/src/posim_control/speed.py +++ b/src/posim_control/speed.py @@ -7,7 +7,8 @@ ROUGH_MPS=7. APPROACH_MPS=CRUISE_MPS FOLLOWER_MAX_MPS=11.9 -SHALLOW_MPS=4. +SHALLOW_MPS=6. +UNKNOWN_DEPTH_MPS=4. CANAL_MPS=4. def sensitive_water(near_port,canal,clearance,caution=False): @@ -15,9 +16,9 @@ def sensitive_water(near_port,canal,clearance,caution=False): def target_speed(near_port,canal,clearance,pending=False,rough=False): # Depth constrains safe speed; a port label and background downloads do not. - if clearance is None:return SHALLOW_MPS - if clearance<2:return SHALLOW_MPS if canal:return CANAL_MPS + if clearance is None:return UNKNOWN_DEPTH_MPS + if clearance<2:return SHALLOW_MPS return ROUGH_MPS if rough else CRUISE_MPS diff --git a/tests/test_promotional_rough_water.py b/tests/test_promotional_rough_water.py index e408079..c7f5292 100644 --- a/tests/test_promotional_rough_water.py +++ b/tests/test_promotional_rough_water.py @@ -57,10 +57,15 @@ def test_moderate_heave_peak_restarts_calm_hold(self): self.assertTrue(watch.update('a',float(t),dict(lead=pose(z=(-1)**t*.3)))['rough']) self.assertFalse(watch.update('a',84.,dict(lead=pose(z=.3)))['rough']) - def test_speed_changes_do_not_lift_canal_or_clearance_limits(self): - for clearance,canal in [(1.,False),(None,False),(30.,True)]: - self.assertEqual(target_speed(True,canal,clearance,pending=True,rough=True),4.) - self.assertEqual(target_speed(True,False,30,pending=True),10.5) + def test_shallow_speed_preserves_canal_unknown_depth_and_rough_limits(self): + for rough in (False,True): + for clearance in (1.,1.999): + self.assertEqual(target_speed(True,False,clearance,pending=True,rough=rough),6.) + for clearance in (None,1.,30.): + self.assertEqual(target_speed(True,True,clearance,pending=True,rough=rough),4.) + self.assertEqual(target_speed(False,False,None,rough=rough),4.) + self.assertEqual(target_speed(True,False,2.,pending=True),10.5) + self.assertEqual(target_speed(True,False,2.,rough=True),7.) def test_calm_hold_excludes_window_peak_and_duplicate_frames(self): watch=RoughWaterWatch();watch.update('a',0.,dict(lead=pose(tilt=31.)))