Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

추종 차량은 선행 차량의 실측 위치를 따라갑니다. 시계·진행·기울기·파도 정책은 실제 관측을 사용합니다. 복구 함수는 지형을 검사한 이동 후보를 제안합니다. 호출 앱이 보조 복구를 승인하고 표시합니다.

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions src/posim_control/speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
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):
return bool(canal or clearance is None or clearance<2 or caution)

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


Expand Down
13 changes: 9 additions & 4 deletions tests/test_promotional_rough_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)))
Expand Down