sync: pin dock_pattern_detector, costmap_2d; add trolley_detection_action (handler off)
- dock_pattern_detector -> c568e90 (LegPatternMatcher, needed by the new action) - costmap_2d -> 3539afb (yaml-cpp linked into depth_camera_obstacle_layer_test) - add submodule trolley_detection_action (bfdcac5) and its add_subdirectory in the root CMakeLists.txt - config/runtime/action_handlers_params.yaml: new keys only (detect_trolley block, TrolleyDetectionActionHandler library_path). The handler line in `handlers:` stays commented, so the robot does not load it until a real trolley is measured (doc/MEASURE_AND_CONFIGURE.md in the new package).
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -93,3 +93,6 @@
|
|||||||
path = src/Algorithms/Packages/local_planners/priest_mpcc_local_planner
|
path = src/Algorithms/Packages/local_planners/priest_mpcc_local_planner
|
||||||
url = https://git.pnkr.asia/DuongTD/priest_mpcc_local_planner.git
|
url = https://git.pnkr.asia/DuongTD/priest_mpcc_local_planner.git
|
||||||
branch = main
|
branch = main
|
||||||
|
[submodule "src/Algorithms/Packages/actions/trolley_detection_action"]
|
||||||
|
path = src/Algorithms/Packages/actions/trolley_detection_action
|
||||||
|
url = https://git.pnkr.asia/DuongTD/trolley_detection_action.git
|
||||||
|
|||||||
@@ -270,6 +270,14 @@ if (NOT TARGET dock_pattern_action_handler)
|
|||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/Algorithms/Packages/actions/dock_pattern_action)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/src/Algorithms/Packages/actions/dock_pattern_action)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Bộ dò xe hàng 4 chân từ scan LiDAR thô, nạp như một action handler. Cần dock_pattern_detector
|
||||||
|
# (LegPatternMatcher), action_core và robot_sensor_ports — đều đã add ở trên.
|
||||||
|
#
|
||||||
|
# ⚠ Guard kiểm target thư viện `trolley_detection_action_handler`, như dock_pattern_action.
|
||||||
|
if (NOT TARGET trolley_detection_action_handler)
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/src/Algorithms/Packages/actions/trolley_detection_action)
|
||||||
|
endif()
|
||||||
|
|
||||||
# C API for .NET/C# integration. Target is `nav_c_api` — the guard must name the same target,
|
# C API for .NET/C# integration. Target is `nav_c_api` — the guard must name the same target,
|
||||||
# otherwise it never matches and the subdirectory is added twice on a re-entrant configure.
|
# otherwise it never matches and the subdirectory is added twice on a re-entrant configure.
|
||||||
if (NOT TARGET nav_c_api)
|
if (NOT TARGET nav_c_api)
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ actions:
|
|||||||
# xem khối `detect_lidar` bên dưới và launch spawn_dock_plate.
|
# xem khối `detect_lidar` bên dưới và launch spawn_dock_plate.
|
||||||
- {name: detect_pallet, type: FrameSamplerActionHandler}
|
- {name: detect_pallet, type: FrameSamplerActionHandler}
|
||||||
- {name: detect_lidar, type: DockPatternActionHandler}
|
- {name: detect_lidar, type: DockPatternActionHandler}
|
||||||
|
# Dò xe hàng 4 chân (gói trolley_detection_action). TẮT: bỏ comment dòng dưới để bật, SAU KHI
|
||||||
|
# đã đo xe thật và sửa số trong khối `detect_trolley` bên dưới.
|
||||||
|
# - {name: detect_trolley, type: TrolleyDetectionActionHandler}
|
||||||
|
|
||||||
# --- detect: lấy mẫu frame đích rồi ghi ra một frame TF ổn định ---------------------------------
|
# --- detect: lấy mẫu frame đích rồi ghi ra một frame TF ổn định ---------------------------------
|
||||||
#
|
#
|
||||||
@@ -534,6 +537,127 @@ actions:
|
|||||||
# dùng để kiểm đường timeout trong unit test. Khai `hang: true` trên robot = chặng đứng im cho
|
# dùng để kiểm đường timeout trong unit test. Khai `hang: true` trên robot = chặng đứng im cho
|
||||||
# tới khi hết `timeout` ở trên. Đừng thêm vào file runtime.
|
# tới khi hết `timeout` ở trên. Đừng thêm vào file runtime.
|
||||||
|
|
||||||
|
# --- detect_trolley: dò xe hàng 4 chân từ scan LiDAR THÔ -----------------------------------------
|
||||||
|
#
|
||||||
|
# ⚠ TẮT trên cây robot này: `detect_trolley` KHÔNG có trong `handlers:` nên handler không được nạp.
|
||||||
|
# Khối dưới chỉ là schema + tài liệu, số theo sim. Bật: đo xe thật theo
|
||||||
|
# doc/MEASURE_AND_CONFIGURE.md của gói trolley_detection_action, sửa số, rồi bỏ comment dòng
|
||||||
|
# `detect_trolley` trong `handlers:`.
|
||||||
|
#
|
||||||
|
# Robot đứng yên ở pose chuẩn bị trước cạnh vào của xe, handler tìm 4 chân trong scan, khớp tư thế
|
||||||
|
# xe, lọc nhiều scan, rồi ghi TF tĩnh `dock_target` = pose robot phải đạt dưới gầm xe. Chặng
|
||||||
|
# `move_to: dock_target` (marker `trolley`) sau nó đọc frame này.
|
||||||
|
#
|
||||||
|
# Số trong khối này theo MÔ HÌNH SIM: xe `tci_trolley` (world factory_ss_demo) + robot `hook_150`
|
||||||
|
# (SICK S300 sim). Xe thật phải đo lại (plan mục 12) — chỉ sửa YAML, không sửa code.
|
||||||
|
detect_trolley:
|
||||||
|
# actionType nào vào handler này. Phải khớp CHÍNH XÁC chuỗi trong order / compound.
|
||||||
|
action_types: [DetectTrolley]
|
||||||
|
# Frame TF ghi ra; chặng docking trỏ `move_to` vào đây.
|
||||||
|
output_frame: dock_target
|
||||||
|
# Lidar dùng để dò. PHẢI khớp tên trong sensor_store/sensors (sensor_store_params.yaml), và phải
|
||||||
|
# nhìn đúng hướng với `entry_direction` — lệch thì action fail ngay, không ghi goal ngược.
|
||||||
|
# Lidar gắn lộn ngược (roll π trong URDF) handler tự đọc từ TF, không cần khai gì thêm.
|
||||||
|
scan_topic: /f_scan
|
||||||
|
# Robot chui gầm bằng đầu nào: forward = tiến vào (lidar trước, heading goal trỏ VÀO xe);
|
||||||
|
# backward = lùi vào (lidar sau, heading goal trỏ RA cạnh vào). Đổi cái này thì đổi `scan_topic`
|
||||||
|
# và dấu `prior_x`/`prior_yaw` theo.
|
||||||
|
entry_direction: forward
|
||||||
|
# Frame khai `prior_*` và `search_fov`. base_link: lidar có thể gắn lệch tâm robot (hook_150:
|
||||||
|
# 0.454 m), khai trong frame lidar là lệch đúng ngần ấy.
|
||||||
|
prior_frame: base_link
|
||||||
|
# [s] Chờ robot đứng hẳn trước khi lấy mẫu. Tăng nếu thân robot còn rung khi vừa dừng.
|
||||||
|
settle_delay: 0.4
|
||||||
|
# [s] Hết giờ mà chưa chốt -> kFailed. Phải > settle_delay + sample_window + hold_time.
|
||||||
|
timeout: 15.0
|
||||||
|
# Profile dùng khi order không mang khoá `trolley_profile`.
|
||||||
|
default_profile: tci_trolley
|
||||||
|
profile_param_key: trolley_profile
|
||||||
|
# [m] Tia ngắn/dài hơn thì bỏ. max_range: chân xa nhất (chân sau) phải còn >= 3 tia — S300 sim
|
||||||
|
# ở 1.8 m chỉ còn ~3 tia trên chân 30 mm. Tăng không làm dò xa hơn, chỉ thêm vật nhiễu.
|
||||||
|
min_range: 0.10
|
||||||
|
max_range: 3.0
|
||||||
|
# [m] Sigma nhiễu range của lidar, làm trọng số khớp tư thế. S300 sim = 0.01. Lidar thật: đo.
|
||||||
|
range_sigma: 0.01
|
||||||
|
debug:
|
||||||
|
# Log `[debug]`: lý do chưa dò ra (1 Hz), kết quả khớp (1 Hz), tóm tắt lúc start. Lỗi thật
|
||||||
|
# (topic sai, hướng lidar sai, hết giờ) luôn in, không tắt được.
|
||||||
|
detect: true
|
||||||
|
|
||||||
|
# Bộ lọc nhiều scan (cùng khoá với detect_lidar). Spread chặt hơn detect_lidar vì khe hở hai bên
|
||||||
|
# khi chui gầm chỉ 4.85 cm (D6: ngang ±1.5 cm, yaw ±1°).
|
||||||
|
filter_enabled: true
|
||||||
|
# [s] S300 12.5 Hz → ~37 scan trong 3 s.
|
||||||
|
sample_window: 3.0
|
||||||
|
min_samples: 5
|
||||||
|
max_spread_xy: 0.02 # [m]
|
||||||
|
max_spread_yaw: 0.03 # [rad]
|
||||||
|
hold_time: 0.0 # [s]
|
||||||
|
jump_threshold: 0.0 # [m] 0 = tắt lọc cụm.
|
||||||
|
cluster_recency: 0.3 # [s]
|
||||||
|
min_cluster_fraction: 0.51
|
||||||
|
min_cluster_samples: 3
|
||||||
|
|
||||||
|
profiles:
|
||||||
|
tci_trolley:
|
||||||
|
# [m] Tâm–tâm hai chân của CẠNH VÀO (ngang hướng chui). Robot chui qua cạnh NGẮN (D10).
|
||||||
|
# Đo bằng thước giữa tâm chân. Sai số này đẩy cả bộ dò lệch — đo kỹ.
|
||||||
|
cart_opening: 0.517
|
||||||
|
# [m] Tâm–tâm hai chân DỌC hướng chui.
|
||||||
|
cart_depth: 0.720
|
||||||
|
# [m] Dung sai cạnh/đường chéo khi ghép cặp chân. Tăng: chịu xe méo, nhưng dễ ghép chân của
|
||||||
|
# hai xe đỗ sát nhau. Phải < 0.06 với dãy xe bước 0.97 m (khe chân 0.453 m).
|
||||||
|
cart_dim_tolerance: 0.04
|
||||||
|
# Tiết diện chân ở ĐÚNG độ cao lidar (0.184 m): box hoặc round.
|
||||||
|
leg_shape: box
|
||||||
|
# [m] box: cạnh dọc cart_opening; round: đường kính.
|
||||||
|
leg_width: 0.030
|
||||||
|
# [m] Dung sai bề rộng cụm chân.
|
||||||
|
leg_width_tolerance: 0.02
|
||||||
|
# Số chân phải THẤY. 3 = chịu 1 chân bị che. 2 chỉ được khi có prior (D7), dễ nhầm hơn.
|
||||||
|
min_legs: 3
|
||||||
|
# [điểm] Cổng lòng xe trống: > ngần này điểm scan trong lòng xe thì không chui. -1 = tắt.
|
||||||
|
# Bật sau khi xác nhận xe rỗng ở độ cao lidar không có gì (hàng thòng xuống, thanh đáy).
|
||||||
|
max_interior_points: -1
|
||||||
|
# [-] Điểm tin tối thiểu (0..1): nửa từ số chân thấy, nửa từ mức khớp.
|
||||||
|
min_confidence: 0.5
|
||||||
|
# Dải phản quang: TẮT — dò không dải trước (D9). Muốn phát hiện xe đỗ ngược (D5): dán dải ở
|
||||||
|
# 2 chân đầu cần vào, đặt tape_enabled: true + tape_legs: entry, đo tape_min_intensity.
|
||||||
|
# (tape_legs: entry khi tape_enabled: false bị từ chối lúc boot — khai thừa.)
|
||||||
|
tape_enabled: false
|
||||||
|
tape_min_intensity: 1000.0 # [đơn vị cảm biến] Gazebo trả thẳng laser_retro; lidar thật: đo
|
||||||
|
# Prior (D3): vùng tìm xe so với robot, trong `prior_frame`. TẮT: robot dò ở điểm do server
|
||||||
|
# đặt, không cố định so với xe — prior chặt loại luôn xe thật (log 28/10: robot đứng cách tâm
|
||||||
|
# xe 2.30 m, xoay 17.7° → "too few legs"). Tắt prior thì lấy xe điểm tin cao nhất trong
|
||||||
|
# `max_range`; robot phải thấy >= `min_legs` chân, tức tâm xe cách lidar <= ~2.5 m. Hai xe
|
||||||
|
# điểm sát nhau (dãy xe đỗ sát) → từ chối "ambiguous", KHÔNG đoán.
|
||||||
|
# ► Bật lại khi xe đỗ thành dãy sát nhau: điểm dò trên server phải đặt đủ chuẩn để xe đích nằm
|
||||||
|
# trong `search_radius` quanh prior, xe bên cạnh nằm ngoài. Khi bật: cạnh vào cách lidar
|
||||||
|
# 0.8–1.0 m → tâm xe cách base_link 1.61–1.81 m. Lùi vào: prior_x âm.
|
||||||
|
has_prior: false
|
||||||
|
prior_x: 1.70 # [m]
|
||||||
|
prior_y: 0.0 # [m]
|
||||||
|
# [rad] Hướng pháp tuyến cạnh vào (trỏ về robot) trong base_link: tiến vào = 3.14159, lùi = 0.
|
||||||
|
prior_yaw: 3.14159
|
||||||
|
# [rad] Dung sai yaw quanh prior_yaw. 0.35 ≈ 20°.
|
||||||
|
prior_yaw_tolerance: 0.35
|
||||||
|
# [m] Tâm xe xa prior quá ngần này thì loại. Giảm khi xe đỗ thành dãy sát nhau.
|
||||||
|
search_radius: 0.40
|
||||||
|
# [m, m, rad] Dịch đích so với tâm xe. 0 = robot dừng đúng tâm xe (dock_anchor: center).
|
||||||
|
offset_x: 0.0
|
||||||
|
offset_y: 0.0
|
||||||
|
offset_yaw: 0.0
|
||||||
|
|
||||||
|
# Mẫu instance LÙI VÀO — chưa bật. Bật: thêm `{name: detect_trolley_back, type:
|
||||||
|
# TrolleyDetectionActionHandler}` vào `handlers:` rồi bỏ comment khối dưới (giữ nguyên profile như
|
||||||
|
# trên, chỉ đổi prior_x: -1.70, prior_yaw: 0.0).
|
||||||
|
# detect_trolley_back:
|
||||||
|
# action_types: [DetectTrolleyBackward]
|
||||||
|
# output_frame: dock_target
|
||||||
|
# scan_topic: /b_scan
|
||||||
|
# entry_direction: backward
|
||||||
|
# prior_frame: base_link
|
||||||
|
|
||||||
# Bảng symbol -> thư viện cho Boost.DLL. KHÔNG phải tham số tinh chỉnh — thiếu `library_path` là
|
# Bảng symbol -> thư viện cho Boost.DLL. KHÔNG phải tham số tinh chỉnh — thiếu `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".
|
# 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".
|
||||||
FrameSamplerActionHandler:
|
FrameSamplerActionHandler:
|
||||||
@@ -542,3 +666,7 @@ FrameSamplerActionHandler:
|
|||||||
# Bộ dò biên dạng từ LiDAR thô. Gói riêng (`dock_pattern_action`), không thuộc action_core.
|
# Bộ dò biên dạng từ LiDAR thô. Gói riêng (`dock_pattern_action`), không thuộc action_core.
|
||||||
DockPatternActionHandler:
|
DockPatternActionHandler:
|
||||||
library_path: libdock_pattern_action_handler
|
library_path: libdock_pattern_action_handler
|
||||||
|
|
||||||
|
# Bộ dò xe hàng 4 chân từ LiDAR thô. Gói riêng (`trolley_detection_action`).
|
||||||
|
TrolleyDetectionActionHandler:
|
||||||
|
library_path: libtrolley_detection_action_handler
|
||||||
|
|||||||
Submodule src/Algorithms/Packages/actions/trolley_detection_action added at bfdcac512f
Submodule src/Libraries/costmap_2d updated: 757b381659...3539afbfb4
Reference in New Issue
Block a user