Files
mission_adapters/test/config/mission_adapters_params.yaml
2026-08-03 22:40:26 +07:00

108 lines
3.5 KiB
YAML

# Config CHỈ dùng cho test của gói. Bản runtime nằm ở
# `pnkx_nav_core/config/mission_adapters_params.yaml` (C2) — sửa tham số vận hành thì sửa ở đó.
#
# Chạy test kèm: PNKX_NAV_CORE_CONFIG_DIR=src/AMR_T800/Test/mission_adapters/test/config
mission_adapters:
# Nguồn mission. Thêm loại mới chỉ cần thêm một entry ở đây + một plugin .so.
mission_sources:
- {name: goal_src, type: GoalSourceAdapter}
- {name: vda5050_src, type: VDA5050SourceAdapter}
mission_timeout: 0.0 # [s] 0 = tắt
clear_queue_on_failure: false # false = chỉ bỏ chặng lỗi, giữ phần còn lại của order
# Bảng symbol -> thư viện cho Boost.DLL. Thiếu khoá library_path là nguyên nhân phổ biến nhất của
# lỗi "plugin build xong nhưng runtime báo không tìm thấy".
GoalSourceAdapter:
library_path: libmission_adapters_goal_source
VDA5050SourceAdapter:
library_path: libmission_adapters_vda5050_source
# ── Các case lỗi mà plugin_registry_test cố ý dựng ra ────────────────────────────────────────────
#
# Mỗi case là một namespace riêng để test gọi loadFromConfig(nh, "<namespace>") mà không phải sinh
# file YAML lúc chạy.
registry_test_missing_library_path:
mission_sources:
- {name: bad_src, type: MissingLibraryPathAdapter}
registry_test_missing_library_file:
mission_sources:
- {name: bad_src, type: MissingLibraryFileAdapter}
registry_test_wrong_symbol:
mission_sources:
- {name: bad_src, type: WrongSymbolAdapter}
registry_test_duplicate_schema:
mission_sources:
- {name: goal_a, type: GoalSourceAdapter}
- {name: goal_b, type: GoalSourceAdapter}
registry_test_entry_without_type:
mission_sources:
- {name: nameless_src}
registry_test_empty:
mission_timeout: 0.0
# Khai trong mission_sources nhưng KHÔNG có khoá library_path.
MissingLibraryPathAdapter:
description: "cố ý thiếu library_path"
# library_path trỏ tới file không tồn tại.
MissingLibraryFileAdapter:
library_path: libmission_adapters_does_not_exist
# Thư viện có thật nhưng symbol không tồn tại trong đó.
WrongSymbolAdapter:
library_path: libmission_adapters_goal_source
# ── Compound action: action "phải dò rồi mới biết đích" ─────────────────────────────────────────
#
# Bảng chỉ giữ CẤU TRÚC; frame cụ thể tới từ actionParameters của chính order.
vda5050_src:
global_frame: map
compound_actions:
charge:
steps:
- {action: DetectCharger}
- {move_to_param: goal_frame, profile: docking, marker: charger}
- {action: startCharging}
UnDockFromStation:
steps:
- {move: -1.0, profile: go_straight}
FixedDock:
steps:
- {move_to: dock_target, profile: docking, marker: trolley}
# Step có hai từ khoá -> configure() phải từ chối lúc boot.
vda5050_bad_step:
compound_actions:
charge:
steps:
- {action: DetectCharger, move: -1.0}
# Compound sinh ra một actionType cũng là compound -> đệ quy.
vda5050_recursive:
compound_actions:
charge:
steps:
- {action: PickUp}
PickUp:
steps:
- {move: 0.5}
# Profile chỉ có nghĩa trên step navigation và phải thuộc bốn profile runtime.
vda5050_bad_profile:
compound_actions:
invalid_name:
steps:
- {move: 0.5, profile: dock}