update
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
# Action handler của move_base2 (D8: navigation runtime chạy trọn một mission — nav xong thì chạy
|
||||
# nốt action của chặng rồi mới báo kết quả).
|
||||
# =================================================================================================
|
||||
# action_core — action handler của move_base2.
|
||||
#
|
||||
# Quy ước comment: dòng mô tả = LÀ GÌ / vì sao; `► Chỉnh:` = tăng giảm theo triệu chứng nào.
|
||||
#
|
||||
# D8: navigation runtime chạy TRỌN một mission — đi tới đích xong thì chạy nốt action của chặng rồi
|
||||
# mới báo kết quả. Trong lúc chạy action robot KHÔNG phát cmd_vel.
|
||||
#
|
||||
# Handler là plugin của gói `action_core`, nạp qua Boost.DLL đúng như planner/recovery. Thêm một
|
||||
# loại action mới = viết một `.so` + thêm một dòng ở đây, không phải sửa dòng nào của navigation.
|
||||
#
|
||||
# Vì sao file này tồn tại: thiếu handler thì `ActionRunner::start` từ chối và chặng mang action đi
|
||||
# thẳng tới ABORTED — tức mọi order VDA5050 có node action fail ở chặng đầu tiên.
|
||||
#
|
||||
# BA TẦNG TIMEOUT, đừng lẫn:
|
||||
# 1. `timeout` của chính handler (trong khối handler bên dưới) — handler tự biết thiết bị của nó;
|
||||
# 2. `action_patience` của state machine — lưới chung cho MỌI action, mặc định tắt;
|
||||
# 3. `mission_timeout` của mission layer — lưới cho cả chặng nav + action.
|
||||
# =================================================================================================
|
||||
|
||||
actions:
|
||||
# Danh sách handler được nạp.
|
||||
# name: tên instance = namespace param riêng bên dưới
|
||||
# type: alias Boost.DLL, phải có `library_path` ở cuối file
|
||||
#
|
||||
# ► Chỉnh: một `type` được phép khai nhiều `name` để có nhiều instance khác tuning. Handler nào
|
||||
# không khai `action_types` sẽ không bao giờ được gọi.
|
||||
handlers:
|
||||
# Dò: lấy mẫu frame thô của LiDAR/camera, lọc, ghi ra `dock_target` cho chặng sau tra.
|
||||
- {name: detect, type: FrameSamplerActionHandler}
|
||||
@@ -24,33 +41,77 @@ actions:
|
||||
# PLC/băng tải/càng nâng) trước khi chạy ngoài hiện trường.
|
||||
- {name: sim_noop, type: NoopActionHandler}
|
||||
|
||||
# --- detect: lấy mẫu frame đích rồi ghi ra một frame TF ổn định ---------------------------------
|
||||
detect:
|
||||
# actionType nào được handler này nhận. Phải khớp CHÍNH XÁC chuỗi trong order / trong
|
||||
# `compound_actions_params.yaml`.
|
||||
# ► Chỉnh: đây là bảng định tuyến, không phải số tinh chỉnh. Sai một chữ = action rơi vào hư
|
||||
# không và chặng ABORT.
|
||||
action_types: [DetectCharger, DetectPallet]
|
||||
output_frame: dock_target # chặng docking trỏ `move_to` vào đây
|
||||
# STUB chỉ cho Gazebo/dev: thay perception bằng target cố định (-1.5, +0.2) trong `base_link`,
|
||||
# theo đúng pose `trolley_goal` giả trước đây. Handler quy nó sang `map` MỘT LẦN rồi ghi
|
||||
# `dock_target` tĩnh vào tf3, nên target không chạy theo robot khi chặng docking bắt đầu.
|
||||
# PHẢI tắt trước khi chạy robot thật để handler lấy frame do perception publish.
|
||||
|
||||
# Tên frame TF mà handler ghi ra; chặng docking trỏ `move_to` vào đây.
|
||||
# ► Chỉnh: đổi thì phải đổi đồng bộ `move_to: dock_target` bên compound_actions_params.yaml.
|
||||
output_frame: dock_target
|
||||
|
||||
# Frame THÔ để lấy mẫu (do perception publish). CỐ Ý KHÔNG KHAI: mặc định là chuỗi rỗng, nghĩa
|
||||
# là handler lấy frame từ `goal_frame` của chính action trong order — linh hoạt hơn, thêm một
|
||||
# trạm mới không phải sửa file này. Khai chuỗi rỗng trong YAML dễ bị parse thành `null` (khác
|
||||
# `""`), nên để trống hẳn thay vì khai.
|
||||
# ► Chỉnh: chỉ khai khi perception publish một frame CỐ ĐỊNH cho mọi lần dò, ví dụ:
|
||||
# input_frame: charger_raw
|
||||
# Đây là khoá quyết định handler dò CÁI GÌ khi tắt `use_simulated_goal` để chạy robot thật.
|
||||
|
||||
# STUB chỉ cho Gazebo/dev: thay perception bằng target cố định trong `base_link`. Handler quy nó
|
||||
# sang `map` MỘT LẦN rồi ghi `dock_target` tĩnh vào tf3, nên target không chạy theo robot khi
|
||||
# chặng docking bắt đầu.
|
||||
# ► Chỉnh: PHẢI đặt false trước khi chạy robot thật, để handler lấy frame do perception publish.
|
||||
# Để true trên robot thật = robot tiến vào một điểm bịa.
|
||||
use_simulated_goal: true
|
||||
simulated_parent_frame: base_link
|
||||
simulated_offset_x: -1.5 # [m]
|
||||
simulated_offset_y: 0.2 # [m]
|
||||
simulated_offset_x: -1.5 # [m] ► Chỉnh: chỉ có nghĩa khi use_simulated_goal: true.
|
||||
simulated_offset_y: 0.2 # [m] Đặt theo vị trí vật thể giả trong world Gazebo.
|
||||
simulated_offset_yaw: 0.0 # [rad]
|
||||
settle_delay: 1.0 # [s] chờ robot đứng hẳn — pose lúc vừa dừng còn dao động cơ khí
|
||||
sample_window: 2.0 # [s] thu mẫu
|
||||
min_samples: 20
|
||||
max_spread_xy: 0.03 # [m] tản hơn -> kFailed, KHÔNG lùi vào
|
||||
max_spread_yaw: 0.05 # [rad]
|
||||
timeout: 15.0 # [s] frame thô không tới -> kFailed
|
||||
|
||||
# [s] Chờ robot đứng hẳn trước khi lấy mẫu — pose lúc vừa dừng còn dao động cơ khí.
|
||||
# ► Chỉnh: TĂNG nếu robot nặng/treo mềm và mẫu đầu bị lệch. GIẢM để rút ngắn chu kỳ dock.
|
||||
settle_delay: 1.0
|
||||
|
||||
# [s] Cửa sổ thu mẫu.
|
||||
# ► Chỉnh: TĂNG cùng `min_samples` khi perception publish thưa hoặc nhiễu; GIẢM để dock nhanh
|
||||
# hơn khi frame đã rất ổn định.
|
||||
sample_window: 2.0
|
||||
|
||||
# Số mẫu tối thiểu phải thu được trong cửa sổ, nếu không -> kFailed.
|
||||
# ► Chỉnh: đặt ~= (tần số publish của perception) x `sample_window` x 0.5 để còn dư địa. Đặt cao
|
||||
# quá là action fail dù frame vẫn tốt.
|
||||
min_samples: 20
|
||||
|
||||
# Độ tản tối đa của tập mẫu. Tản hơn -> kFailed, KHÔNG lùi vào.
|
||||
# ► Chỉnh: đây là chốt AN TOÀN, không phải nút để "cho qua". Nới ra nghĩa là chấp nhận tiến vào
|
||||
# một đích đo không chắc. Đo độ tản thật trên hiện trường rồi đặt ~1.5 lần giá trị đó.
|
||||
max_spread_xy: 0.03 # [m]
|
||||
max_spread_yaw: 0.05 # [rad]
|
||||
|
||||
# [s] Frame thô không tới trong khoảng này -> kFailed.
|
||||
# ► Chỉnh: phải > settle_delay + sample_window (1.0 + 2.0) cộng dư địa cho perception khởi động.
|
||||
timeout: 15.0
|
||||
|
||||
# --- waiter: đứng chờ một khoảng thời gian ------------------------------------------------------
|
||||
waiter:
|
||||
action_types: [wait]
|
||||
default_duration: 2.0 # [s] dùng khi action không kèm tham số `duration`
|
||||
max_duration: 600.0 # [s] trần cứng; vượt trần thì action THẤT BẠI, không bị cắt ngắn
|
||||
# [s] Dùng khi action không kèm tham số `duration`.
|
||||
# ► Chỉnh: đặt theo thời gian chờ điển hình của quy trình (mở cửa, người lấy hàng...).
|
||||
default_duration: 2.0
|
||||
# [s] Trần cứng; vượt trần thì action THẤT BẠI, không bị cắt ngắn.
|
||||
# ► Chỉnh: cố ý fail thay vì cắt ngắn — cắt ngắn sẽ báo "xong" khi việc chưa xong. TĂNG nếu quy
|
||||
# trình có bước chờ dài hợp lệ (sạc, chờ ca).
|
||||
max_duration: 600.0
|
||||
|
||||
# --- reporter: chỉ ghi log, không điều khiển gì -------------------------------------------------
|
||||
reporter:
|
||||
action_types: [logReport]
|
||||
|
||||
# --- sim_noop: STUB, giả lập thiết bị ------------------------------------------------------------
|
||||
sim_noop:
|
||||
# ⚠ `PickUp` và `charge` KHÔNG có ở đây: chúng là compound action, adapter đã dịch chúng thành
|
||||
# chuỗi chặng và GỠ khỏi danh sách action. Thứ tới được ActionRunner là các actionType do chuỗi
|
||||
@@ -58,12 +119,26 @@ actions:
|
||||
#
|
||||
# Đây đúng chỗ dễ trôi lệch nhất giữa hai bảng: khai `PickUp` ở đây thì handler không bao giờ
|
||||
# được gọi, còn quên `LiftFork` thì chặng thiết bị ABORT giữa chừng với kệ đang trên càng.
|
||||
#
|
||||
# ► Chỉnh: mỗi lần thêm một step `{action: X}` vào compound_actions_params.yaml thì PHẢI thêm X
|
||||
# vào đây (hoặc vào handler thật tương ứng).
|
||||
action_types: [LiftFork, startCharging, DropDown, Drop, MutedOn, MutedOff, pick, drop]
|
||||
duration: 2.0 # [s] thời gian giả lập thiết bị làm việc
|
||||
timeout: 30.0 # [s] timeout TẦNG 1 — trách nhiệm của chính handler
|
||||
|
||||
# Bảng symbol -> thư viện cho Boost.DLL. 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".
|
||||
# [s] Thời gian giả lập thiết bị làm việc.
|
||||
# ► Chỉnh: đặt ~= thời gian thật của thiết bị để timing trên sim giống hiện trường.
|
||||
duration: 2.0
|
||||
|
||||
# [s] Timeout TẦNG 1 — trách nhiệm của chính handler.
|
||||
# ► Chỉnh: phải > `duration`. Với handler THẬT, đặt theo hiểu biết thiết bị ("nâng kệ quá 20 s
|
||||
# là bất thường" vs "sạc 30 phút là bình thường"), đừng dùng một con số chung.
|
||||
timeout: 30.0
|
||||
|
||||
# ⚠ CỐ Ý KHÔNG KHAI: khoá `hang` (mặc định false) là TEST HOOK làm handler treo vĩnh viễn, chỉ
|
||||
# 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.
|
||||
|
||||
# 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".
|
||||
FrameSamplerActionHandler:
|
||||
library_path: libaction_core_frame_sampler_action_handler
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
# Action "phải dò rồi mới biết đích" — bảng mở rộng của `VDA5050SourceAdapter`.
|
||||
# =================================================================================================
|
||||
# action_core / mission_adapters — compound action: "phải dò rồi mới biết đích".
|
||||
#
|
||||
# Quy ước comment: dòng mô tả = LÀ GÌ / vì sao; `► Chỉnh:` = sửa thế nào cho đúng.
|
||||
#
|
||||
# Đây là bảng mở rộng của `VDA5050SourceAdapter`: một action của fleet được DỊCH thành một chuỗi
|
||||
# chặng (nav + action) trước khi xuống navigation. Fleet chỉ gửi `charge`; `DetectCharger` và
|
||||
# `startCharging` là actionType NỘI BỘ do adapter sinh ra, không bao giờ xuất hiện trong order JSON.
|
||||
#
|
||||
# File riêng thay vì sửa `mission_adapters_params.yaml`: file đó là symlink sang cây config của
|
||||
# `pnkx_nav_core` (submodule). `robot::NodeHandle` gộp mọi file YAML trong thư mục config vào một
|
||||
@@ -6,36 +13,48 @@
|
||||
#
|
||||
# ── Bảng này chỉ giữ CẤU TRÚC ────────────────────────────────────────────────────────────────────
|
||||
#
|
||||
# Fleet chỉ gửi `charge`; `DetectCharger` và `startCharging` là actionType NỘI BỘ do adapter sinh ra,
|
||||
# không bao giờ xuất hiện trong order JSON. Tên frame cụ thể đến từ `actionParameters` của chính
|
||||
# order, nên thêm một trạm sạc mới không phải sửa file này.
|
||||
# Tên frame cụ thể đến từ `actionParameters` của chính order, nên thêm một trạm sạc mới KHÔNG phải
|
||||
# sửa file này.
|
||||
#
|
||||
# Bốn từ khoá của một step, phải có ĐÚNG MỘT:
|
||||
# action: <type> chặng chỉ-action; mang nguyên actionParameters của action gốc
|
||||
# move_to: <frame> chặng nav, frame cố định
|
||||
# move_to_param: <key> chặng nav, frame lấy từ actionParameters[<key>] của action gốc
|
||||
# move: <mét> chặng nav tương đối; dương = tiến, âm = lùi
|
||||
#
|
||||
# Tuỳ chọn cho step navigation: profile (position | docking | go_straight | rotate), marker.
|
||||
# `marker` chỉ hợp lệ với `profile: docking`: nó chọn override trong
|
||||
# maker_sources.yaml/docking_marker_profiles. Không khai = dùng cặp docking mặc định.
|
||||
# Tolerance thuộc YAML riêng của local planner đang được profile chọn, không khai ở đây.
|
||||
#
|
||||
# ── Ba quy tắc khi sửa ───────────────────────────────────────────────────────────────────────────
|
||||
# 1. Mỗi `action: X` thêm mới PHẢI có handler nhận `X` trong `action_handlers_params.yaml`
|
||||
# (`action_types`), nếu không chặng đó ABORT.
|
||||
# 2. `clear_queue_on_failure: true` (mission_adapters_params.yaml) là thứ ngăn robot chạy bước
|
||||
# thiết bị khi bước dò/bước tiến vào đã hỏng — đừng tắt khi còn dùng compound action.
|
||||
# 3. Thứ tự step là hợp đồng an toàn: dò -> vào vị trí -> mới thao tác thiết bị. Đảo thứ tự nghĩa
|
||||
# là đóng relay / nâng càng khi chưa vào đúng chỗ.
|
||||
# =================================================================================================
|
||||
|
||||
vda5050_src:
|
||||
compound_actions:
|
||||
# --- charge: vào trạm sạc ---------------------------------------------------------------------
|
||||
charge:
|
||||
steps:
|
||||
# 1. Dò: đứng yên lấy mẫu frame thô, lọc nhiễu, ghi ra `dock_target`.
|
||||
# Robot không phát cmd_vel trong EXECUTING_ACTIONS nên đây đúng là lúc để lọc.
|
||||
# Tham số lọc (sample_window, max_spread_*) nằm ở khối `detect` bên action_handlers.
|
||||
- {action: DetectCharger}
|
||||
|
||||
# 2. Tiến vào đích vừa dò được bằng profile docking. Sai số do local planner đọc từ YAML
|
||||
# của chính plugin đó.
|
||||
# của chính plugin đó (hybrid_local_planner_params.yaml), KHÔNG khai ở đây.
|
||||
- {move_to: dock_target, profile: docking, marker: charger}
|
||||
|
||||
# 3. Thao tác thiết bị. Chặng 1 hoặc 2 hỏng thì `clear_queue_on_failure` xoá chặng này —
|
||||
# robot không bao giờ đóng relay khi chưa vào được vị trí.
|
||||
- {action: startCharging}
|
||||
|
||||
# --- PickUp: lấy kệ ---------------------------------------------------------------------------
|
||||
PickUp:
|
||||
steps:
|
||||
- {action: DetectPallet}
|
||||
@@ -43,12 +62,19 @@ vda5050_src:
|
||||
- {action: LiftFork}
|
||||
# Lùi ra khỏi khe kệ. Quãng đường tương đối được quy ra pose tuyệt đối tại `submit`, từ pose
|
||||
# LÚC ĐÓ — lúc adapter sinh chặng thì robot còn chưa tới nơi.
|
||||
# ► Chỉnh: [m] âm = lùi. Đặt đủ dài để càng nâng ra hẳn khỏi khe kệ trước khi robot xoay;
|
||||
# quá ngắn thì kệ quệt vào giá, quá dài thì tốn thời gian và có thể lùi vào lối đi chung.
|
||||
- {move: -0.5, profile: go_straight}
|
||||
|
||||
|
||||
# --- GoStraight / Rotate: hai lệnh chuyển động trần, dùng để kiểm thử và cho quy trình đơn giản
|
||||
GoStraight:
|
||||
steps:
|
||||
# ► Chỉnh: [m] dương = tiến, âm = lùi. Profile `go_straight` không tránh vật cản dọc đường —
|
||||
# chỉ dùng cho quãng ngắn đã biết là trống.
|
||||
- {move: 1.0, profile: go_straight}
|
||||
|
||||
|
||||
Rotate:
|
||||
steps:
|
||||
# ► Chỉnh: `move: 0.0` = không tịnh tiến; góc quay lấy từ actionParameters của order.
|
||||
# Profile `rotate` dùng PNKXRotateLocalPlanner, tham số ở YAML của plugin đó.
|
||||
- {move: 0.0, profile: rotate}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/config
|
||||
36
config/runtime/config/costmap_params.yaml
Normal file
36
config/runtime/config/costmap_params.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
robot_costmap_2d:
|
||||
global_frame: map
|
||||
robot_base_frame: base_link
|
||||
rolling_window: false
|
||||
track_unknown_space: false
|
||||
|
||||
plugins:
|
||||
- name: static_layer
|
||||
type: StaticLayer
|
||||
|
||||
- name: inflation_layer
|
||||
type: InflationLayer
|
||||
|
||||
- name: obstacle_layer
|
||||
type: ObstacleLayer
|
||||
|
||||
- name: voxel_layer
|
||||
type: VoxelLayer
|
||||
|
||||
library_path: ./libplugins.so
|
||||
footprint:
|
||||
- [0.3, 0.3]
|
||||
- [0.3, -0.3]
|
||||
- [-0.3, -0.3]
|
||||
- [-0.3, 0.3]
|
||||
|
||||
transform_tolerance: 0.0
|
||||
update_frequency: 1.0
|
||||
width: 0.0
|
||||
height: 0.0
|
||||
resolution: 0.0
|
||||
origin_x: 0.0
|
||||
origin_y: 0.0
|
||||
|
||||
footprint_padding: 0.0
|
||||
robot_radius: 0.0
|
||||
5
config/runtime/config/inflation_layer_params.yaml
Normal file
5
config/runtime/config/inflation_layer_params.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
inflation_layer:
|
||||
enabled: true
|
||||
inflate_unknown: false
|
||||
cost_scaling_factor: 15.0
|
||||
inflation_radius: 0.55
|
||||
19
config/runtime/config/obstacle_layer_params.yaml
Normal file
19
config/runtime/config/obstacle_layer_params.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
obstacle_layer:
|
||||
enabled: true
|
||||
track_unknown_space: true
|
||||
transform_tolerance: 0.2
|
||||
topic: "map"
|
||||
sensor_frame: laser_frame
|
||||
observation_persistence: 0.0
|
||||
expected_update_rate: 0.0
|
||||
data_type: PointCloud
|
||||
min_obstacle_height: 0.0
|
||||
max_obstacle_height: 2.0
|
||||
inf_is_valid: false
|
||||
clearing: false
|
||||
marking: true
|
||||
obstacle_range: 2.5
|
||||
raytrace_range: 3.0
|
||||
footprint_clearing_enabled: true
|
||||
combination_method: 1
|
||||
|
||||
11
config/runtime/config/static_layer_params.yaml
Normal file
11
config/runtime/config/static_layer_params.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
static_layer:
|
||||
enabled: true
|
||||
map_topic: "map"
|
||||
first_map_only: false
|
||||
subscribe_to_updates: false
|
||||
track_unknown_space: true
|
||||
use_maximum: false
|
||||
lethal_cost_threshold: 100
|
||||
unknown_cost_value: -1
|
||||
trinary_costmap: true
|
||||
base_frame_id: "map"
|
||||
15
config/runtime/config/voxel_layer_params.yaml
Normal file
15
config/runtime/config/voxel_layer_params.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
voxel_layer:
|
||||
enabled: true
|
||||
footprint_clearing_enabled: true
|
||||
max_obstacle_height: 3.0
|
||||
origin_z: 0.0
|
||||
z_resolution: 0.2
|
||||
z_voxels: 16
|
||||
unknown_threshold: 15.0
|
||||
mark_threshold: 0
|
||||
combination_method: 1
|
||||
frustum_clearing_enabled: true
|
||||
frustum_clearing_pixel_step: 8
|
||||
frustum_min_range: 0.20
|
||||
frustum_max_range: 3.0
|
||||
frustum_depth_camera_topic: /camera/depth/data
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/costmap_common_params.yaml
|
||||
100
config/runtime/costmap_common_params.yaml
Executable file
100
config/runtime/costmap_common_params.yaml
Executable file
@@ -0,0 +1,100 @@
|
||||
robot_base_frame: base_link
|
||||
transform_tolerance: 1.0
|
||||
performance_metrics_enabled: true
|
||||
performance_metrics_period: 5.0
|
||||
obstacle_range: 3.0
|
||||
#mark_threshold: 1
|
||||
publish_voxel_map: true
|
||||
footprint_padding: 0.0
|
||||
|
||||
navigation_map:
|
||||
map_topic: /map
|
||||
map_pkg: managerments
|
||||
map_file: maze
|
||||
|
||||
virtual_walls_map:
|
||||
map_topic: /map
|
||||
namespace: /virtual_walls
|
||||
map_pkg: managerments
|
||||
map_file: maze
|
||||
use_maximum: true
|
||||
lethal_cost_threshold: 100
|
||||
|
||||
obstacles:
|
||||
observation_sources: b_scan pc_marking pc_clearing pc_r_marking pc_r_clearing
|
||||
# f_scan_marking: f_scan_marking f_scan_clearing
|
||||
# topic: /f_scan
|
||||
# data_type: LaserScan
|
||||
# clearing: false
|
||||
# marking: true
|
||||
# inf_is_valid: true
|
||||
# min_obstacle_height: 0.0
|
||||
# max_obstacle_height: 0.25
|
||||
# f_scan_clearing:
|
||||
# topic: /f_scan
|
||||
# data_type: LaserScan
|
||||
# clearing: true
|
||||
# marking: false
|
||||
# inf_is_valid: true
|
||||
# min_obstacle_height: 0.0
|
||||
# max_obstacle_height: 0.25
|
||||
b_scan:
|
||||
topic: /b_scan
|
||||
data_type: LaserScan
|
||||
clearing: true
|
||||
marking: true
|
||||
inf_is_valid: true
|
||||
frustum_clearing_enabled: false
|
||||
min_obstacle_height: 0.0
|
||||
max_obstacle_height: 0.25
|
||||
|
||||
pc_marking:
|
||||
topic: /camera/depth/points_proc
|
||||
data_type: PointCloud2
|
||||
clearing: false
|
||||
marking: true
|
||||
inf_is_valid: false
|
||||
frustum_clearing_enabled: false
|
||||
observation_persistence: 0.0
|
||||
expected_update_rate: 0.5
|
||||
obstacle_range: 2.5
|
||||
raytrace_range: 3.0
|
||||
min_obstacle_height: 0.1
|
||||
max_obstacle_height: 1.0
|
||||
|
||||
pc_clearing:
|
||||
topic: /camera/depth/data
|
||||
data_type: DepthCameraData
|
||||
clearing: false
|
||||
marking: true
|
||||
frustum_clearing_enabled: true
|
||||
frustum_clearing_pixel_step: 8
|
||||
frustum_min_range: 0.20
|
||||
frustum_max_range: 3.5
|
||||
|
||||
pc_r_marking:
|
||||
topic: /camera_right/depth/points_proc
|
||||
data_type: PointCloud2
|
||||
clearing: false
|
||||
marking: true
|
||||
inf_is_valid: false
|
||||
frustum_clearing_enabled: false
|
||||
observation_persistence: 0.0
|
||||
expected_update_rate: 0.5
|
||||
obstacle_range: 2.5
|
||||
raytrace_range: 3.0
|
||||
min_obstacle_height: 0.1
|
||||
max_obstacle_height: 1.0
|
||||
|
||||
pc_r_clearing:
|
||||
topic: /camera_right/depth/data
|
||||
data_type: DepthCameraData
|
||||
clearing: false
|
||||
marking: true
|
||||
frustum_clearing_enabled: true
|
||||
frustum_clearing_pixel_step: 8
|
||||
frustum_min_range: 0.20
|
||||
frustum_max_range: 3.5
|
||||
|
||||
# Depth camera clearing is handled by VoxelLayer frustum clearing from
|
||||
# /camera/depth/image_raw + /camera/depth/camera_info. /camera_right/depth/data
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/costmap_global_params.yaml
|
||||
15
config/runtime/costmap_global_params.yaml
Executable file
15
config/runtime/costmap_global_params.yaml
Executable file
@@ -0,0 +1,15 @@
|
||||
global_costmap:
|
||||
library_path: libplugins
|
||||
robot_base_frame: base_link
|
||||
global_frame: map
|
||||
update_frequency: 1.0
|
||||
publish_frequency: 1.0
|
||||
raytrace_range: 3.0
|
||||
resolution: 0.05
|
||||
z_resolution: 0.2
|
||||
rolling_window: false
|
||||
z_voxels: 10
|
||||
inflation:
|
||||
cost_scaling_factor: 10.0 # Exponential rate at which the obstacle cost drops off (default: 10). Must be chosen so that the cost value is > 0 at robot's circumscribed radius.
|
||||
inflation_radius: 0.6 # Max. distance from an obstacle at which costs are incurred for planning paths. Must be > robot's circumscribed radius.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/costmap_global_params_plugins_no_virtual_walls.yaml
|
||||
10
config/runtime/costmap_global_params_plugins_no_virtual_walls.yaml
Executable file
10
config/runtime/costmap_global_params_plugins_no_virtual_walls.yaml
Executable file
@@ -0,0 +1,10 @@
|
||||
global_costmap:
|
||||
frame_id: map
|
||||
plugins:
|
||||
- {name: navigation_map, type: "StaticLayer" }
|
||||
# - {name: virtual_walls_map, type: "StaticLayer" }
|
||||
- {name: obstacles, type: "VoxelLayer" }
|
||||
- {name: inflation, type: "InflationLayer" }
|
||||
obstacles:
|
||||
enabled: false
|
||||
footprint_clearing_enabled: true
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/costmap_local_params.yaml
|
||||
18
config/runtime/costmap_local_params.yaml
Executable file
18
config/runtime/costmap_local_params.yaml
Executable file
@@ -0,0 +1,18 @@
|
||||
local_costmap:
|
||||
library_path: libplugins
|
||||
global_frame: odom
|
||||
robot_base_frame: base_link
|
||||
update_frequency: 6.0
|
||||
publish_frequency: 6.0
|
||||
rolling_window: true
|
||||
raytrace_range: 3.0
|
||||
resolution: 0.05
|
||||
z_resolution: 0.15
|
||||
z_voxels: 8
|
||||
inflation:
|
||||
cost_scaling_factor: 10.0 # Exponential rate at which the obstacle cost drops off (default: 10). Must be chosen so that the cost value is > 0 at robot's circumscribed radius.
|
||||
inflation_radius: 0.3 # Max. distance from an obstacle at which costs are incurred for planning paths. Must be > robot's circumscribed radius.
|
||||
width: 8.0
|
||||
height: 8.0
|
||||
origin_x: 0.0
|
||||
origin_y: 0.0
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/costmap_local_params_plugins_no_virtual_walls.yaml
|
||||
9
config/runtime/costmap_local_params_plugins_no_virtual_walls.yaml
Executable file
9
config/runtime/costmap_local_params_plugins_no_virtual_walls.yaml
Executable file
@@ -0,0 +1,9 @@
|
||||
local_costmap:
|
||||
frame_id: odom
|
||||
plugins:
|
||||
# - {name: virtual_walls_map, type: "StaticLayer" }
|
||||
- {name: obstacles, type: "VoxelLayer" }
|
||||
- {name: inflation, type: "InflationLayer" }
|
||||
obstacles:
|
||||
enabled: true
|
||||
footprint_clearing_enabled: true
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/custom_global_params.yaml
|
||||
16
config/runtime/custom_global_params.yaml
Normal file
16
config/runtime/custom_global_params.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
CustomPlanner:
|
||||
library_path: libcustom_planner
|
||||
environment_type: XYThetaLattice
|
||||
planner_type: ARAPlanner
|
||||
allocated_time: 10.0
|
||||
initial_epsilon: 1.0
|
||||
force_scratch_limit: 10000
|
||||
forward_search: false
|
||||
nominalvel_mpersecs: 0.8
|
||||
timetoturn45degsinplace_secs: 1.31 # = 0.6 rad/s
|
||||
allow_unknown: true
|
||||
directory_to_save_paths: "/init/paths"
|
||||
pathway_filename: "pathway.txt"
|
||||
current_pose_topic_name: "/amcl_pose"
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/dock_global_params.yaml
|
||||
11
config/runtime/dock_global_params.yaml
Normal file
11
config/runtime/dock_global_params.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
DockPlanner:
|
||||
library_path: libdock_planner
|
||||
MyGlobalPlanner:
|
||||
cost_threshold: 200 # Ngưỡng chi phí vật cản (0-255)
|
||||
safety_distance: 2 # Khoảng cách an toàn (cells)
|
||||
use_dijkstra: false # Sử dụng Dijkstra thay vì A*
|
||||
|
||||
# File: config/costmap_params.yaml
|
||||
global_costmap:
|
||||
inflation_radius: 0.3 # Bán kính phình vật cản
|
||||
cost_scaling_factor: 10.0 # Hệ số tỷ lệ chi phí
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/hybrid_local_planner_params.yaml
|
||||
55
config/runtime/hybrid_local_planner_params.yaml
Normal file
55
config/runtime/hybrid_local_planner_params.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
HybridLocalPlanner:
|
||||
# base_local_planner: "hybrid_local_planner/HybridLocalPlanner"
|
||||
# HybridLocalPlanner:
|
||||
library_path: libhybrid_local_planner
|
||||
# Robot
|
||||
max_forward_velocity: 1.0
|
||||
max_reverse_velocity: 0.25 # [m/s], positive magnitude
|
||||
avoidance_max_velocity: 0.4
|
||||
max_angular_velocity: 0.6
|
||||
min_in_place_angular_velocity: 0.3
|
||||
acc_lim_x: 0.1
|
||||
decel_lim_x: 0.5
|
||||
acc_lim_theta: 2.0
|
||||
min_turn_radius: 0.0
|
||||
robot_radius: 0.1
|
||||
footprint_padding: 0.08
|
||||
use_footprint: true
|
||||
|
||||
# GoalTolerance
|
||||
xy_goal_tolerance: 0.02
|
||||
yaw_goal_tolerance: 0.02
|
||||
|
||||
# Trajectory
|
||||
max_global_plan_lookahead_dist: 3.0
|
||||
global_plan_viapoint_sep: 0.5
|
||||
global_plan_goal_sep: 0.05
|
||||
predict_time: 3.0
|
||||
sim_period: 0.1
|
||||
sim_time_samples: 10
|
||||
|
||||
# Optimization
|
||||
w_omega: 2.5
|
||||
obs_cost_gain: 1.3
|
||||
path_cost_gain: 0.5
|
||||
to_goal_cost_gain: 0.8
|
||||
speed_cost_gain: 0.5
|
||||
|
||||
# Obstacles
|
||||
obs_range: 2.5
|
||||
|
||||
#GeneralSetting
|
||||
segment_transition_threshold: 0.03 # [m], also used as DWA stop distance for intermediate segments
|
||||
rotation_segment_yaw_threshold: 0.05 # [rad], ignore tiny yaw noise at duplicate positions
|
||||
direction_change_hysteresis: 0.15 # normalized dot product
|
||||
use_obstacle_avoidance: true
|
||||
slow_velocity_th: 0.1
|
||||
turn_direction_th: 0.1
|
||||
avoidance_clear_hold_time: 0.5 # [s]
|
||||
rejoin_blend_time: 0.8 # [s]
|
||||
rejoin_max_velocity: 0.25 # [m/s]
|
||||
rejoin_heading_tolerance: 0.35 # [rad]
|
||||
rejoin_path_tolerance: 0.20 # [m]
|
||||
pp_max_omega_correction: 0.15 # [rad/s]
|
||||
rejoin_acc_lim_theta: 1.0 # [rad/s^2]
|
||||
rejoin_lookahead_distance: 0.8 # [m]
|
||||
@@ -1,14 +1,31 @@
|
||||
# Compatibility allow-list for BaseNavigation::dockTo(marker, ...).
|
||||
# =================================================================================================
|
||||
# move_base2 — danh sách marker docking hợp lệ và cặp planner riêng của từng marker.
|
||||
#
|
||||
# move_base2 docking resolves `goal_frame` to an absolute pose and runs DockPlanner +
|
||||
# HybridLocalPlanner. It does not consume the legacy per-marker PNKXDockingLocalPlanner
|
||||
# parameters (plugins, maker_goal_frame, delay, timeout, velocity, tolerance, or lookahead).
|
||||
# Keep only the marker names that the host may submit until `dockTo` is migrated to
|
||||
# declarative dock_sequences.
|
||||
# Quy ước comment: dòng mô tả = LÀ GÌ / vì sao; `► Chỉnh:` = sửa thế nào cho đúng.
|
||||
#
|
||||
# Danh sách cho phép, dùng cho `BaseNavigation::dockTo(marker, ...)`.
|
||||
#
|
||||
# move_base2 docking quy `goal_frame` thành pose TUYỆT ĐỐI rồi chạy DockPlanner + local planner
|
||||
# docking. Nó KHÔNG đọc bộ tham số per-marker của PNKXDockingLocalPlanner cũ (plugins,
|
||||
# maker_goal_frame, delay, timeout, velocity, tolerance, lookahead) — những khoá đó nếu còn sót lại
|
||||
# ở đâu đó cũng không có tác dụng.
|
||||
# =================================================================================================
|
||||
|
||||
# Marker mà host được phép gửi xuống. Đây là ALLOW-LIST: tên không có trong dòng này bị từ chối
|
||||
# ngay tại `dockTo`, không đi tới planner.
|
||||
#
|
||||
# ► Chỉnh: chỉ thêm/bớt TÊN, cách nhau bằng khoảng trắng. Giữ danh sách tối thiểu — mỗi tên thừa là
|
||||
# một đường vào chưa được kiểm chứng. Sẽ bỏ hẳn khi `dockTo` được chuyển sang dock_sequences khai
|
||||
# báo trong compound_actions_params.yaml.
|
||||
maker_sources: trolley charger dock_station undock_station dock_station_2 undock_station_2
|
||||
|
||||
# Marker có entry ở đây dùng cặp planner riêng. Marker rỗng hoặc chỉ có trong `maker_sources` mà
|
||||
# không nằm trong bảng này sẽ dùng cặp `docking` mặc định của move_base_common_params.yaml.
|
||||
# Marker có entry ở đây dùng CẶP PLANNER RIÊNG. Marker rỗng, hoặc chỉ có trong `maker_sources` mà
|
||||
# không nằm trong bảng này, sẽ dùng cặp `docking` mặc định của move_base_common_params.yaml.
|
||||
#
|
||||
# ► Chỉnh: chỉ khai marker nào THỰC SỰ cần planner khác mặc định — ba entry dưới đây đang trùng y
|
||||
# hệt cặp mặc định, tức chúng không đổi hành vi gì, giữ lại chỉ để làm chỗ móc khi cần tách sau
|
||||
# này. Tham số của planner nằm ở YAML riêng của plugin (dock_global_params.yaml,
|
||||
# hybrid_local_planner_params.yaml), KHÔNG khai ở đây.
|
||||
docking_marker_profiles:
|
||||
trolley:
|
||||
global_planner: DockPlanner
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/mission_adapters_params.yaml
|
||||
78
config/runtime/mission_adapters_params.yaml
Normal file
78
config/runtime/mission_adapters_params.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
# =================================================================================================
|
||||
# mission_adapters — tham số RUNTIME của mission layer.
|
||||
#
|
||||
# Quy ước comment: dòng mô tả = LÀ GÌ / vì sao; `► Chỉnh:` = tăng giảm theo triệu chứng nào.
|
||||
#
|
||||
# Mission layer đứng GIỮA nguồn nhiệm vụ (VDA5050 Order, goal trần) và navigation: nó cắt order
|
||||
# thành từng CHẶNG tại mỗi node có action, chỉ chạy phần `released`, nối tiếp theo `orderUpdateId`
|
||||
# thay vì chạy lại từ đầu, và giữ hàng đợi chặng.
|
||||
#
|
||||
# Đây là bản đang có hiệu lực. Bản trong `Test/mission_adapters/test/config/` chỉ phục vụ test và
|
||||
# chỉ được đọc khi chạy kèm PNKX_NAV_CORE_CONFIG_DIR trỏ vào đúng thư mục đó.
|
||||
#
|
||||
# Bật/tắt cả tầng này bằng `mission_layer_enabled` trong `move_base_common_params.yaml`.
|
||||
# =================================================================================================
|
||||
|
||||
mission_adapters:
|
||||
# Nguồn mission. Thêm một loại nguồn mới = thêm một entry ở đây + một plugin .so, không phải sửa
|
||||
# code của gói.
|
||||
# name: tên instance, cũng là namespace param riêng của nó
|
||||
# type: tên symbol export bằng BOOST_DLL_ALIAS, phải có khoá library_path tương ứng bên dưới
|
||||
#
|
||||
# goal_src : goal trần từ host (không có edge) — dùng khi test bằng RViz/sim.
|
||||
# vda5050_src : Order VDA5050 đầy đủ (node + edge + action), đường chạy production.
|
||||
#
|
||||
# ► Chỉnh: bỏ bớt một nguồn = tắt đường vào tương ứng. Bỏ HẾT thì runtime tự quay về đường trực
|
||||
# tiếp (như `mission_layer_enabled: false`) kèm log cảnh báo — thiếu plugin không được phép biến
|
||||
# thành robot đứng im không rõ lý do.
|
||||
mission_sources:
|
||||
- {name: goal_src, type: GoalSourceAdapter}
|
||||
- {name: vda5050_src, type: VDA5050SourceAdapter}
|
||||
|
||||
# [s] Trần thời gian cho MỘT chặng (navigation + action), tính từ lúc chặng được giao.
|
||||
# 0 = tắt. Quá hạn thì chặng bị đánh dấu thất bại VÀ navigation được bảo dừng — lưới cuối cho
|
||||
# trường hợp navigation không bao giờ báo kết quả về.
|
||||
#
|
||||
# ► Chỉnh: đây là lưới an toàn CUỐI CÙNG, không phải cơ chế timeout chính (mỗi action handler đã
|
||||
# tự timeout, và navigation có `planner_patience`/`controller_patience`).
|
||||
# - Bật (vd 120–300 s) khi cần chắc chắn fleet luôn nhận được kết quả chặng.
|
||||
# - Đặt phải LỚN HƠN chặng dài nhất cộng toàn bộ thời gian recovery có thể xảy ra, nếu không
|
||||
# robot đang phục hồi bình thường sẽ bị cắt ngang và báo fail oan.
|
||||
mission_timeout: 0.0
|
||||
|
||||
# Một chặng thất bại thì xử lý phần còn lại của hàng đợi thế nào.
|
||||
# true = xoá sạch hàng đợi (mặc định, an toàn cho tuyến đường tuần tự kiểu VDA5050: không tới
|
||||
# được node n thì chạy tiếp chặng n+1 là cắt ngang đoạn chưa được cho phép đi)
|
||||
# false = chỉ bỏ chặng lỗi rồi chạy tiếp.
|
||||
#
|
||||
# ► Chỉnh: chỉ đặt false khi các mission trong hàng đợi ĐỘC LẬP với nhau, không phải các chặng của
|
||||
# cùng một tuyến. Với compound action (charge/PickUp) thì BẮT BUỘC true: nó chính là thứ ngăn
|
||||
# robot chạy bước `startCharging`/`LiftFork` khi bước dò hoặc bước tiến vào đã hỏng.
|
||||
clear_queue_on_failure: true
|
||||
|
||||
# =================================================================================================
|
||||
# Param riêng của từng instance nguồn mission, đặt theo `name` khai ở `mission_sources`.
|
||||
# =================================================================================================
|
||||
vda5050_src:
|
||||
# Frame gán cho goal/start sinh ra từ nodePosition của VDA5050.
|
||||
# Lưu ý: `mapId` trong VDA5050 là danh tính bản đồ, KHÔNG phải frame TF, nên không dùng làm frame.
|
||||
#
|
||||
# ► Chỉnh: phải khớp `global_frame` của costmap global. Sai frame ở đây thì mọi goal lệch vị trí
|
||||
# hoặc TF không quy đổi được, và lỗi hiện ra ở tận tầng planner nên rất khó truy.
|
||||
global_frame: map
|
||||
|
||||
# Bảng compound action (`charge`, `PickUp`, ...) KHÔNG khai ở đây mà ở
|
||||
# `Test/move_base2/config/runtime/compound_actions_params.yaml` — file đó cũng dùng khoá
|
||||
# `vda5050_src` và được `robot::NodeHandle` GỘP vào chung một cây. Tách file vì file này là
|
||||
# symlink sang submodule `pnkx_nav_core`.
|
||||
|
||||
# Bảng symbol -> thư viện cho Boost.DLL. KHÔNG phải tham số tinh chỉnh.
|
||||
#
|
||||
# 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". Tên không có đuôi .so được resolve qua PNKX_NAV_CORE_LIBRARY_PATH / devel/lib /
|
||||
# LD_LIBRARY_PATH — tức phải `source devel/setup.bash` trước khi chạy.
|
||||
GoalSourceAdapter:
|
||||
library_path: libmission_adapters_goal_source
|
||||
|
||||
VDA5050SourceAdapter:
|
||||
library_path: libmission_adapters_vda5050_source
|
||||
@@ -1,12 +1,35 @@
|
||||
# Cặp global/local planner của từng kiểu chuyển động. move_base2 nạp trực tiếp
|
||||
# `robot_nav_core2::LocalPlanner`; không dùng LocalPlannerAdapter (bridge chỉ dành cho move_base cũ).
|
||||
# =================================================================================================
|
||||
# move_base2 — tham số lõi của navigation runtime.
|
||||
#
|
||||
# Quy ước comment trong file này:
|
||||
# • dòng mô tả = tham số đó LÀ GÌ và vì sao tồn tại
|
||||
# • `► Chỉnh:` = tăng/giảm theo triệu chứng nào, miền giá trị, và tương tác với tham số khác
|
||||
#
|
||||
# Đọc file này cùng `recovery_behaviors_params.yaml` (recovery gen-2) và
|
||||
# `mission_adapters_params.yaml` (mission layer) — ba file cùng mô tả một luồng chạy.
|
||||
#
|
||||
# `robot::NodeHandle` GỘP mọi file YAML trong thư mục config thành một cây. Trùng khoá giữa hai file
|
||||
# là lỗi khó thấy nhất ở đây: file khớp trước thắng. Đặt tên khoá cho riêng biệt.
|
||||
# =================================================================================================
|
||||
|
||||
# --- Cặp planner của từng kiểu chuyển động -------------------------------------------------------
|
||||
#
|
||||
# move_base2 nạp trực tiếp `robot_nav_core2::LocalPlanner`; không dùng LocalPlannerAdapter (bridge
|
||||
# chỉ dành cho move_base cũ).
|
||||
#
|
||||
# ► Chỉnh: đây là lựa chọn KIẾN TRÚC, không phải số tinh chỉnh. Đổi tên planner ở đây thì tham số
|
||||
# của planner đó nằm ở YAML riêng của nó (symlink từ pnkx_nav_core/config/), và phải có khoá
|
||||
# `library_path` tương ứng, nếu không runtime báo "không tìm thấy plugin".
|
||||
position:
|
||||
global_planner: CustomPlanner
|
||||
global_planner: CustomPlanner # vật chất hoá tuyến NURBS từ edge của VDA5050 Order.
|
||||
# MÙ VẬT CẢN theo thiết kế — nó là route materializer, không
|
||||
# phải search planner. Chỉ có bản makePlan(Order, ...).
|
||||
local_planner: PriestLocalPlanner
|
||||
|
||||
docking:
|
||||
# goal_frame đã được ControlLoop quy thành pose tuyệt đối. DockPlanner dùng đúng contract
|
||||
# makePlan(start, goal, plan), còn CustomPlanner chỉ xử lý makePlan(Order, start, goal, plan).
|
||||
# đây là config default sẽ được dùng nếu config theo từng maker docking ở file maker_sources.yaml bị bỏ trống
|
||||
global_planner: DockPlanner
|
||||
local_planner: HybridLocalPlanner
|
||||
|
||||
@@ -22,71 +45,222 @@ rotate:
|
||||
# planner này đúng MỘT lần cho request hiện tại. Backup cũng fail thì mới chạy recovery; request mới
|
||||
# luôn bắt đầu lại từ planner chính. Backup gọi makePlan(start, goal, plan), không mang VDA5050
|
||||
# Order, để SBPLLatticePlanner (chỉ có overload ba tham số) dùng được.
|
||||
#
|
||||
# ► Chỉnh: để rỗng = tắt đường lùi (mọi lỗi planner đi thẳng vào recovery). Giữ SBPL trừ khi có
|
||||
# planner khác vừa chấp nhận contract 3 tham số vừa tránh được vật cản.
|
||||
# ► Lưu ý vận hành: khi order KHÔNG có edge (goal trần), CustomPlanner fail và runtime luôn rơi về
|
||||
# backup này. Tức trên sim goal-trần, plan thực tế do SBPL sinh chứ không phải NURBS — mật độ pose
|
||||
# và hình học khác production. Đừng tinh chỉnh tham số tuyến chỉ dựa trên sim goal-trần.
|
||||
backup_global_planner: SBPLLatticePlanner
|
||||
|
||||
# Compound docking quy `goal_frame` thành pose tuyệt đối; HybridLocalPlanner không đọc maker_name.
|
||||
# `true` chỉ dành cho PNKXDockingLocalPlanner legacy, vốn phải chọn marker trước initialize().
|
||||
#
|
||||
# ► Chỉnh: giữ false cho move_base2. Đặt true chỉ khi quay lại dùng local planner docking legacy.
|
||||
docking_requires_marker: false
|
||||
|
||||
# Bảng `library_path` và tham số riêng của CustomPlanner, DockPlanner, TwoPointsPlanner cùng các
|
||||
# local planner nằm trong các YAML runtime đồng hành (symlink từ pnkx_nav_core/config/). Không lặp
|
||||
# lại chúng ở đây để tránh hai nguồn cấu hình cho cùng một plugin.
|
||||
|
||||
### replanning (contract 2026-08-04 — tách replan nền khỏi recovery)
|
||||
controller_frequency: 30.0 # [Hz] nhịp control loop
|
||||
# =================================================================================================
|
||||
# Nhịp điều khiển và các đồng hồ kiên nhẫn (contract 2026-08-04 — tách replan nền khỏi recovery)
|
||||
# =================================================================================================
|
||||
|
||||
# [Hz] Nhịp control loop: đọc pose, chạy state machine, gọi controller, phát cmd_vel.
|
||||
# ► Chỉnh: phải >= nhịp mà local planner giải xong một lần. Priest/Hybrid solve ~30 ms nên 30 Hz là
|
||||
# sát trần — nếu log hiện nhiều dòng "solve took ... (limit ...)" thì HẠ xuống 20 Hz thay vì ép
|
||||
# planner chạy nhanh hơn. Tăng lên >30 chỉ có nghĩa khi controller thật sự rẻ hơn 1/f giây.
|
||||
controller_frequency: 30.0
|
||||
|
||||
# [s] Controller không ra lệnh (kể cả mất pose) thì robot DỪNG TẠI CHỖ và vẫn ở CONTROLLING;
|
||||
# quá controller_patience mới vào RECOVERING(controlling_failed). Không còn nhánh "hỏng một cycle
|
||||
# là nhảy về PLANNING" — replan trong lúc chạy là việc của planner_frequency bên dưới.
|
||||
#
|
||||
# ► Chỉnh: giá trị hiện tại = ĐÚNG MỘT chu kỳ 30 Hz, tức "mất lệnh một nhịp là leo thang ngay".
|
||||
# - TĂNG (vd 0.5–1.0 s) nếu robot vào recovery quá nhạy ở khúc cua gắt hoặc lúc local planner
|
||||
# thỉnh thoảng trượt một nhịp — đây là chỉnh thường gặp nhất.
|
||||
# - GIẢM chỉ khi muốn phản ứng cực nhanh và chắc chắn controller không bao giờ trượt nhịp.
|
||||
# - <= 0 = tắt hẳn, KHÔNG khuyến nghị: controller chết vĩnh viễn sẽ không ai phát hiện.
|
||||
controller_patience: 0.033333333
|
||||
|
||||
# [s] Trần cho chuỗi cycle costmap STALE liên tục ở CONTROLLING (2026-08-05). Costmap quá hạn thì
|
||||
# controller bị SKIP — data outage, không phải controller bất lực, nên controller_patience bị ĐÓNG
|
||||
# BĂNG trong lúc đó (33 ms đo outage là đo sai thứ: sim ABORT sau một cycle stale trong khi costmap
|
||||
# chỉ cần ~0.5 s để hồi). Stale liên tục quá trần này mới controlling_failed. 0 = tắt (hành vi cũ).
|
||||
#
|
||||
# ► Chỉnh: đặt >= vài lần chu kỳ cập nhật costmap chậm nhất. Costmap local 6 Hz + buffer sensor
|
||||
# 0.5 s ⇒ 2.0 s là ~4 lần dư địa.
|
||||
# - TĂNG nếu log hiện `controlling_failed` kèm "Sensor data is stale" mà sensor vẫn sống (mạng
|
||||
# lag, CPU nghẽn).
|
||||
# - GIẢM nếu muốn phát hiện mất sensor thật nhanh hơn — nhưng dưới 1.0 s sẽ bắt oan các nhịp
|
||||
# miss lẻ tẻ.
|
||||
sensor_patience: 2.0
|
||||
|
||||
# [Hz] Replan NỀN khi đang CONTROLLING: lập plan bất đồng bộ trên thread planner, plan mới về thì
|
||||
# thay ngay mà không đổi state, không dừng robot. Replan nền thất bại thì giữ plan cũ, không kích
|
||||
# backup planner, không vào recovery. 0 = tắt (chỉ lập plan khi state machine yêu cầu).
|
||||
#
|
||||
# ► Chỉnh: GIỮ 0 trong kiến trúc hiện tại. Ba lý do độc lập (xem TRAP_DETECTION_PLAN.md):
|
||||
# 1. `CustomPlanner` là route materializer, lập lại cho ra ĐÚNG tuyến cũ — lưới nào cũng vậy;
|
||||
# 2. tuyến cũ đang bị chắn nên luật plan-filter loại nó ⇒ kFailed lặp mỗi chu kỳ, tốn CPU vô ích;
|
||||
# 3. SBPL full-mission đo được 0.09–0.29 s/lượt ⇒ 1 Hz ăn 9–29% một core liên tục.
|
||||
# Chỉ bật (0.5–1.0) nếu sau này global planner vừa tránh được vật cản vừa đủ nhanh (~30 ms).
|
||||
planner_frequency: 0.0
|
||||
planner_patience: 2.0 # [s] ở PLANNING quá lâu không có plan -> recovery (mất pose ở PLANNING
|
||||
# dùng ngân sách controlling_failed, xem recovery_behaviors_params)
|
||||
max_planning_retries: 0 # số lần lập plan HỎNG liên tiếp được phép; 0 = hỏng một lượt là leo thang
|
||||
oscillation_timeout: -1 # [s] <= 0: tắt phát hiện quẩn
|
||||
oscillation_distance: 0.5 # [m] đi quá quãng này: hết bị coi là quẩn VÀ reset ngân sách recovery
|
||||
|
||||
### giám sát tuyến (2026-08-04d)
|
||||
# [s] Ở PLANNING quá lâu mà chưa có plan -> recovery. Mất pose ngay trong PLANNING dùng ngân sách
|
||||
# `controlling_failed` (xem recovery_behaviors_params.yaml).
|
||||
# ► Chỉnh: đặt > thời gian lập plan xấu nhất của global planner. SBPL `allocated_time: 10.0` ở
|
||||
# sbpl_global_params.yaml ⇒ 2.0 s là NGẮN HƠN trần của chính planner: nếu thấy leo thang trong khi
|
||||
# planner vẫn đang chạy, tăng giá trị này lên trên trần đó.
|
||||
planner_patience: 2.0
|
||||
|
||||
# Số lần lập plan HỎNG liên tiếp được phép trước khi leo thang. 0 = hỏng một lượt là leo thang ngay.
|
||||
# ► Chỉnh: TĂNG (1–3) nếu planner thỉnh thoảng fail do costmap chưa kịp cập nhật lúc vừa nhận goal.
|
||||
# < 0 = không giới hạn — chỉ an toàn khi `planner_patience > 0`, nếu không planner treo sẽ không
|
||||
# ai phát hiện (config validate chặn ca tắt cả hai).
|
||||
max_planning_retries: 0
|
||||
|
||||
# [s] Ở trong bán kính `oscillation_distance` quá lâu = coi là quẩn -> recovery `oscillation`.
|
||||
# ► Chỉnh: <= 0 là TẮT (giá trị hiện tại). Bật (vd 10–20 s) khi thấy robot lắc qua lắc lại tại chỗ
|
||||
# mà không trigger nào khác bắt được. Bật thì `oscillation_distance` bắt buộc phải > 0.
|
||||
oscillation_timeout: -1
|
||||
|
||||
# [m] Đi được quá quãng này thì: hết bị coi là quẩn, VÀ mọi cursor route recovery được reset, VÀ
|
||||
# trigger giám sát tuyến đang bị khoá được mở lại (contract 2026-08-05e).
|
||||
# ► Chỉnh: đây là định nghĩa "có tiến độ thật". GIẢM (0.2–0.3) nếu robot ở khu chật ít khi đi nổi
|
||||
# 0.5 m nên ngân sách recovery không bao giờ nạp lại. TĂNG nếu recovery được nạp lại quá dễ dãi
|
||||
# và robot cứ thử vô hạn thay vì báo lỗi lên fleet.
|
||||
oscillation_distance: 0.5
|
||||
|
||||
# =================================================================================================
|
||||
# Giới hạn vận tốc — hàng rào CUỐI trước khi Twist rời runtime (VelocityArbiter)
|
||||
#
|
||||
# Đây KHÔNG phải bộ điều khiển. Local planner đã có trần riêng trong YAML của nó; arbiter chỉ chặn
|
||||
# lệnh vô lý từ BẤT KỲ nguồn nào, kể cả recovery behavior nạp từ plugin ngoài. Hệ quả bắt buộc:
|
||||
# mọi trần ở đây phải NỚI HƠN trần tương ứng của planner một khoảng margin. Đặt sát hoặc chặt hơn
|
||||
# sẽ tái sinh đúng hai lỗi đã đo: acc_lim_x chặt hơn `goal_decel_limit` làm mềm cú phanh (trượt
|
||||
# đích), acc_lim_theta chặt hơn `max_steer_rate` tạo slew kép trên lệnh lái.
|
||||
#
|
||||
# Không khai các khoá này thì code rơi về default hard-code trong velocity_arbiter.h
|
||||
# (twist / 0.5 / -0.2 / 1.0 / 1.0 / 2.0) — trần 1.0 đã từng cắt cụt lệnh pivot 1.5708 rad.
|
||||
# =================================================================================================
|
||||
|
||||
# Twist đi qua arbiter mang NGHĨA gì. Quyết định ĐƠN VỊ của cả cụm trần bên dưới.
|
||||
# twist : chuẩn ROS — linear.x = vận tốc base [m/s], angular.z = tốc độ quay [rad/s].
|
||||
# steering : robot lái một bánh (bicycle) — linear.x = vận tốc BÁNH STEER [m/s],
|
||||
# angular.z = GÓC lái [rad]. Bật thì arbiter kiểm theo đơn vị góc và HÉT LÊN
|
||||
# (log_error + đếm `steeringAngleClamps`) mỗi khi lệnh đánh lái bị cắt, đồng thời
|
||||
# validate() chặn boot nếu `max_vel_theta > pi` (dấu hiệu chọn nhầm semantics).
|
||||
#
|
||||
# ► Chỉnh: đang để `twist` vì recovery behavior xoay tại chỗ phát angular.z theo rad/s — đổi sang
|
||||
# `steering` là đổi nghĩa cho CẢ recovery, nên chỉ đổi khi robot thật sự là bicycle VÀ route
|
||||
# recovery đã bỏ/thay hành vi xoay tại chỗ (bicycle không xoay tại chỗ được).
|
||||
# Riêng việc chạy được bicycle thì `max_vel_theta` bên dưới đã đủ: 1.5708 không còn bị cắt.
|
||||
command_semantics: twist
|
||||
|
||||
# [m/s] Trần tốc độ tiến (semantics `steering`: tốc độ bánh steer). Phải > max_vel_x của local
|
||||
# planner đang chạy — stanley 0.50, pnkx 1.2.
|
||||
# ► Chỉnh: nới thêm ~20% so với planner nhanh nhất được phép chạy. Hạ xuống dưới trần planner là
|
||||
# cắt cụt lệnh mỗi cycle mà planner không hề biết.
|
||||
max_vel_x: 0.60
|
||||
|
||||
# [m/s] Trần tốc độ lùi, ÂM. 0 = cấm lùi hẳn. Stanley min_vel_x = -0.25.
|
||||
# ► Chỉnh: giữ âm hơn trần lùi của planner. Đặt 0 khi robot không có cảm biến phía sau.
|
||||
min_vel_x: -0.30
|
||||
|
||||
# semantics `twist` : [rad/s] trần tốc độ quay.
|
||||
# semantics `steering`: [rad] giới hạn CƠ KHÍ của góc lái.
|
||||
# 1.5708 rad = 90 deg = đúng `steer_limit_standstill` / `align_steer_angle` của stanley. Đây là
|
||||
# con số quan trọng nhất của khối này: default cũ 1.0 kẹp lệnh pivot 1.5708 còn 57.3 deg, robot
|
||||
# không bao giờ đạt góc align và kẹt vĩnh viễn ở pha xoay.
|
||||
# ► Chỉnh: phải >= `align_steer_angle` của local planner. Ghi số thật, KHÔNG viết `M_PI / 2.0` —
|
||||
# parser không evaluate biểu thức.
|
||||
max_vel_theta: 1.5708
|
||||
|
||||
# [m/s^2] Trần biến thiên tốc độ dài, áp cho cả tăng lẫn giảm.
|
||||
# ► Chỉnh: phải > `goal_decel_limit` của planner (stanley 0.40), nếu không arbiter làm mềm cú
|
||||
# phanh về đích và robot trượt quá goal.
|
||||
acc_lim_x: 1.0
|
||||
|
||||
# semantics `twist` : [rad/s^2] trần biến thiên tốc độ quay.
|
||||
# semantics `steering`: [rad/s] trần TỐC ĐỘ đánh lái.
|
||||
# ► Chỉnh: phải >= tốc độ servo thật VÀ >= `max_steer_rate` của planner (stanley 1.00, servo đo
|
||||
# được đỉnh 1.08–1.35). 1.20 là mức nới tối thiểu; chặt hơn sẽ tạo slew kép chồng lên slew của
|
||||
# chính planner, lệnh lái trễ pha và bám line xấu đi.
|
||||
acc_lim_theta: 1.20
|
||||
|
||||
# =================================================================================================
|
||||
# Giám sát tuyến (contract 2026-08-04d)
|
||||
#
|
||||
# Hai phép đo chạy trong lúc robot bám plan, cùng một kết cục: robot DỪNG rồi chạy recovery của
|
||||
# trigger tương ứng (`path_blocked` / `off_path` trong recovery_behaviors_params.yaml).
|
||||
# - tuyến phía trước bị chắn -> khai hoả `path_blocked`
|
||||
# - robot đã lệch khỏi plan -> khai hoả `off_path`
|
||||
#
|
||||
# Hai nút tắt độc lập, cố ý: `enabled: false` ở đây, HOẶC route tương ứng rỗng bên recovery. Cả hai
|
||||
# đều đưa hành vi về đúng như trước khi có cơ chế này.
|
||||
# MỖI phép đo có BA nút độc lập và phải đủ CẢ BA mới sống:
|
||||
# (1) cờ riêng ở đây, (2) ngưỡng của nó > 0, (3) route tương ứng bên recovery khác rỗng.
|
||||
# =================================================================================================
|
||||
path_monitor:
|
||||
enabled: true # công tắc CHUNG; tắt cái này là tắt cả hai phép đo bên dưới
|
||||
# Công tắc CHUNG; tắt cái này là tắt cả hai phép đo bên dưới.
|
||||
# ► Chỉnh: false = đưa hành vi về đúng như trước 2026-08-04d (chỉ còn controller_patience lo).
|
||||
# Dùng làm đường lùi nhanh khi nghi cơ chế giám sát gây vấn đề ngoài hiện trường.
|
||||
enabled: true
|
||||
|
||||
# Công tắc RIÊNG từng phép đo (2026-08-06). Trước đây chỉ tắt được bằng cách đặt ngưỡng về 0 —
|
||||
# giá trị ma, lẫn với "quên khai". Mỗi phép đo giờ có ba nút độc lập và phải đủ CẢ BA mới sống:
|
||||
# cờ này, ngưỡng của nó (horizon / max_cross_track > 0), và route tương ứng khác rỗng.
|
||||
# giá trị ma, lẫn với "quên khai".
|
||||
# ► Chỉnh: hạ cờ để tắt mà VẪN GIỮ ngưỡng đã đo được — bật lại chỉ sửa một dòng.
|
||||
path_blocked_enabled: true
|
||||
off_path_enabled: false # tắt tường minh: max_cross_track chưa đo được nên chưa có ngưỡng thật
|
||||
check_period: 0.2 # [s] nhịp quét; KHÔNG quét mỗi control cycle (30 Hz) — quá phí
|
||||
confirm_time: 0.5 # [s] điều kiện phải đúng liên tục chừng này mới khai hoả
|
||||
profiles: [position] # docking/go_straight/rotate KHÔNG được detour: đường cong vào dock là
|
||||
# một thể thống nhất, cắt ghép nó là phá chính hình học đó
|
||||
|
||||
# -- Phép đo 1: tuyến phía trước bị chắn --
|
||||
horizon: 3.0 # [m] quét trên costmap local (cửa sổ 8x8 m) nên phải <= ~4 m
|
||||
min_detour_distance: 0.5 # [m] vật cản gần hơn thì KHÔNG khai hoả: detour từ sát nách hầu như
|
||||
# không ra nghiệm, và ca đó đã có controller_patience lo
|
||||
# [s] Nhịp quét costmap. KHÔNG quét mỗi control cycle (30 Hz) — quá phí.
|
||||
# ► Chỉnh: đặt ~= chu kỳ cập nhật costmap local (6 Hz ⇒ 0.17 s). Nhỏ hơn thế là quét lại cùng một
|
||||
# dữ liệu. TĂNG nếu CPU căng; đổi lại phản ứng chậm đi đúng chừng đó.
|
||||
check_period: 0.2
|
||||
|
||||
# -- Phép đo 2: robot lệch khỏi plan --
|
||||
# 0 = TẮT. Bật sau khi đo sai số bám cua thật của HybridController trên sim: khúc cua gắt làm
|
||||
# cross-track tăng tự nhiên, đặt số mò là robot dừng oan giữa đường cong.
|
||||
max_cross_track: 0.0 # [m]
|
||||
grace_after_new_plan: 1.0 # [s] bỏ qua ngay sau khi đổi plan (lúc preempt pose có thể lệch nhất thời)
|
||||
# [s] Điều kiện phải đúng LIÊN TỤC chừng này mới khai hoả (chống nhiễu một nhịp).
|
||||
# ► Chỉnh: TĂNG (0.8–1.5) nếu người đi ngang qua làm robot dừng oan. GIẢM nếu robot phản ứng quá
|
||||
# chậm với vật cản thật. Phải >= vài lần `check_period`, nếu không debounce vô nghĩa.
|
||||
confirm_time: 0.5
|
||||
|
||||
# Profile được giám sát. docking/go_straight/rotate KHÔNG được detour: đường cong vào dock là một
|
||||
# thể thống nhất, cắt ghép nó là phá chính hình học đó.
|
||||
# ► Chỉnh: gần như luôn để `[position]`. Thêm profile khác chỉ khi profile đó dùng tuyến tự do.
|
||||
profiles: [position]
|
||||
|
||||
# -- Phép đo 1: tuyến phía trước bị chắn --------------------------------------------------------
|
||||
|
||||
# [m] Quãng tuyến phía trước cần quét.
|
||||
# ► Chỉnh: phải <= nửa cửa sổ costmap local (8x8 m ⇒ ~4 m), ngoài đó không có dữ liệu.
|
||||
# - TĂNG (tới ~3.5) để phát hiện sớm hơn, có nhiều chỗ hơn để lập đường vòng;
|
||||
# - GIẢM (1.5–2.0) nếu robot dừng quá sớm trước vật cản mà local planner tự lách được.
|
||||
horizon: 3.0
|
||||
|
||||
# [m] Vật cản gần hơn mức này thì KHÔNG khai hoả: detour từ sát nách hầu như không ra nghiệm, và
|
||||
# ca đó đã có controller_patience lo.
|
||||
# ► Chỉnh: đặt ~= bán kính ngoại tiếp footprint + dư địa (footprint 0.6x0.6 ⇒ ~0.42 m). TĂNG nếu
|
||||
# thấy nhiều lượt detour `Solution not found` với vật cản rất gần.
|
||||
min_detour_distance: 0.5
|
||||
|
||||
# -- Phép đo 2: robot lệch khỏi plan ------------------------------------------------------------
|
||||
|
||||
# [m] Lệch khỏi plan ĐANG CHẠY quá mức này thì khai hoả. Đo với plan đang chạy chứ không phải
|
||||
# tuyến gốc — sau một lượt detour hợp lệ, plan đang chạy CHÍNH LÀ đường vòng nên không báo oan.
|
||||
# (Ràng buộc "lệch bao nhiêu so với tuyến fleet" là việc của `max_deviation` bên detour.)
|
||||
# ► Chỉnh: 0 = TẮT (hiện tại). Cách đặt đúng: chạy sim/robot qua các khúc cua gắt nhất của tuyến,
|
||||
# ghi cross-track đỉnh, rồi đặt ~1.5–2 lần giá trị đó. Đặt số mò là robot dừng oan giữa đường
|
||||
# cong. Bật thì nhớ bật cả `off_path_enabled`.
|
||||
max_cross_track: 0.0
|
||||
|
||||
# [s] Bỏ qua phép đo lệch tuyến ngay sau khi nhận plan mới — lúc preempt/đổi chặng pose robot có
|
||||
# thể lệch nhất thời so với plan vừa tới.
|
||||
# ► Chỉnh: TĂNG nếu `off_path` khai hoả ngay sau mỗi lần đổi chặng hoặc sau mỗi detour.
|
||||
grace_after_new_plan: 1.0
|
||||
|
||||
# =================================================================================================
|
||||
# Telemetry
|
||||
# =================================================================================================
|
||||
|
||||
### telemetry
|
||||
#
|
||||
# [s] Chu kỳ in bảng thông số runtime ra terminal: CPU của từng thread đã đăng ký (control loop,
|
||||
# thread lập plan, hai vòng cập nhật costmap), chi phí từng đoạn công việc (local planner, global
|
||||
# planner, cachePlans), RSS và tốc độ tăng RSS. 0 = tắt hẳn, không đo gì.
|
||||
@@ -94,13 +268,20 @@ path_monitor:
|
||||
# Dòng "(không đăng ký)" trong bảng là phần CPU KHÔNG thuộc navigation stack — nó thuộc host ROS
|
||||
# (callback cảm biến, OPC-UA, VDA5050, TF bridge). Đọc con số đó trước khi kết luận move_base2 nặng.
|
||||
#
|
||||
# Đây là công cụ chẩn đoán: tắt lại khi đã đo xong, đừng để chạy thường trực trên robot thật.
|
||||
# ► Chỉnh: đặt 2.0–5.0 khi đang truy CPU/rò bộ nhớ, rồi TRẢ VỀ 0. Đây là công cụ chẩn đoán, đừng để
|
||||
# chạy thường trực trên robot thật.
|
||||
runtime_stats_period: 0.0
|
||||
# Recovery gen-2 nằm ở `recovery_behaviors_params.yaml`, namespace `recovery`.
|
||||
|
||||
# Bật/tắt toàn bộ recovery. Danh sách behavior và route nằm ở `recovery_behaviors_params.yaml`,
|
||||
# namespace `recovery`.
|
||||
# ► Chỉnh: false = mọi lỗi đi thẳng tới ABORTED, không thử phục hồi. Chỉ dùng khi cô lập lỗi lúc
|
||||
# debug; trên hiện trường để true.
|
||||
recovery_behavior_enabled: true
|
||||
|
||||
## mission layer
|
||||
#
|
||||
# =================================================================================================
|
||||
# Mission layer
|
||||
# =================================================================================================
|
||||
|
||||
# true (mặc định của move_base2): VDA5050 Order đi qua `mission_adapters` — order được cắt thành
|
||||
# từng chặng tại mỗi node có action, chỉ phần `released` được chạy, `orderUpdateId` nối tiếp thay vì
|
||||
# chạy lại từ đầu, và có `mission_timeout` làm lưới cuối. Nguồn mission và tham số của layer khai ở
|
||||
@@ -112,7 +293,12 @@ recovery_behavior_enabled: true
|
||||
#
|
||||
# Bật mà không nạp được nguồn nào thì runtime TỰ quay về đường trực tiếp kèm log cảnh báo — thiếu
|
||||
# plugin không được phép biến thành robot đứng im không rõ lý do.
|
||||
#
|
||||
# ► Chỉnh: tắt thì MẤT compound action (charge/PickUp), mất cắt chặng theo node, mất `mission_timeout`.
|
||||
# Chỉ tắt để cô lập sự cố, và nhớ bật lại.
|
||||
mission_layer_enabled: true
|
||||
|
||||
# Bảng symbol -> thư viện cho Boost.DLL. Đây KHÔNG phải tham số tinh chỉnh — thiếu khoá này 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".
|
||||
MoveBase:
|
||||
library_path: libmove_base2
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/mppi_local_planner_params.yaml
|
||||
98
config/runtime/mppi_local_planner_params.yaml
Normal file
98
config/runtime/mppi_local_planner_params.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
LocalPlannerAdapter:
|
||||
library_path: liblocal_planner_adapter
|
||||
yaw_goal_tolerance: 0.017
|
||||
xy_goal_tolerance: 0.03
|
||||
min_approach_linear_velocity: 0.06
|
||||
|
||||
MPPILocalPlanner:
|
||||
library_path: libmppi_local_planner
|
||||
|
||||
# Robot limits [m/s, rad/s]
|
||||
min_velocity: 0.0
|
||||
# Cao hon reference_velocity mot khoang dem (headroom). Neu de sat ref thi
|
||||
# nua tren cua nhieu sampling bi clamp o max, keo van toc trung binh xuong
|
||||
# (do duoc: ref0.45/max0.50 -> chi dat 0.33; max0.65 -> dat 0.41). Robot chay
|
||||
# duoc >0.6 m/s nen dat 0.65.
|
||||
max_velocity: 0.65
|
||||
max_angular_velocity: 1.0
|
||||
robot_radius: 0.30
|
||||
obstacle_point_radius: 0.08
|
||||
footprint_padding: 0.05
|
||||
|
||||
# MPPI core
|
||||
# Horizon = model_dt * time_steps = 3.6 s ~ 1.8 m @0.5 m/s.
|
||||
# Truoc day 1.4 s (0.7 m) qua ngan: robot chi "thay" vat can khi da sat, khong con
|
||||
# cho de vong qua -> hoac ket hoac lang nhang. Do thuc te: 0.7m/1.2m khong toi dich;
|
||||
# 1.8m toi dich voi quang duong chi dai hon 6% so voi duong thang.
|
||||
# Khong tang dt qua 0.15: dt=0.20 lam dao dong tang gap 4 lan.
|
||||
model_dt: 0.2
|
||||
time_steps: 20
|
||||
batch_size: 220
|
||||
# So thread OpenMP. De mac dinh (= 16 core) thi tranh chap voi gazebo/rviz/perception
|
||||
# lam 1 chu ky solveMPPI cham tu 0.9 ms len ~25 ms.
|
||||
num_threads: 4
|
||||
param_lambda: 100.0
|
||||
param_alpha: 0.98
|
||||
param_exploration: 0.05
|
||||
vx_std: 0.2
|
||||
wz_std: 0.25
|
||||
reference_velocity: 0.48
|
||||
|
||||
# Path and goal
|
||||
# Phai lon hon horizon (1.8 m), neu khong terminal goal_weight se keo robot ve
|
||||
# diem cat cua reference path va lam no giam toc moi chu ky.
|
||||
max_global_plan_lookahead_dist: 3.0
|
||||
xy_goal_tolerance: 0.10
|
||||
yaw_goal_tolerance: 0.10
|
||||
|
||||
# Costmap and cost weights
|
||||
obstacle_range: 2.5
|
||||
obstacle_cost_threshold: 150
|
||||
obstacle_cell_step: 2
|
||||
max_obstacle_points: 180
|
||||
obstacle_influence_radius: 1.0
|
||||
# Cost vat can gio CONG DON tren tung cell (truoc day lay max), nen thang nay phai
|
||||
# nho hon nhieu. Giu 85 voi che do sum lam cost vot len ~180x85, ap dao moi thanh
|
||||
# phan khac -> dao dong manh va di vong xa 45%. Do thuc te tai T=24/dt=0.15:
|
||||
# weight=10 cho dao dong thap nhat va khoang ho 0.48 m (du 13 cm).
|
||||
obstacle_cost_use_sum: true
|
||||
obstacle_weight: 10.0
|
||||
collision_cost: 1000000.0
|
||||
progress_weight: 8.0
|
||||
terminal_progress_weight: 20.0
|
||||
goal_weight: 30.0
|
||||
# Phat v^2: gan 0 vi no truc tiep keo van toc xuong (phan truc giac voi robot
|
||||
# muon chay nhanh). Giu nho de van co chut smoothing.
|
||||
linear_control_weight: 0.2
|
||||
angular_control_weight: 0.2
|
||||
control_change_weight: 1.0
|
||||
# Giam toc khi lech huong: ha tu 0.8 xuong 0.3. Truoc day khi ne vat can
|
||||
# (yaw error lon) robot bo <0.1 m/s. 0.3 van giam toc vao cua nhung khong bo.
|
||||
yaw_error_slowdown: 0.1
|
||||
min_tracking_velocity: 0.08
|
||||
|
||||
# Phat hien ket: MPPI co the tra lenh hop le nhung ~0 mai o cuc tieu dia phuong.
|
||||
# Qua nguong nay controller bao that bai -> move_base PLANNING roi CLEARING.
|
||||
stuck_velocity_threshold: 0.03
|
||||
stuck_omega_threshold: 0.05
|
||||
stuck_patience_cycles: 40
|
||||
|
||||
# --- Covariance thich nghi (giai doan 2) ---
|
||||
# Moi chu ky fit lai do rong nhieu cho TUNG buoc thoi gian tu chinh batch.
|
||||
# vx_std/wz_std o tren chi con la gia tri khoi tao va gia tri sau reset.
|
||||
adaptive_covariance: true
|
||||
gaussian_fitting_lambda: 5.0 # phai < param_lambda de trong so du nhon
|
||||
# San chon bang thuc nghiem: thap hon -> muot hon nhung cham va sat vat can hon.
|
||||
min_vx_std: 0.08
|
||||
max_vx_std: 0.35
|
||||
min_wz_std: 0.10
|
||||
max_wz_std: 0.60
|
||||
# Khi bi ket, no rong sigma dan qua tung chu ky de thoat cuc tieu dia phuong.
|
||||
stuck_sigma_inflation: 1.6
|
||||
hard_obstacle_cost_threshold: 254
|
||||
stage_xy_weight: 60.0
|
||||
stage_yaw_weight: 1.0
|
||||
stage_speed_weight: 12.0
|
||||
terminal_xy_weight: 90.0
|
||||
terminal_yaw_weight: 1.0
|
||||
terminal_speed_weight: 12.0
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/mprim
|
||||
48
config/runtime/mprim/base_local_planner_params.yaml
Normal file
48
config/runtime/mprim/base_local_planner_params.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
#For full documentation of the parameters in this file, and a list of all the
|
||||
#parameters available for TrajectoryPlannerROS, please see
|
||||
#http://www.ros.org/wiki/base_local_planner
|
||||
TrajectoryPlannerROS:
|
||||
#Set the acceleration limits of the robot
|
||||
acc_lim_th: 3.2
|
||||
acc_lim_x: 0.5
|
||||
acc_lim_y: 0.5
|
||||
|
||||
#Set the velocity limits of the robot
|
||||
max_vel_x: 0.4
|
||||
min_vel_x: 0.1
|
||||
max_rotational_vel: 1.0
|
||||
min_in_place_rotational_vel: 0.4
|
||||
|
||||
#The velocity the robot will command when trying to escape from a stuck situation
|
||||
escape_vel: -0.2
|
||||
|
||||
#For this example, we'll use a holonomic robot
|
||||
holonomic_robot: false
|
||||
|
||||
#Since we're using a holonomic robot, we'll set the set of y velocities it will sample
|
||||
y_vels: [-0.3, -0.1, 0.1, 0.3]
|
||||
|
||||
#Set the tolerance on achieving a goal
|
||||
xy_goal_tolerance: 0.1
|
||||
yaw_goal_tolerance: 0.05
|
||||
|
||||
#We'll configure how long and with what granularity we'll forward simulate trajectories
|
||||
sim_time: 3.0
|
||||
sim_granularity: 0.025
|
||||
vx_samples: 5
|
||||
vtheta_samples: 20
|
||||
|
||||
#Parameters for scoring trajectories
|
||||
goal_distance_bias: 0.4
|
||||
path_distance_bias: 0.7
|
||||
occdist_scale: 0.3
|
||||
heading_lookahead: 0.325
|
||||
|
||||
#We'll use the Dynamic Window Approach to control instead of Trajectory Rollout for this example
|
||||
dwa: false
|
||||
|
||||
#How far the robot must travel before oscillation flags are reset
|
||||
oscillation_reset_dist: 0.01
|
||||
|
||||
#Eat up the plan as the robot moves along it
|
||||
prune_plan: false
|
||||
55
config/runtime/mprim/dwa_local_planner_params.yaml
Executable file
55
config/runtime/mprim/dwa_local_planner_params.yaml
Executable file
@@ -0,0 +1,55 @@
|
||||
base_local_planner: dwa_local_planner/DWAPlannerROS
|
||||
DWAPlannerROS:
|
||||
# Robot configuration
|
||||
max_vel_x: 0.8
|
||||
min_vel_x: -0.2
|
||||
|
||||
max_vel_y: 0.0 # diff drive robot
|
||||
min_vel_y: 0.0 # diff drive robot
|
||||
|
||||
max_trans_vel: 0.8 # choose slightly less than the base's capability
|
||||
min_trans_vel: 0.1 # this is the min trans velocity when there is negligible rotational velocity
|
||||
trans_stopped_vel: 0.03
|
||||
|
||||
# Warning!
|
||||
# do not set min_trans_vel to 0.0 otherwise dwa will always think translational velocities
|
||||
# are non-negligible and small in place rotational velocities will be created.
|
||||
|
||||
max_rot_vel: 1.0 # choose slightly less than the base's capability
|
||||
min_rot_vel: 0.1 # this is the min angular velocity when there is negligible translational velocity
|
||||
rot_stopped_vel: 0.1
|
||||
|
||||
acc_lim_x: 1.5
|
||||
acc_lim_y: 0.0 # diff drive robot
|
||||
acc_limit_trans: 1.5
|
||||
acc_lim_theta: 2.0
|
||||
|
||||
# Goal tolerance
|
||||
yaw_goal_tolerance: 0.03 # yaw_goal_tolerance > (sim_time * min_rot_vel) / 2 (from Navigation Tuning Guide)
|
||||
xy_goal_tolerance: 0.08 # xy_goal_tolerance > (sim_time * min_vel_x) / 2
|
||||
latch_xy_goal_tolerance: true
|
||||
|
||||
# Forward simulation
|
||||
sim_time: 1.2
|
||||
vx_samples: 15
|
||||
vy_samples: 1 # diff drive robot, there is only one sample
|
||||
vtheta_samples: 20
|
||||
|
||||
# Trajectory scoring
|
||||
path_distance_bias: 64.0 # default: 32.0 mir: 32.0 - weighting for how much it should stick to the global path plan
|
||||
goal_distance_bias: 12.0 # default: 24.0 mir: 48.0 - weighting for how much it should attempt to reach its goal
|
||||
occdist_scale: 0.5 # default: 0.01 mir: 0.01 - weighting for how much the controller should avoid obstacles
|
||||
forward_point_distance: 0.325 # default: 0.325 mir: 0.325 - how far along to place an additional scoring point
|
||||
stop_time_buffer: 0.2 # default: 0.2 mir: 0.2 - amount of time a robot must stop before colliding for a valid traj.
|
||||
scaling_speed: 0.25 # default: 0.25 mir: 0.25 - absolute velocity at which to start scaling the robot's footprint
|
||||
max_scaling_factor: 0.2 # default: 0.2 mir: 0.2 - how much to scale the robot's footprint when at speed.
|
||||
prune_plan: true
|
||||
|
||||
# Oscillation prevention
|
||||
oscillation_reset_dist: 0.05 # 0.05 - how far to travel before resetting oscillation flags, in m
|
||||
oscillation_reset_angle: 0.2 # 0.2 - the angle the robot must turn before resetting Oscillation flags, in rad
|
||||
|
||||
# Debugging
|
||||
publish_traj_pc : true
|
||||
publish_cost_grid_pc: true
|
||||
global_frame_id: /odom # or <robot namespace>/odom
|
||||
217
config/runtime/mprim/ekf.yaml
Executable file
217
config/runtime/mprim/ekf.yaml
Executable file
@@ -0,0 +1,217 @@
|
||||
# The frequency, in Hz, at which the filter will output a position estimate. Note that the filter will not begin
|
||||
# computation until it receives at least one message from one of the inputs. It will then run continuously at the
|
||||
# frequency specified here, regardless of whether it receives more measurements. Defaults to 30 if unspecified.
|
||||
frequency: 50
|
||||
|
||||
# The period, in seconds, after which we consider a sensor to have timed out. In this event, we carry out a predict
|
||||
# cycle on the EKF without correcting it. This parameter can be thought of as the minimum frequency with which the
|
||||
# filter will generate new output. Defaults to 1 / frequency if not specified.
|
||||
sensor_timeout: 0.1
|
||||
|
||||
# ekf_localization_node and ukf_localization_node both use a 3D omnidirectional motion model. If this parameter is
|
||||
# set to true, no 3D information will be used in your state estimate. Use this if you are operating in a planar
|
||||
# environment and want to ignore the effect of small variations in the ground plane that might otherwise be detected
|
||||
# by, for example, an IMU. Defaults to false if unspecified.
|
||||
two_d_mode: true
|
||||
|
||||
# Use this parameter to provide an offset to the transform generated by ekf_localization_node. This can be used for
|
||||
# future dating the transform, which is required for interaction with some other packages. Defaults to 0.0 if
|
||||
# unspecified.
|
||||
transform_time_offset: 0.0
|
||||
|
||||
# Use this parameter to specify how long the tf listener should wait for a transform to become available.
|
||||
# Defaults to 0.0 if unspecified.
|
||||
transform_timeout: 0.0
|
||||
|
||||
# If you're having trouble, try setting this to true, and then echo the /diagnostics_agg topic to see if the node is
|
||||
# unhappy with any settings or data.
|
||||
print_diagnostics: true
|
||||
|
||||
# Debug settings. Not for the faint of heart. Outputs a ludicrous amount of information to the file specified by
|
||||
# debug_out_file. I hope you like matrices! Please note that setting this to true will have strongly deleterious
|
||||
# effects on the performance of the node. Defaults to false if unspecified.
|
||||
debug: false
|
||||
|
||||
# Defaults to "robot_localization_debug.txt" if unspecified. Please specify the full path.
|
||||
debug_out_file: /path/to/debug/file.txt
|
||||
|
||||
# Whether to broadcast the transformation over the /tf topic. Defaults to true if unspecified.
|
||||
publish_tf: true
|
||||
|
||||
# Whether to publish the acceleration state. Defaults to false if unspecified.
|
||||
publish_acceleration: false
|
||||
|
||||
# REP-105 (http://www.ros.org/reps/rep-0105.html) specifies four principal coordinate frames: base_link, odom, map, and
|
||||
# earth. base_link is the coordinate frame that is affixed to the robot. Both odom and map are world-fixed frames.
|
||||
# The robot's position in the odom frame will drift over time, but is accurate in the short term and should be
|
||||
# continuous. The odom frame is therefore the best frame for executing local motion plans. The map frame, like the odom
|
||||
# frame, is a world-fixed coordinate frame, and while it contains the most globally accurate position estimate for your
|
||||
# robot, it is subject to discrete jumps, e.g., due to the fusion of GPS data or a correction from a map-based
|
||||
# localization node. The earth frame is used to relate multiple map frames by giving them a common reference frame.
|
||||
# ekf_localization_node and ukf_localization_node are not concerned with the earth frame.
|
||||
# Here is how to use the following settings:
|
||||
# 1. Set the map_frame, odom_frame, and base_link frames to the appropriate frame names for your system.
|
||||
# 1a. If your system does not have a map_frame, just remove it, and make sure "world_frame" is set to the value of
|
||||
# odom_frame.
|
||||
# 2. If you are fusing continuous position data such as wheel encoder odometry, visual odometry, or IMU data, set
|
||||
# "world_frame" to your odom_frame value. This is the default behavior for robot_localization's state estimation nodes.
|
||||
# 3. If you are fusing global absolute position data that is subject to discrete jumps (e.g., GPS or position updates
|
||||
# from landmark observations) then:
|
||||
# 3a. Set your "world_frame" to your map_frame value
|
||||
# 3b. MAKE SURE something else is generating the odom->base_link transform. Note that this can even be another state
|
||||
# estimation node from robot_localization! However, that instance should *not* fuse the global data.
|
||||
map_frame: map # Defaults to "map" if unspecified
|
||||
odom_frame: $(arg tf_prefix)odom # Defaults to "odom" if unspecified
|
||||
base_link_frame: $(arg tf_prefix)base_link # Defaults to "base_link" if unspecified
|
||||
world_frame: $(arg tf_prefix)odom # Defaults to the value of odom_frame if unspecified
|
||||
|
||||
# The filter accepts an arbitrary number of inputs from each input message type (robot_nav_msgs/Odometry,
|
||||
# geometry_msgs/PoseWithCovarianceStamped, geometry_msgs/TwistWithCovarianceStamped,
|
||||
# robot_sensor_msgs/Imu). To add an input, simply append the next number in the sequence to its "base" name, e.g., odom0,
|
||||
# odom1, twist0, twist1, imu0, imu1, imu2, etc. The value should be the topic name. These parameters obviously have no
|
||||
# default values, and must be specified.
|
||||
odom0: odom
|
||||
|
||||
# Each sensor reading updates some or all of the filter's state. These options give you greater control over which
|
||||
# values from each measurement are fed to the filter. For example, if you have an odometry message as input, but only
|
||||
# want to use its Z position value, then set the entire vector to false, except for the third entry. The order of the
|
||||
# values is x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Note that not some message types
|
||||
# do not provide some of the state variables estimated by the filter. For example, a TwistWithCovarianceStamped message
|
||||
# has no pose information, so the first six values would be meaningless in that case. Each vector defaults to all false
|
||||
# if unspecified, effectively making this parameter required for each sensor.
|
||||
# see http://docs.ros.org/melodic/api/robot_localization/html/configuring_robot_localization.html
|
||||
odom0_config: [false, false, false, # x y z
|
||||
false, false, false, # roll pitch yaw
|
||||
true, true, false, # vx vy vz
|
||||
false, false, true, # vroll vpitch vyaw
|
||||
false, false, false] # ax ay az
|
||||
|
||||
# If you have high-frequency data or are running with a low frequency parameter value, then you may want to increase
|
||||
# the size of the subscription queue so that more measurements are fused.
|
||||
odom0_queue_size: 10
|
||||
|
||||
# [ADVANCED] Large messages in ROS can exhibit strange behavior when they arrive at a high frequency. This is a result
|
||||
# of Nagle's algorithm. This option tells the ROS subscriber to use the tcpNoDelay option, which disables Nagle's
|
||||
# algorithm.
|
||||
odom0_nodelay: false
|
||||
|
||||
# [ADVANCED] When measuring one pose variable with two sensors, a situation can arise in which both sensors under-
|
||||
# report their covariances. This can lead to the filter rapidly jumping back and forth between each measurement as they
|
||||
# arrive. In these cases, it often makes sense to (a) correct the measurement covariances, or (b) if velocity is also
|
||||
# measured by one of the sensors, let one sensor measure pose, and the other velocity. However, doing (a) or (b) isn't
|
||||
# always feasible, and so we expose the differential parameter. When differential mode is enabled, all absolute pose
|
||||
# data is converted to velocity data by differentiating the absolute pose measurements. These velocities are then
|
||||
# integrated as usual. NOTE: this only applies to sensors that provide pose measurements; setting differential to true
|
||||
# for twist measurements has no effect.
|
||||
odom0_differential: false
|
||||
|
||||
# [ADVANCED] When the node starts, if this parameter is true, then the first measurement is treated as a "zero point"
|
||||
# for all future measurements. While you can achieve the same effect with the differential paremeter, the key
|
||||
# difference is that the relative parameter doesn't cause the measurement to be converted to a velocity before
|
||||
# integrating it. If you simply want your measurements to start at 0 for a given sensor, set this to true.
|
||||
odom0_relative: false
|
||||
|
||||
# [ADVANCED] If your data is subject to outliers, use these threshold settings, expressed as Mahalanobis distances, to
|
||||
# control how far away from the current vehicle state a sensor measurement is permitted to be. Each defaults to
|
||||
# numeric_limits<double>::max() if unspecified. It is strongly recommended that these parameters be removed if not
|
||||
# required. Data is specified at the level of pose and twist variables, rather than for each variable in isolation.
|
||||
# For messages that have both pose and twist data, the parameter specifies to which part of the message we are applying
|
||||
# the thresholds.
|
||||
#odom0_pose_rejection_threshold: 5
|
||||
#odom0_twist_rejection_threshold: 1
|
||||
|
||||
# Further input parameter examples
|
||||
# see http://docs.ros.org/melodic/api/robot_localization/html/configuring_robot_localization.html
|
||||
imu0: imu_data
|
||||
imu0_config: [false, false, false, # x y z
|
||||
false, false, true, # roll pitch yaw
|
||||
false, false, false, # vx vy vz
|
||||
false, false, true, # vroll vpitch vyaw
|
||||
true, false, false] # ax ay az
|
||||
imu0_nodelay: false
|
||||
imu0_differential: false
|
||||
imu0_relative: true
|
||||
imu0_queue_size: 10
|
||||
#imu0_pose_rejection_threshold: 0.8 # Note the difference in parameter names
|
||||
#imu0_twist_rejection_threshold: 0.8 #
|
||||
#imu0_linear_acceleration_rejection_threshold: 0.8 #
|
||||
|
||||
# [ADVANCED] Some IMUs automatically remove acceleration due to gravity, and others don't. If yours doesn't, please set
|
||||
# this to true, and *make sure* your data conforms to REP-103, specifically, that the data is in ENU frame.
|
||||
imu0_remove_gravitational_acceleration: false
|
||||
|
||||
# [ADVANCED] The EKF and UKF models follow a standard predict/correct cycle. During prediction, if there is no
|
||||
# acceleration reference, the velocity at time t+1 is simply predicted to be the same as the velocity at time t. During
|
||||
# correction, this predicted value is fused with the measured value to produce the new velocity estimate. This can be
|
||||
# problematic, as the final velocity will effectively be a weighted average of the old velocity and the new one. When
|
||||
# this velocity is the integrated into a new pose, the result can be sluggish covergence. This effect is especially
|
||||
# noticeable with LIDAR data during rotations. To get around it, users can try inflating the process_noise_covariance
|
||||
# for the velocity variable in question, or decrease the variance of the variable in question in the measurement
|
||||
# itself. In addition, users can also take advantage of the control command being issued to the robot at the time we
|
||||
# make the prediction. If control is used, it will get converted into an acceleration term, which will be used during
|
||||
# predicition. Note that if an acceleration measurement for the variable in question is available from one of the
|
||||
# inputs, the control term will be ignored.
|
||||
# Whether or not we use the control input during predicition. Defaults to false.
|
||||
use_control: false
|
||||
# Whether the input (assumed to be cmd_vel) is a geometry_msgs/Twist or geometry_msgs/TwistStamped message. Defaults to
|
||||
# false.
|
||||
stamped_control: false
|
||||
# The last issued control command will be used in prediction for this period. Defaults to 0.2.
|
||||
control_timeout: 0.2
|
||||
# Which velocities are being controlled. Order is vx, vy, vz, vroll, vpitch, vyaw.
|
||||
control_config: [true, false, false, false, false, true]
|
||||
# Places limits on how large the acceleration term will be. Should match your robot's kinematics.
|
||||
acceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 3.4]
|
||||
# Acceleration and deceleration limits are not always the same for robots.
|
||||
deceleration_limits: [1.3, 0.0, 0.0, 0.0, 0.0, 4.5]
|
||||
# If your robot cannot instantaneously reach its acceleration limit, the permitted change can be controlled with these
|
||||
# gains
|
||||
acceleration_gains: [0.8, 0.0, 0.0, 0.0, 0.0, 0.9]
|
||||
# If your robot cannot instantaneously reach its deceleration limit, the permitted change can be controlled with these
|
||||
# gains
|
||||
deceleration_gains: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0]
|
||||
|
||||
# [ADVANCED] The process noise covariance matrix can be difficult to tune, and can vary for each application, so it is
|
||||
# exposed as a configuration parameter. This matrix represents the noise we add to the total error after each
|
||||
# prediction step. The better the omnidirectional motion model matches your system, the smaller these values can be.
|
||||
# However, if users find that a given variable is slow to converge, one approach is to increase the
|
||||
# process_noise_covariance diagonal value for the variable in question, which will cause the filter's predicted error
|
||||
# to be larger, which will cause the filter to trust the incoming measurement more during correction. The values are
|
||||
# ordered as x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below if
|
||||
# unspecified.
|
||||
process_noise_covariance: [0.05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0.05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0.06, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0.06, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0.025, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0.025, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0.04, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.01, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.015]
|
||||
|
||||
# [ADVANCED] This represents the initial value for the state estimate error covariance matrix. Setting a diagonal
|
||||
# value (variance) to a large value will result in rapid convergence for initial measurements of the variable in
|
||||
# question. Users should take care not to use large values for variables that will not be measured directly. The values
|
||||
# are ordered as x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. Defaults to the matrix below
|
||||
#if unspecified.
|
||||
initial_estimate_covariance: [100.0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 100.0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10.0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1e-9]
|
||||
280
config/runtime/mprim/genmprim_unicycle_highcost_5cm.m
Executable file
280
config/runtime/mprim/genmprim_unicycle_highcost_5cm.m
Executable file
@@ -0,0 +1,280 @@
|
||||
% /*
|
||||
% * Copyright (c) 2008, Maxim Likhachev
|
||||
% * All rights reserved.
|
||||
% *
|
||||
% * Redistribution and use in source and binary forms, with or without
|
||||
% * modification, are permitted provided that the following conditions are met:
|
||||
% *
|
||||
% * * Redistributions of source code must retain the above copyright
|
||||
% * notice, this list of conditions and the following disclaimer.
|
||||
% * * Redistributions in binary form must reproduce the above copyright
|
||||
% * notice, this list of conditions and the following disclaimer in the
|
||||
% * documentation and/or other materials provided with the distribution.
|
||||
% * * Neither the name of the Carnegie Mellon University nor the names of its
|
||||
% * contributors may be used to endorse or promote products derived from
|
||||
% * this software without specific prior written permission.
|
||||
% *
|
||||
% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
% * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
% * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
% * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
% * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
% * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
% * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
% * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
% * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
% * POSSIBILITY OF SUCH DAMAGE.
|
||||
% */
|
||||
|
||||
function[] = genmprim_unicycle_highcost_5cm(outfilename)
|
||||
|
||||
%
|
||||
%generates motion primitives and saves them into file
|
||||
%
|
||||
%written by Maxim Likhachev
|
||||
%---------------------------------------------------
|
||||
%
|
||||
|
||||
%defines
|
||||
|
||||
UNICYCLE_MPRIM_16DEGS = 1;
|
||||
|
||||
|
||||
if UNICYCLE_MPRIM_16DEGS == 1
|
||||
resolution = 0.05;
|
||||
numberofangles = 16; %preferably a power of 2, definitely multiple of 8
|
||||
numberofprimsperangle = 7;
|
||||
|
||||
%multipliers (multiplier is used as costmult*cost)
|
||||
forwardcostmult = 1;
|
||||
backwardcostmult = 40;
|
||||
forwardandturncostmult = 2;
|
||||
sidestepcostmult = 10;
|
||||
turninplacecostmult = 20;
|
||||
|
||||
%note, what is shown x,y,theta changes (not absolute numbers)
|
||||
|
||||
%0 degreees
|
||||
basemprimendpts0_c = zeros(numberofprimsperangle, 4); %x,y,theta,costmult
|
||||
%x aligned with the heading of the robot, angles are positive
|
||||
%counterclockwise
|
||||
%0 theta change
|
||||
basemprimendpts0_c(1,:) = [1 0 0 forwardcostmult];
|
||||
basemprimendpts0_c(2,:) = [8 0 0 forwardcostmult];
|
||||
basemprimendpts0_c(3,:) = [-1 0 0 backwardcostmult];
|
||||
%1/16 theta change
|
||||
basemprimendpts0_c(4,:) = [8 1 1 forwardandturncostmult];
|
||||
basemprimendpts0_c(5,:) = [8 -1 -1 forwardandturncostmult];
|
||||
%turn in place
|
||||
basemprimendpts0_c(6,:) = [0 0 1 turninplacecostmult];
|
||||
basemprimendpts0_c(7,:) = [0 0 -1 turninplacecostmult];
|
||||
|
||||
%45 degrees
|
||||
basemprimendpts45_c = zeros(numberofprimsperangle, 4); %x,y,theta,costmult (multiplier is used as costmult*cost)
|
||||
%x aligned with the heading of the robot, angles are positive
|
||||
%counterclockwise
|
||||
%0 theta change
|
||||
basemprimendpts45_c(1,:) = [1 1 0 forwardcostmult];
|
||||
basemprimendpts45_c(2,:) = [6 6 0 forwardcostmult];
|
||||
basemprimendpts45_c(3,:) = [-1 -1 0 backwardcostmult];
|
||||
%1/16 theta change
|
||||
basemprimendpts45_c(4,:) = [5 7 1 forwardandturncostmult];
|
||||
basemprimendpts45_c(5,:) = [7 5 -1 forwardandturncostmult];
|
||||
%turn in place
|
||||
basemprimendpts45_c(6,:) = [0 0 1 turninplacecostmult];
|
||||
basemprimendpts45_c(7,:) = [0 0 -1 turninplacecostmult];
|
||||
|
||||
%22.5 degrees
|
||||
basemprimendpts22p5_c = zeros(numberofprimsperangle, 4); %x,y,theta,costmult (multiplier is used as costmult*cost)
|
||||
%x aligned with the heading of the robot, angles are positive
|
||||
%counterclockwise
|
||||
%0 theta change
|
||||
basemprimendpts22p5_c(1,:) = [2 1 0 forwardcostmult];
|
||||
basemprimendpts22p5_c(2,:) = [6 3 0 forwardcostmult];
|
||||
basemprimendpts22p5_c(3,:) = [-2 -1 0 backwardcostmult];
|
||||
%1/16 theta change
|
||||
basemprimendpts22p5_c(4,:) = [5 4 1 forwardandturncostmult];
|
||||
basemprimendpts22p5_c(5,:) = [7 2 -1 forwardandturncostmult];
|
||||
%turn in place
|
||||
basemprimendpts22p5_c(6,:) = [0 0 1 turninplacecostmult];
|
||||
basemprimendpts22p5_c(7,:) = [0 0 -1 turninplacecostmult];
|
||||
|
||||
else
|
||||
fprintf(1, 'ERROR: undefined mprims type\n');
|
||||
return;
|
||||
end;
|
||||
|
||||
|
||||
fout = fopen(outfilename, 'w');
|
||||
|
||||
|
||||
%write the header
|
||||
fprintf(fout, 'resolution_m: %f\n', resolution);
|
||||
fprintf(fout, 'numberofangles: %d\n', numberofangles);
|
||||
fprintf(fout, 'totalnumberofprimitives: %d\n', numberofprimsperangle*numberofangles);
|
||||
|
||||
%iterate over angles
|
||||
for angleind = 1:numberofangles
|
||||
|
||||
figure(1);
|
||||
hold off;
|
||||
|
||||
text(0, 0, int2str(angleind));
|
||||
|
||||
%iterate over primitives
|
||||
for primind = 1:numberofprimsperangle
|
||||
fprintf(fout, 'primID: %d\n', primind-1);
|
||||
fprintf(fout, 'startangle_c: %d\n', angleind-1);
|
||||
|
||||
%current angle
|
||||
currentangle = (angleind-1)*2*pi/numberofangles;
|
||||
currentangle_36000int = round((angleind-1)*36000/numberofangles);
|
||||
|
||||
%compute which template to use
|
||||
if (rem(currentangle_36000int, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts0_c(primind,:);
|
||||
angle = currentangle;
|
||||
elseif (rem(currentangle_36000int, 4500) == 0)
|
||||
basemprimendpts_c = basemprimendpts45_c(primind,:);
|
||||
angle = currentangle - 45*pi/180;
|
||||
elseif (rem(currentangle_36000int-7875, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts33p75_c(primind,:);
|
||||
basemprimendpts_c(1) = basemprimendpts33p75_c(primind, 2); %reverse x and y
|
||||
basemprimendpts_c(2) = basemprimendpts33p75_c(primind, 1);
|
||||
basemprimendpts_c(3) = -basemprimendpts33p75_c(primind, 3); %reverse the angle as well
|
||||
angle = currentangle - 78.75*pi/180;
|
||||
fprintf(1, '78p75\n');
|
||||
elseif (rem(currentangle_36000int-6750, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts22p5_c(primind,:);
|
||||
basemprimendpts_c(1) = basemprimendpts22p5_c(primind, 2); %reverse x and y
|
||||
basemprimendpts_c(2) = basemprimendpts22p5_c(primind, 1);
|
||||
basemprimendpts_c(3) = -basemprimendpts22p5_c(primind, 3); %reverse the angle as well
|
||||
%fprintf(1, '%d %d %d onto %d %d %d\n', basemprimendpts22p5_c(1), basemprimendpts22p5_c(2), basemprimendpts22p5_c(3), ...
|
||||
% basemprimendpts_c(1), basemprimendpts_c(2), basemprimendpts_c(3));
|
||||
angle = currentangle - 67.5*pi/180;
|
||||
fprintf(1, '67p5\n');
|
||||
elseif (rem(currentangle_36000int-5625, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts11p25_c(primind,:);
|
||||
basemprimendpts_c(1) = basemprimendpts11p25_c(primind, 2); %reverse x and y
|
||||
basemprimendpts_c(2) = basemprimendpts11p25_c(primind, 1);
|
||||
basemprimendpts_c(3) = -basemprimendpts11p25_c(primind, 3); %reverse the angle as well
|
||||
angle = currentangle - 56.25*pi/180;
|
||||
fprintf(1, '56p25\n');
|
||||
elseif (rem(currentangle_36000int-3375, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts33p75_c(primind,:);
|
||||
angle = currentangle - 33.75*pi/180;
|
||||
fprintf(1, '33p75\n');
|
||||
elseif (rem(currentangle_36000int-2250, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts22p5_c(primind,:);
|
||||
angle = currentangle - 22.5*pi/180;
|
||||
fprintf(1, '22p5\n');
|
||||
elseif (rem(currentangle_36000int-1125, 9000) == 0)
|
||||
basemprimendpts_c = basemprimendpts11p25_c(primind,:);
|
||||
angle = currentangle - 11.25*pi/180;
|
||||
fprintf(1, '11p25\n');
|
||||
else
|
||||
fprintf(1, 'ERROR: invalid angular resolution. angle = %d\n', currentangle_36000int);
|
||||
return;
|
||||
end;
|
||||
|
||||
%now figure out what action will be
|
||||
baseendpose_c = basemprimendpts_c(1:3);
|
||||
additionalactioncostmult = basemprimendpts_c(4);
|
||||
endx_c = round(baseendpose_c(1)*cos(angle) - baseendpose_c(2)*sin(angle));
|
||||
endy_c = round(baseendpose_c(1)*sin(angle) + baseendpose_c(2)*cos(angle));
|
||||
endtheta_c = rem(angleind - 1 + baseendpose_c(3), numberofangles);
|
||||
endpose_c = [endx_c endy_c endtheta_c];
|
||||
|
||||
fprintf(1, 'rotation angle=%f\n', angle*180/pi);
|
||||
|
||||
if baseendpose_c(2) == 0 & baseendpose_c(3) == 0
|
||||
%fprintf(1, 'endpose=%d %d %d\n', endpose_c(1), endpose_c(2), endpose_c(3));
|
||||
end;
|
||||
|
||||
%generate intermediate poses (remember they are w.r.t 0,0 (and not
|
||||
%centers of the cells)
|
||||
numofsamples = 10;
|
||||
intermcells_m = zeros(numofsamples,3);
|
||||
if UNICYCLE_MPRIM_16DEGS == 1
|
||||
startpt = [0 0 currentangle];
|
||||
endpt = [endpose_c(1)*resolution endpose_c(2)*resolution ...
|
||||
rem(angleind - 1 + baseendpose_c(3), numberofangles)*2*pi/numberofangles];
|
||||
intermcells_m = zeros(numofsamples,3);
|
||||
if ((endx_c == 0 & endy_c == 0) | baseendpose_c(3) == 0) %turn in place or move forward
|
||||
for iind = 1:numofsamples
|
||||
intermcells_m(iind,:) = [startpt(1) + (endpt(1) - startpt(1))*(iind-1)/(numofsamples-1) ...
|
||||
startpt(2) + (endpt(2) - startpt(2))*(iind-1)/(numofsamples-1) ...
|
||||
0];
|
||||
rotation_angle = (baseendpose_c(3) ) * (2*pi/numberofangles);
|
||||
intermcells_m(iind,3) = rem(startpt(3) + (rotation_angle)*(iind-1)/(numofsamples-1), 2*pi);
|
||||
|
||||
end;
|
||||
else %unicycle-based move forward or backward
|
||||
R = [cos(startpt(3)) sin(endpt(3)) - sin(startpt(3));
|
||||
sin(startpt(3)) -(cos(endpt(3)) - cos(startpt(3)))];
|
||||
S = pinv(R)*[endpt(1) - startpt(1); endpt(2) - startpt(2)];
|
||||
l = S(1);
|
||||
tvoverrv = S(2);
|
||||
rv = (baseendpose_c(3)*2*pi/numberofangles + l/tvoverrv);
|
||||
tv = tvoverrv*rv;
|
||||
|
||||
if l < 0
|
||||
fprintf(1, 'WARNING: l = %d < 0 -> bad action start/end points\n', l);
|
||||
l = 0;
|
||||
end;
|
||||
%compute rv
|
||||
%rv = baseendpose_c(3)*2*pi/numberofangles;
|
||||
%compute tv
|
||||
%tvx = (endpt(1) - startpt(1))*rv/(sin(endpt(3)) - sin(startpt(3)))
|
||||
%tvy = -(endpt(2) - startpt(2))*rv/(cos(endpt(3)) - cos(startpt(3)))
|
||||
%tv = (tvx + tvy)/2.0;
|
||||
%generate samples
|
||||
for iind = 1:numofsamples
|
||||
dt = (iind-1)/(numofsamples-1);
|
||||
|
||||
%dtheta = rv*dt + startpt(3);
|
||||
%intermcells_m(iind,:) = [startpt(1) + tv/rv*(sin(dtheta) - sin(startpt(3))) ...
|
||||
% startpt(2) - tv/rv*(cos(dtheta) - cos(startpt(3))) ...
|
||||
% dtheta];
|
||||
|
||||
if(dt*tv < l)
|
||||
intermcells_m(iind,:) = [startpt(1) + dt*tv*cos(startpt(3)) ...
|
||||
startpt(2) + dt*tv*sin(startpt(3)) ...
|
||||
startpt(3)];
|
||||
else
|
||||
dtheta = rv*(dt - l/tv) + startpt(3);
|
||||
intermcells_m(iind,:) = [startpt(1) + l*cos(startpt(3)) + tvoverrv*(sin(dtheta) - sin(startpt(3))) ...
|
||||
startpt(2) + l*sin(startpt(3)) - tvoverrv*(cos(dtheta) - cos(startpt(3))) ...
|
||||
dtheta];
|
||||
end;
|
||||
end;
|
||||
%correct
|
||||
errorxy = [endpt(1) - intermcells_m(numofsamples,1) ...
|
||||
endpt(2) - intermcells_m(numofsamples,2)];
|
||||
fprintf(1, 'l=%f errx=%f erry=%f\n', l, errorxy(1), errorxy(2));
|
||||
interpfactor = [0:1/(numofsamples-1):1];
|
||||
intermcells_m(:,1) = intermcells_m(:,1) + errorxy(1)*interpfactor';
|
||||
intermcells_m(:,2) = intermcells_m(:,2) + errorxy(2)*interpfactor';
|
||||
end;
|
||||
end;
|
||||
|
||||
%write out
|
||||
fprintf(fout, 'endpose_c: %d %d %d\n', endpose_c(1), endpose_c(2), endpose_c(3));
|
||||
fprintf(fout, 'additionalactioncostmult: %d\n', additionalactioncostmult);
|
||||
fprintf(fout, 'intermediateposes: %d\n', size(intermcells_m,1));
|
||||
for interind = 1:size(intermcells_m, 1)
|
||||
fprintf(fout, '%.4f %.4f %.4f\n', intermcells_m(interind,1), intermcells_m(interind,2), intermcells_m(interind,3));
|
||||
end;
|
||||
|
||||
plot(intermcells_m(:,1), intermcells_m(:,2));
|
||||
axis([-0.3 0.3 -0.3 0.3]);
|
||||
text(intermcells_m(numofsamples,1), intermcells_m(numofsamples,2), int2str(endpose_c(3)));
|
||||
hold on;
|
||||
|
||||
end;
|
||||
grid;
|
||||
pause;
|
||||
end;
|
||||
|
||||
fclose('all');
|
||||
416
config/runtime/mprim/genmprim_unicycle_highcost_5cm.py
Executable file
416
config/runtime/mprim/genmprim_unicycle_highcost_5cm.py
Executable file
@@ -0,0 +1,416 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (c) 2016, David Conner (Christopher Newport University)
|
||||
# Based on genmprim_unicycle.m
|
||||
# Copyright (c) 2008, Maxim Likhachev
|
||||
# All rights reserved.
|
||||
# converted by libermate utility (https://github.com/awesomebytes/libermate)
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the Carnegie Mellon University nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import numpy as np
|
||||
import rospkg
|
||||
|
||||
# if available import pylab (from matlibplot)
|
||||
matplotlib_found = False
|
||||
try:
|
||||
import matplotlib.pylab as plt
|
||||
|
||||
matplotlib_found = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def matrix_size(mat, elem=None):
|
||||
if not elem:
|
||||
return mat.shape
|
||||
else:
|
||||
return mat.shape[int(elem) - 1]
|
||||
|
||||
|
||||
def genmprim_unicycle(outfilename, visualize=False, separate_plots=False):
|
||||
visualize = matplotlib_found and visualize # Plot the primitives
|
||||
|
||||
# Local Variables: basemprimendpts22p5_c, endtheta_c, endx_c,
|
||||
# baseendpose_c, additionalactioncostmult, fout, numofsamples,
|
||||
# basemprimendpts45_c, primind, basemprimendpts0_c, rv, angle, outfilename,
|
||||
# numberofangles, startpt, UNICYCLE_MPRIM_16DEGS, sidestepcostmult,
|
||||
# rotation_angle, basemprimendpts_c, forwardandturncostmult,
|
||||
# forwardcostmult, turninplacecostmult, endpose_c, backwardcostmult,
|
||||
# interpfactor, S, R, tvoverrv, dtheta, intermcells_m, tv, dt,
|
||||
# currentangle, numberofprimsperangle, resolution, currentangle_36000int,
|
||||
# l, iind, errorxy, interind, endy_c, angleind, endpt
|
||||
# Function calls: plot, cos, pi, grid, figure, genmprim_unicycle, text,
|
||||
# int2str, pause, axis, sin, pinv, fprintf, fclose, rem, zeros, fopen,
|
||||
# round, size
|
||||
# %
|
||||
# %generates motion primitives and saves them into file
|
||||
# %
|
||||
# %written by Maxim Likhachev
|
||||
# %---------------------------------------------------
|
||||
# %
|
||||
# %defines
|
||||
UNICYCLE_MPRIM_16DEGS = 1.0
|
||||
if UNICYCLE_MPRIM_16DEGS == 1.0:
|
||||
resolution = 0.05
|
||||
numberofangles = 16
|
||||
# %preferably a power of 2, definitely multiple of 8
|
||||
numberofprimsperangle = 7
|
||||
# %multipliers (multiplier is used as costmult*cost)
|
||||
forwardcostmult = 1.0
|
||||
backwardcostmult = 40.0
|
||||
forwardandturncostmult = 2.0
|
||||
# sidestepcostmult = 10.0
|
||||
turninplacecostmult = 20.0
|
||||
# %note, what is shown x,y,theta changes (not absolute numbers)
|
||||
# %0 degreees
|
||||
basemprimendpts0_c = np.zeros((numberofprimsperangle, 4))
|
||||
# %x,y,theta,costmult
|
||||
# %x aligned with the heading of the robot, angles are positive
|
||||
# %counterclockwise
|
||||
# %0 theta change
|
||||
basemprimendpts0_c[0, :] = np.array(np.hstack((1.0, 0.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts0_c[1, :] = np.array(np.hstack((8.0, 0.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts0_c[2, :] = np.array(np.hstack((-1.0, 0.0, 0.0, backwardcostmult)))
|
||||
# %1/16 theta change
|
||||
basemprimendpts0_c[3, :] = np.array(np.hstack((8.0, 1.0, 1.0, forwardandturncostmult)))
|
||||
basemprimendpts0_c[4, :] = np.array(np.hstack((8.0, -1.0, -1.0, forwardandturncostmult)))
|
||||
# %turn in place
|
||||
basemprimendpts0_c[5, :] = np.array(np.hstack((0.0, 0.0, 1.0, turninplacecostmult)))
|
||||
basemprimendpts0_c[6, :] = np.array(np.hstack((0.0, 0.0, -1.0, turninplacecostmult)))
|
||||
# %45 degrees
|
||||
basemprimendpts45_c = np.zeros((numberofprimsperangle, 4))
|
||||
# %x,y,theta,costmult (multiplier is used as costmult*cost)
|
||||
# %x aligned with the heading of the robot, angles are positive
|
||||
# %counterclockwise
|
||||
# %0 theta change
|
||||
basemprimendpts45_c[0, :] = np.array(np.hstack((1.0, 1.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts45_c[1, :] = np.array(np.hstack((6.0, 6.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts45_c[2, :] = np.array(np.hstack((-1.0, -1.0, 0.0, backwardcostmult)))
|
||||
# %1/16 theta change
|
||||
basemprimendpts45_c[3, :] = np.array(np.hstack((5.0, 7.0, 1.0, forwardandturncostmult)))
|
||||
basemprimendpts45_c[4, :] = np.array(np.hstack((7.0, 5.0, -1.0, forwardandturncostmult)))
|
||||
# %turn in place
|
||||
basemprimendpts45_c[5, :] = np.array(np.hstack((0.0, 0.0, 1.0, turninplacecostmult)))
|
||||
basemprimendpts45_c[6, :] = np.array(np.hstack((0.0, 0.0, -1.0, turninplacecostmult)))
|
||||
# %22.5 degrees
|
||||
basemprimendpts22p5_c = np.zeros((numberofprimsperangle, 4))
|
||||
# %x,y,theta,costmult (multiplier is used as costmult*cost)
|
||||
# %x aligned with the heading of the robot, angles are positive
|
||||
# %counterclockwise
|
||||
# %0 theta change
|
||||
basemprimendpts22p5_c[0, :] = np.array(np.hstack((2.0, 1.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts22p5_c[1, :] = np.array(np.hstack((6.0, 3.0, 0.0, forwardcostmult)))
|
||||
basemprimendpts22p5_c[2, :] = np.array(np.hstack((-2.0, -1.0, 0.0, backwardcostmult)))
|
||||
# %1/16 theta change
|
||||
basemprimendpts22p5_c[3, :] = np.array(np.hstack((5.0, 4.0, 1.0, forwardandturncostmult)))
|
||||
basemprimendpts22p5_c[4, :] = np.array(np.hstack((7.0, 2.0, -1.0, forwardandturncostmult)))
|
||||
# %turn in place
|
||||
basemprimendpts22p5_c[5, :] = np.array(np.hstack((0.0, 0.0, 1.0, turninplacecostmult)))
|
||||
basemprimendpts22p5_c[6, :] = np.array(np.hstack((0.0, 0.0, -1.0, turninplacecostmult)))
|
||||
else:
|
||||
print('ERROR: undefined mprims type\n')
|
||||
return []
|
||||
|
||||
fout = open(outfilename, 'w')
|
||||
# %write the header
|
||||
fout.write('resolution_m: %f\n' % (resolution))
|
||||
fout.write('numberofangles: %d\n' % (numberofangles))
|
||||
fout.write('totalnumberofprimitives: %d\n' % (numberofprimsperangle * numberofangles))
|
||||
# %iterate over angles
|
||||
for angleind in np.arange(1.0, (numberofangles) + 1):
|
||||
currentangle = ((angleind - 1) * 2.0 * np.pi) / numberofangles
|
||||
currentangle_36000int = np.round((angleind - 1) * 36000.0 / numberofangles)
|
||||
if visualize:
|
||||
if separate_plots:
|
||||
fig = plt.figure(angleind)
|
||||
plt.title('angle {:2.0f} (= {:3.1f} degrees)'.format(angleind - 1, currentangle_36000int / 100.0))
|
||||
else:
|
||||
fig = plt.figure(1)
|
||||
|
||||
plt.axis('equal')
|
||||
plt.axis([-10 * resolution, 10 * resolution, -10 * resolution, 10 * resolution])
|
||||
ax = fig.add_subplot(1, 1, 1)
|
||||
major_ticks = np.arange(-8 * resolution, 9 * resolution, 4 * resolution)
|
||||
minor_ticks = np.arange(-8 * resolution, 9 * resolution, resolution)
|
||||
ax.set_xticks(major_ticks)
|
||||
ax.set_xticks(minor_ticks, minor=True)
|
||||
ax.set_yticks(major_ticks)
|
||||
ax.set_yticks(minor_ticks, minor=True)
|
||||
ax.grid(which='minor', alpha=0.5)
|
||||
ax.grid(which='major', alpha=0.9)
|
||||
|
||||
# %iterate over primitives
|
||||
for primind in np.arange(1.0, (numberofprimsperangle) + 1):
|
||||
fout.write('primID: %d\n' % (primind - 1))
|
||||
fout.write('startangle_c: %d\n' % (angleind - 1))
|
||||
# %current angle
|
||||
# %compute which template to use
|
||||
if (currentangle_36000int % 9000) == 0:
|
||||
basemprimendpts_c = basemprimendpts0_c[int(primind) - 1, :]
|
||||
angle = currentangle
|
||||
elif (currentangle_36000int % 4500) == 0:
|
||||
basemprimendpts_c = basemprimendpts45_c[int(primind) - 1, :]
|
||||
angle = currentangle - 45.0 * np.pi / 180.0
|
||||
|
||||
# commented out because basemprimendpts33p75_c is undefined
|
||||
# elif ((currentangle_36000int - 7875) % 9000) == 0:
|
||||
# basemprimendpts_c = (
|
||||
# 1 * basemprimendpts33p75_c[primind, :]
|
||||
# ) # 1* to force deep copy to avoid reference update below
|
||||
# basemprimendpts_c[0] = basemprimendpts33p75_c[primind, 1]
|
||||
# # %reverse x and y
|
||||
# basemprimendpts_c[1] = basemprimendpts33p75_c[primind, 0]
|
||||
# basemprimendpts_c[2] = -basemprimendpts33p75_c[primind, 2]
|
||||
# # %reverse the angle as well
|
||||
# angle = currentangle - (78.75 * np.pi) / 180.0
|
||||
# print('78p75\n')
|
||||
|
||||
elif ((currentangle_36000int - 6750) % 9000) == 0:
|
||||
basemprimendpts_c = (
|
||||
1 * basemprimendpts22p5_c[int(primind) - 1, :]
|
||||
) # 1* to force deep copy to avoid reference update below
|
||||
basemprimendpts_c[0] = basemprimendpts22p5_c[int(primind) - 1, 1]
|
||||
# %reverse x and y
|
||||
basemprimendpts_c[1] = basemprimendpts22p5_c[int(primind) - 1, 0]
|
||||
basemprimendpts_c[2] = -basemprimendpts22p5_c[int(primind) - 1, 2]
|
||||
# %reverse the angle as well
|
||||
# print(
|
||||
# '%d : %d %d %d onto %d %d %d\n'
|
||||
# % (
|
||||
# primind - 1,
|
||||
# basemprimendpts22p5_c[int(primind) - 1, 0],
|
||||
# basemprimendpts22p5_c[int(primind) - 1, 1],
|
||||
# basemprimendpts22p5_c[int(primind) - 1, 2],
|
||||
# basemprimendpts_c[0],
|
||||
# basemprimendpts_c[1],
|
||||
# basemprimendpts_c[2],
|
||||
# )
|
||||
# )
|
||||
angle = currentangle - (67.5 * np.pi) / 180.0
|
||||
print('67p5\n')
|
||||
|
||||
# commented out because basemprimendpts11p25_c is undefined
|
||||
# elif ((currentangle_36000int - 5625) % 9000) == 0:
|
||||
# basemprimendpts_c = (
|
||||
# 1 * basemprimendpts11p25_c[primind, :]
|
||||
# ) # 1* to force deep copy to avoid reference update below
|
||||
# basemprimendpts_c[0] = basemprimendpts11p25_c[primind, 1]
|
||||
# # %reverse x and y
|
||||
# basemprimendpts_c[1] = basemprimendpts11p25_c[primind, 0]
|
||||
# basemprimendpts_c[2] = -basemprimendpts11p25_c[primind, 2]
|
||||
# # %reverse the angle as well
|
||||
# angle = currentangle - (56.25 * np.pi) / 180.0
|
||||
# print('56p25\n')
|
||||
|
||||
# commented out because basemprimendpts33p75_c is undefined
|
||||
# elif ((currentangle_36000int - 3375) % 9000) == 0:
|
||||
# basemprimendpts_c = basemprimendpts33p75_c[int(primind), :]
|
||||
# angle = currentangle - (33.75 * np.pi) / 180.0
|
||||
# print('33p75\n')
|
||||
|
||||
elif ((currentangle_36000int - 2250) % 9000) == 0:
|
||||
basemprimendpts_c = basemprimendpts22p5_c[int(primind) - 1, :]
|
||||
angle = currentangle - (22.5 * np.pi) / 180.0
|
||||
print('22p5\n')
|
||||
|
||||
# commented out because basemprimendpts11p25_c is undefined
|
||||
# elif ((currentangle_36000int - 1125) % 9000) == 0:
|
||||
# basemprimendpts_c = basemprimendpts11p25_c[int(primind), :]
|
||||
# angle = currentangle - (11.25 * np.pi) / 180.0
|
||||
# print('11p25\n')
|
||||
|
||||
else:
|
||||
print('ERROR: invalid angular resolution. angle = %d\n' % currentangle_36000int)
|
||||
return []
|
||||
|
||||
# %now figure out what action will be
|
||||
baseendpose_c = basemprimendpts_c[0:3]
|
||||
additionalactioncostmult = basemprimendpts_c[3]
|
||||
endx_c = np.round((baseendpose_c[0] * np.cos(angle)) - (baseendpose_c[1] * np.sin(angle)))
|
||||
endy_c = np.round((baseendpose_c[0] * np.sin(angle)) + (baseendpose_c[1] * np.cos(angle)))
|
||||
endtheta_c = np.fmod(angleind - 1 + baseendpose_c[2], numberofangles)
|
||||
endpose_c = np.array(np.hstack((endx_c, endy_c, endtheta_c)))
|
||||
print("endpose_c=", endpose_c)
|
||||
print(('rotation angle=%f\n' % (angle * 180.0 / np.pi)))
|
||||
# if np.logical_and(baseendpose_c[1] == 0., baseendpose_c[2] == 0.):
|
||||
# %fprintf(1, 'endpose=%d %d %d\n', endpose_c(1), endpose_c(2), endpose_c(3));
|
||||
|
||||
# %generate intermediate poses (remember they are w.r.t 0,0 (and not
|
||||
# %centers of the cells)
|
||||
numofsamples = 10
|
||||
intermcells_m = np.zeros((numofsamples, 3))
|
||||
if UNICYCLE_MPRIM_16DEGS == 1.0:
|
||||
startpt = np.array(np.hstack((0.0, 0.0, currentangle)))
|
||||
endpt = np.array(
|
||||
np.hstack(
|
||||
(
|
||||
(endpose_c[0] * resolution),
|
||||
(endpose_c[1] * resolution),
|
||||
(
|
||||
((np.fmod(angleind - 1 + baseendpose_c[2], numberofangles)) * 2.0 * np.pi)
|
||||
/ numberofangles
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
print("startpt =", startpt)
|
||||
print("endpt =", endpt)
|
||||
intermcells_m = np.zeros((numofsamples, 3))
|
||||
if np.logical_or(np.logical_and(endx_c == 0.0, endy_c == 0.0), baseendpose_c[2] == 0.0):
|
||||
# %turn in place or move forward
|
||||
for iind in np.arange(1.0, (numofsamples) + 1):
|
||||
fraction = float(iind - 1) / (numofsamples - 1)
|
||||
intermcells_m[int(iind) - 1, :] = np.array(
|
||||
(
|
||||
startpt[0] + (endpt[0] - startpt[0]) * fraction,
|
||||
startpt[1] + (endpt[1] - startpt[1]) * fraction,
|
||||
0,
|
||||
)
|
||||
)
|
||||
rotation_angle = baseendpose_c[2] * (2.0 * np.pi / numberofangles)
|
||||
intermcells_m[int(iind) - 1, 2] = np.fmod(startpt[2] + rotation_angle * fraction, (2.0 * np.pi))
|
||||
# print " ",iind," of ",numofsamples," fraction=",fraction," rotation=",rotation_angle
|
||||
|
||||
else:
|
||||
# %unicycle-based move forward or backward (http://sbpl.net/node/53)
|
||||
R = np.array(
|
||||
np.vstack(
|
||||
(
|
||||
np.hstack((np.cos(startpt[2]), np.sin(endpt[2]) - np.sin(startpt[2]))),
|
||||
np.hstack((np.sin(startpt[2]), -np.cos(endpt[2]) + np.cos(startpt[2]))),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
S = np.dot(np.linalg.pinv(R), np.array(np.vstack((endpt[0] - startpt[0], endpt[1] - startpt[1]))))
|
||||
l = S[0]
|
||||
tvoverrv = S[1]
|
||||
rv = (baseendpose_c[2] * 2.0 * np.pi / numberofangles) + l / tvoverrv
|
||||
tv = tvoverrv * rv
|
||||
|
||||
# print "R=\n",R
|
||||
# print "Rpi=\n",np.linalg.pinv(R)
|
||||
# print "S=\n",S
|
||||
# print "l=",l
|
||||
# print "tvoverrv=",tvoverrv
|
||||
# print "rv=",rv
|
||||
# print "tv=",tv
|
||||
|
||||
if l < 0.0:
|
||||
print(('WARNING: l = %f < 0 -> bad action start/end points\n' % (l)))
|
||||
l = 0.0
|
||||
|
||||
# %compute rv
|
||||
# %rv = baseendpose_c(3)*2*pi/numberofangles;
|
||||
# %compute tv
|
||||
# %tvx = (endpt(1) - startpt(1))*rv/(sin(endpt(3)) - sin(startpt(3)))
|
||||
# %tvy = -(endpt(2) - startpt(2))*rv/(cos(endpt(3)) - cos(startpt(3)))
|
||||
# %tv = (tvx + tvy)/2.0;
|
||||
# %generate samples
|
||||
for iind in np.arange(1, numofsamples + 1):
|
||||
dt = (iind - 1) / (numofsamples - 1)
|
||||
# %dtheta = rv*dt + startpt(3);
|
||||
# %intermcells_m(iind,:) = [startpt(1) + tv/rv*(sin(dtheta) - sin(startpt(3))) ...
|
||||
# % startpt(2) - tv/rv*(cos(dtheta) - cos(startpt(3))) ...
|
||||
# % dtheta];
|
||||
if (dt * tv) < l:
|
||||
intermcells_m[int(iind) - 1, :] = np.array(
|
||||
np.hstack(
|
||||
(
|
||||
startpt[0] + dt * tv * np.cos(startpt[2]),
|
||||
startpt[1] + dt * tv * np.sin(startpt[2]),
|
||||
startpt[2],
|
||||
)
|
||||
)
|
||||
)
|
||||
else:
|
||||
dtheta = rv * (dt - l / tv) + startpt[2]
|
||||
intermcells_m[int(iind) - 1, :] = np.array(
|
||||
np.hstack(
|
||||
(
|
||||
startpt[0]
|
||||
+ l * np.cos(startpt[2])
|
||||
+ tvoverrv * (np.sin(dtheta) - np.sin(startpt[2])),
|
||||
startpt[1]
|
||||
+ l * np.sin(startpt[2])
|
||||
- tvoverrv * (np.cos(dtheta) - np.cos(startpt[2])),
|
||||
dtheta,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
# %correct
|
||||
errorxy = np.array(
|
||||
np.hstack(
|
||||
(
|
||||
endpt[0] - intermcells_m[int(numofsamples) - 1, 0],
|
||||
endpt[1] - intermcells_m[int(numofsamples) - 1, 1],
|
||||
)
|
||||
)
|
||||
)
|
||||
# print('l=%f errx=%f erry=%f\n'%(l, errorxy[0], errorxy[1]))
|
||||
interpfactor = np.array(
|
||||
np.hstack((np.arange(0.0, 1.0 + (1.0 / (numofsamples)), 1.0 / (numofsamples - 1))))
|
||||
)
|
||||
|
||||
# print "intermcells_m=",intermcells_m
|
||||
# print "interp'=",interpfactor.conj().T
|
||||
|
||||
intermcells_m[:, 0] = intermcells_m[:, 0] + errorxy[0] * interpfactor.conj().T
|
||||
intermcells_m[:, 1] = intermcells_m[:, 1] + errorxy[1] * interpfactor.conj().T
|
||||
|
||||
# %write out
|
||||
fout.write('endpose_c: %d %d %d\n' % (endpose_c[0], endpose_c[1], endpose_c[2]))
|
||||
fout.write('additionalactioncostmult: %d\n' % (additionalactioncostmult))
|
||||
fout.write('intermediateposes: %d\n' % (matrix_size(intermcells_m, 1.0)))
|
||||
for interind in np.arange(1.0, (matrix_size(intermcells_m, 1.0)) + 1):
|
||||
fout.write(
|
||||
'%.4f %.4f %.4f\n'
|
||||
% (
|
||||
intermcells_m[int(interind) - 1, 0],
|
||||
intermcells_m[int(interind) - 1, 1],
|
||||
intermcells_m[int(interind) - 1, 2],
|
||||
)
|
||||
)
|
||||
|
||||
if visualize:
|
||||
plt.plot(intermcells_m[:, 0], intermcells_m[:, 1], linestyle="-", marker="o")
|
||||
plt.text(endpt[0], endpt[1], '{:2.0f}'.format(endpose_c[2]))
|
||||
# if (visualize):
|
||||
# plt.waitforbuttonpress() # uncomment to plot each primitive set one at a time
|
||||
|
||||
fout.close()
|
||||
if visualize:
|
||||
# plt.waitforbuttonpress() # hold until buttom pressed
|
||||
plt.show() # Keep windows open until the program is terminated
|
||||
return []
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
rospack = rospkg.RosPack()
|
||||
outfilename = rospack.get_path('mir_navigation') + '/mprim/unicycle_highcost_5cm.mprim'
|
||||
genmprim_unicycle(outfilename, visualize=True)
|
||||
36
config/runtime/mprim/localization.yaml
Normal file
36
config/runtime/mprim/localization.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
Amcl:
|
||||
use_map_topic: true
|
||||
odom_model_type: "diff-corrected"
|
||||
gui_publish_rate: 5.0
|
||||
save_pose_rate: 0.5
|
||||
laser_max_beams: 300
|
||||
laser_min_range: -1.0
|
||||
laser_max_range: -1.0
|
||||
min_particles: 1000
|
||||
max_particles: 3000
|
||||
kld_err: 0.05
|
||||
kld_z: 0.99
|
||||
odom_alpha1: 0.02
|
||||
odom_alpha2: 0.01
|
||||
odom_alpha3: 0.01
|
||||
odom_alpha4: 0.02
|
||||
laser_z_hit: 0.5
|
||||
laser_z_short: 0.05
|
||||
laser_z_max: 0.05
|
||||
laser_z_rand: 0.5
|
||||
laser_sigma_hit: 0.2
|
||||
laser_lambda_short: 0.1
|
||||
laser_model_type: "likelihood_field"
|
||||
laser_likelihood_max_dist: 1.0
|
||||
update_min_d: 0.05
|
||||
update_min_a: 0.05
|
||||
odom_frame_id: odom
|
||||
base_frame_id: base_link
|
||||
global_frame_id: map
|
||||
resample_interval: 1
|
||||
transform_tolerance: 0.2
|
||||
recovery_alpha_slow: 0.001
|
||||
recovery_alpha_fast: 0.001
|
||||
initial_pose_x: 0.0
|
||||
initial_pose_y: 0.0
|
||||
initial_pose_a: 0.0
|
||||
63
config/runtime/mprim/mapping.yaml
Normal file
63
config/runtime/mprim/mapping.yaml
Normal file
@@ -0,0 +1,63 @@
|
||||
SlamToolBox:
|
||||
# Plugin params
|
||||
solver_plugin: solver_plugins::CeresSolver
|
||||
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
|
||||
ceres_preconditioner: SCHUR_JACOBI
|
||||
ceres_trust_strategy: LEVENBERG_MARQUARDT
|
||||
ceres_dogleg_type: TRADITIONAL_DOGLEG
|
||||
ceres_loss_function: None
|
||||
|
||||
# ROS Parameters
|
||||
odom_frame: odom
|
||||
map_frame: map
|
||||
base_frame: base_link
|
||||
scan_topic: /scan
|
||||
mode: mapping #localization
|
||||
debug_logging: false
|
||||
throttle_scans: 1
|
||||
transform_publish_period: 0.02 #if 0 never publishes odometry
|
||||
map_update_interval: 10.0
|
||||
resolution: 0.05
|
||||
max_laser_range: 20.0 #for rastering images
|
||||
minimum_time_interval: 0.5
|
||||
transform_timeout: 0.2
|
||||
tf_buffer_duration: 14400.
|
||||
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps
|
||||
enable_interactive_mode: true
|
||||
|
||||
# General Parameters
|
||||
use_scan_matching: true
|
||||
use_scan_barycenter: true
|
||||
minimum_travel_distance: 0.5
|
||||
minimum_travel_heading: 0.5
|
||||
scan_buffer_size: 10
|
||||
scan_buffer_maximum_scan_distance: 10
|
||||
link_match_minimum_response_fine: 0.1
|
||||
link_scan_maximum_distance: 1.5
|
||||
loop_search_maximum_distance: 3.0
|
||||
do_loop_closing: true
|
||||
loop_match_minimum_chain_size: 10
|
||||
loop_match_maximum_variance_coarse: 3.0
|
||||
loop_match_minimum_response_coarse: 0.35
|
||||
loop_match_minimum_response_fine: 0.45
|
||||
|
||||
# Correlation Parameters - Correlation Parameters
|
||||
correlation_search_space_dimension: 0.5
|
||||
correlation_search_space_resolution: 0.01
|
||||
correlation_search_space_smear_deviation: 0.1
|
||||
|
||||
# Correlation Parameters - Loop Closure Parameters
|
||||
loop_search_space_dimension: 8.0
|
||||
loop_search_space_resolution: 0.05
|
||||
loop_search_space_smear_deviation: 0.03
|
||||
|
||||
# Scan Matcher Parameters
|
||||
distance_variance_penalty: 0.5
|
||||
angle_variance_penalty: 1.0
|
||||
|
||||
fine_search_angle_offset: 0.00349
|
||||
coarse_search_angle_offset: 0.349
|
||||
coarse_angle_resolution: 0.0349
|
||||
minimum_angle_penalty: 0.9
|
||||
minimum_distance_penalty: 0.5
|
||||
use_response_expansion: true
|
||||
106
config/runtime/mprim/mpc_local_planner_params.yaml
Executable file
106
config/runtime/mprim/mpc_local_planner_params.yaml
Executable file
@@ -0,0 +1,106 @@
|
||||
base_local_planner: mpc_local_planner/MpcLocalPlannerROS
|
||||
MpcLocalPlannerROS:
|
||||
|
||||
odom_topic: odom
|
||||
|
||||
## Robot settings
|
||||
robot:
|
||||
type: "unicycle"
|
||||
unicycle:
|
||||
max_vel_x: 0.5
|
||||
max_vel_x_backwards: 0.3
|
||||
max_vel_theta: 0.3
|
||||
acc_lim_x: 0.4 # deactive bounds with zero
|
||||
dec_lim_x: 0.4 # deactive bounds with zero
|
||||
acc_lim_theta: 0.6 # deactivate bounds with zero
|
||||
|
||||
## Footprint model for collision avoidance
|
||||
footprint_model:
|
||||
type: "point"
|
||||
is_footprint_dynamic: False
|
||||
|
||||
## Collision avoidance
|
||||
collision_avoidance:
|
||||
min_obstacle_dist: 0.5 # Note, this parameter must be chosen w.r.t. the footprint_model
|
||||
enable_dynamic_obstacles: False
|
||||
force_inclusion_dist: 0.5
|
||||
cutoff_dist: 2.0
|
||||
include_costmap_obstacles: True
|
||||
costmap_obstacles_behind_robot_dist: 1.5
|
||||
collision_check_no_poses: 5
|
||||
|
||||
## Planning grid
|
||||
grid:
|
||||
type: "fd_grid"
|
||||
grid_size_ref: 20 # Set horizon length here (T = (grid_size_ref-1) * dt_ref); Note, also check max_global_plan_lookahead_dist
|
||||
dt_ref: 0.3 # and here the corresponding temporal resolution
|
||||
xf_fixed: [False, False, False] # Unfix final state -> we use terminal cost below
|
||||
warm_start: True
|
||||
collocation_method: "forward_differences"
|
||||
cost_integration_method: "left_sum"
|
||||
variable_grid:
|
||||
enable: False # We want a fixed grid
|
||||
min_dt: 0.0;
|
||||
max_dt: 10.0;
|
||||
grid_adaptation:
|
||||
enable: True
|
||||
dt_hyst_ratio: 0.1
|
||||
min_grid_size: 2
|
||||
max_grid_size: 50
|
||||
|
||||
## Planning options
|
||||
planning:
|
||||
objective:
|
||||
type: "quadratic_form" # minimum_time requires grid/variable_grid/enable=True and grid/xf_fixed set properly
|
||||
quadratic_form:
|
||||
state_weights: [2.0, 2.0, 0.25]
|
||||
control_weights: [0.1, 0.05]
|
||||
integral_form: False
|
||||
terminal_cost:
|
||||
type: "quadratic" # can be "none"
|
||||
quadratic:
|
||||
final_state_weights: [10.0, 10.0, 0.5]
|
||||
terminal_constraint:
|
||||
type: "none" # can be "none"
|
||||
l2_ball:
|
||||
weight_matrix: [1.0, 1.0, 1.0]
|
||||
radius: 5
|
||||
|
||||
## Controller options
|
||||
controller:
|
||||
outer_ocp_iterations: 1
|
||||
xy_goal_tolerance: 0.05
|
||||
yaw_goal_tolerance: 0.04
|
||||
global_plan_overwrite_orientation: False
|
||||
global_plan_prune_distance: 1.5
|
||||
allow_init_with_backward_motion: True
|
||||
max_global_plan_lookahead_dist: 1.0 # Check horizon length
|
||||
force_reinit_new_goal_dist: 1.0
|
||||
force_reinit_new_goal_angular: 1.57
|
||||
force_reinit_num_steps: 0
|
||||
prefer_x_feedback: False
|
||||
publish_ocp_results: True
|
||||
|
||||
## Solver settings
|
||||
solver:
|
||||
type: "ipopt"
|
||||
ipopt:
|
||||
iterations: 100
|
||||
max_cpu_time: -1.0
|
||||
ipopt_numeric_options:
|
||||
tol: 1e-3
|
||||
ipopt_string_options:
|
||||
linear_solver: "mumps"
|
||||
hessian_approximation: "exact" # exact or limited-memory
|
||||
lsq_lm:
|
||||
iterations: 10
|
||||
weight_init_eq: 2
|
||||
weight_init_ineq: 2
|
||||
weight_init_bounds: 2
|
||||
weight_adapt_factor_eq: 1.5
|
||||
weight_adapt_factor_ineq: 1.5
|
||||
weight_adapt_factor_bounds: 1.5
|
||||
weight_adapt_max_eq: 500
|
||||
weight_adapt_max_ineq: 500
|
||||
weight_adapt_max_bounds: 500
|
||||
|
||||
8
config/runtime/mprim/mqtt_general.yaml
Normal file
8
config/runtime/mprim/mqtt_general.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
# MQTT:
|
||||
# Name: T800
|
||||
# Host: 172.20.235.170
|
||||
# Port: 1885
|
||||
# Client_ID: T800
|
||||
# Username: robotics
|
||||
# Password: robotics
|
||||
# Keep_Alive: 60
|
||||
71
config/runtime/mprim/ros_diff_drive_controller.yaml
Executable file
71
config/runtime/mprim/ros_diff_drive_controller.yaml
Executable file
@@ -0,0 +1,71 @@
|
||||
# -----------------------------------
|
||||
left_wheel : 'left_wheel_joint'
|
||||
right_wheel : 'right_wheel_joint'
|
||||
publish_rate: 50 # this is what the real MiR platform publishes (default: 50)
|
||||
# These covariances are exactly what the real MiR platform publishes
|
||||
pose_covariance_diagonal : [0.00001, 0.00001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
|
||||
twist_covariance_diagonal: [0.1, 0.1, 1000000.0, 1000000.0, 1000000.0, 1000.0]
|
||||
enable_odom_tf: true
|
||||
enable_wheel_tf: true
|
||||
allow_multiple_cmd_vel_publishers: true
|
||||
# open_loop: false
|
||||
# Wheel separation and diameter. These are both optional.
|
||||
# diff_drive_controller will attempt to read either one or both from the
|
||||
# URDF if not specified as a parameter.
|
||||
# We don't set the value here because it's different for each MiR type (100, 250, ...), and
|
||||
# the plugin figures out the correct values.
|
||||
wheel_separation : 0.5106
|
||||
wheel_radius : 0.1
|
||||
|
||||
# Wheel separation and radius multipliers
|
||||
wheel_separation_multiplier: 1.0 # default: 1.0
|
||||
wheel_radius_multiplier : 1.0 # default: 1.0
|
||||
|
||||
# Velocity commands timeout [s], default 0.5
|
||||
cmd_vel_timeout: 1.0
|
||||
|
||||
# frame_ids (same as real MiR platform)
|
||||
base_frame_id: base_link # default: base_link base_link
|
||||
odom_frame_id: odom # default: odom
|
||||
|
||||
# Velocity and acceleration limits
|
||||
# Whenever a min_* is unspecified, default to -max_*
|
||||
linear:
|
||||
x:
|
||||
has_velocity_limits : true
|
||||
max_velocity : 1.5 # m/s; move_base max_vel_x: 0.8
|
||||
min_velocity : -1.5 # m/s
|
||||
has_acceleration_limits: true
|
||||
max_acceleration : 0.5 # m/s^2; move_base acc_lim_x: 1.5
|
||||
min_acceleration : -0.5 # m/s^2
|
||||
has_jerk_limits : true
|
||||
max_jerk : 3.0 # m/s^3
|
||||
angular:
|
||||
z:
|
||||
has_velocity_limits : true
|
||||
max_velocity : 1.0 # rad/s; move_base max_rot_vel: 1.0
|
||||
min_velocity : -1.0
|
||||
has_acceleration_limits: true
|
||||
max_acceleration : 3.0 # rad/s^2; move_base acc_lim_th: 2.0
|
||||
has_jerk_limits : true
|
||||
max_jerk : 2.5 # rad/s^3
|
||||
|
||||
left_wheel_joint:
|
||||
lookup_name: WheelPlugin
|
||||
max_publish_rate: 50
|
||||
mesurement_topic: left_encoder
|
||||
frame_id: left_wheel_link
|
||||
wheel_topic: /left_wheel
|
||||
subscribe_queue_size: 1
|
||||
command_timeout: 5.0
|
||||
origin : [0.0, 0.255, 0.075, 0.0, 0.0, 0.0] # origin from base_frame_id
|
||||
|
||||
right_wheel_joint:
|
||||
lookup_name: WheelPlugin
|
||||
max_publish_rate: 50
|
||||
mesurement_topic: right_encoder
|
||||
frame_id: right_wheel_link
|
||||
wheel_topic: /right_wheel
|
||||
subscribe_queue_size: 1
|
||||
command_timeout: 5.0
|
||||
origin : [0.0, -0.255, 0.075, 0.0, 0.0, 0.0] # origin from base_frame_id
|
||||
10
config/runtime/mprim/sbpl_global_params.yaml
Executable file
10
config/runtime/mprim/sbpl_global_params.yaml
Executable file
@@ -0,0 +1,10 @@
|
||||
base_global_planner: SBPLLatticePlanner
|
||||
SBPLLatticePlanner:
|
||||
environment_type: XYThetaLattice
|
||||
planner_type: ARAPlanner
|
||||
allocated_time: 10.0
|
||||
initial_epsilon: 1.0
|
||||
force_scratch_limit: 10000
|
||||
forward_search: true
|
||||
nominalvel_mpersecs: 0.2
|
||||
timetoturn45degsinplace_secs: 0.6 # = 0.6 rad/s
|
||||
61
config/runtime/mprim/sick_line_guidance_mls.yaml
Normal file
61
config/runtime/mprim/sick_line_guidance_mls.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
bus:
|
||||
device: can0
|
||||
driver_plugin: can::SocketCANInterface
|
||||
master_allocator: canopen::SimpleMaster::Allocator
|
||||
sync:
|
||||
interval_ms: 10
|
||||
overflow: 0
|
||||
#
|
||||
# heartbeat: # simple heartbeat producer (optional, not supported by OLS or MLS, do not enable heartbeats)
|
||||
# rate: 100 # heartbeat rate (1/rate in seconds)
|
||||
# msg: "77f#05" # message to send, cansend format: heartbeat of node 127 with status 5=Started
|
||||
nodes:
|
||||
f_mlse:
|
||||
id: 0x01 # CAN-Node-ID of can device, default: Node-ID 10=0x0A for OLS and MLS
|
||||
eds_pkg: sick_line_guidance # package name for relative path
|
||||
eds_file: mls/SICK-MLS.eds # path to EDS/DCF file
|
||||
publish: ["1001","1018sub1","1018sub4","2021sub1!","2021sub2!","2021sub3!","2021sub4!","2022!"]
|
||||
# MLS: 1001 = error register, 1018sub1 = VendorID, 1018sub4 = SerialNumber, TPDO1 = 0x2021sub1 to 0x2021sub4 and 0x2022
|
||||
|
||||
# sick_line_guidance configuration of this node:
|
||||
sick_device_family: "MLS" # can devices of OLS10, OLS20 or MLS family currently supported
|
||||
sick_topic: "f_mlse" # MLS_Measurement messages are published in topic "/mls"
|
||||
subscribe_queue_size: 1
|
||||
sick_frame_id: "f_mlse" # MLS_Measurement messages are published frame_id "mls_measurement_frame"
|
||||
|
||||
# device configuration of writable parameter by dcf_overlay: "objectindex": "parametervalue"
|
||||
# example: "2027": "0x01" # Object 2027 (sensorFlipped, defaultvalue 0x00) will be configured with value 0x01
|
||||
# dcf_overlay:
|
||||
# "2028sub1": "0x01" # UseMarkers (0 = disable marker detection, 1 = enable marker detection), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2028sub2": "0x02" # MarkerStyle (0 = disable marker detection, 1 = standard mode, 2 = extended mode), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2028sub3": "0x01" # FailSafeMode (0 = disabled, 1 = enabled), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2025": "1000" # Min.Level, UINT16, DataType=0x0006, defaultvalue=600
|
||||
# "2026": "1" # Offset [mm] Nullpunkt, INT16, DataType=0x0003, defaultvalue=0
|
||||
# "2027": "0x01" # sensorFlipped, UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2029": "0x01" # LockTeach, UINT8, DataType=0x0005, defaultvalue=0
|
||||
#
|
||||
|
||||
b_mlse:
|
||||
id: 0x02 # CAN-Node-ID of can device, default: Node-ID 10=0x0A for OLS and MLS
|
||||
eds_pkg: sick_line_guidance # package name for relative path
|
||||
eds_file: mls/SICK-MLS.eds # path to EDS/DCF file
|
||||
publish: ["1001","1018sub1","1018sub4","2021sub1!","2021sub2!","2021sub3!","2021sub4!","2022!"]
|
||||
# MLS: 1001 = error register, 1018sub1 = VendorID, 1018sub4 = SerialNumber, TPDO1 = 0x2021sub1 to 0x2021sub4 and 0x2022
|
||||
|
||||
# sick_line_guidance configuration of this node:
|
||||
sick_device_family: "MLS" # can devices of OLS10, OLS20 or MLS family currently supported
|
||||
sick_topic: "b_mlse" # MLS_Measurement messages are published in topic "/mls"
|
||||
subscribe_queue_size: 1
|
||||
sick_frame_id: "b_mlse" # MLS_Measurement messages are published frame_id "mls_measurement_frame"
|
||||
|
||||
# device configuration of writable parameter by dcf_overlay: "objectindex": "parametervalue"
|
||||
# example: "2027": "0x01" # Object 2027 (sensorFlipped, defaultvalue 0x00) will be configured with value 0x01
|
||||
# dcf_overlay:
|
||||
# "2028sub1": "0x01" # UseMarkers (0 = disable marker detection, 1 = enable marker detection), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2028sub2": "0x02" # MarkerStyle (0 = disable marker detection, 1 = standard mode, 2 = extended mode), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2028sub3": "0x01" # FailSafeMode (0 = disabled, 1 = enabled), UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2025": "1000" # Min.Level, UINT16, DataType=0x0006, defaultvalue=600
|
||||
# "2026": "1" # Offset [mm] Nullpunkt, INT16, DataType=0x0003, defaultvalue=0
|
||||
# "2027": "0x01" # sensorFlipped, UINT8, DataType=0x0005, defaultvalue=0
|
||||
# "2029": "0x01" # LockTeach, UINT8, DataType=0x0005, defaultvalue=0
|
||||
#
|
||||
1203
config/runtime/mprim/unicycle_5cm.mprim
Executable file
1203
config/runtime/mprim/unicycle_5cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_5cm_expensive_turn_in_place.mprim
Executable file
1683
config/runtime/mprim/unicycle_5cm_expensive_turn_in_place.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_5cm_expensive_turn_in_place_highcost.mprim
Executable file
1683
config/runtime/mprim/unicycle_5cm_expensive_turn_in_place_highcost.mprim
Executable file
File diff suppressed because it is too large
Load Diff
2403
config/runtime/mprim/unicycle_5cm_noreverse_trolley.mprim
Executable file
2403
config/runtime/mprim/unicycle_5cm_noreverse_trolley.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_highcost_10cm.mprim
Executable file
1683
config/runtime/mprim/unicycle_highcost_10cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_highcost_1cm.mprim
Executable file
1683
config/runtime/mprim/unicycle_highcost_1cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_highcost_2_5cm.mprim
Executable file
1683
config/runtime/mprim/unicycle_highcost_2_5cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_highcost_2cm.mprim
Executable file
1683
config/runtime/mprim/unicycle_highcost_2cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
1683
config/runtime/mprim/unicycle_highcost_5cm.mprim
Executable file
1683
config/runtime/mprim/unicycle_highcost_5cm.mprim
Executable file
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/pnkx_local_planner_params.yaml
|
||||
199
config/runtime/pnkx_local_planner_params.yaml
Normal file
199
config/runtime/pnkx_local_planner_params.yaml
Normal file
@@ -0,0 +1,199 @@
|
||||
yaw_goal_tolerance: 0.02
|
||||
xy_goal_tolerance: 0.03
|
||||
min_approach_linear_velocity: 0.05
|
||||
|
||||
LocalPlannerAdapter:
|
||||
library_path: liblocal_planner_adapter
|
||||
PNKXLocalPlanner:
|
||||
# Algorithm
|
||||
library_path: libpnkx_local_planner
|
||||
trajectory_generator_name: LimitedAccelGenerator
|
||||
algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory
|
||||
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
|
||||
# Goal checking
|
||||
goal_checker_name: GoalChecker
|
||||
|
||||
PNKXDockingLocalPlanner:
|
||||
# Algorithm
|
||||
library_path: libpnkx_local_planner
|
||||
trajectory_generator_name: LimitedAccelGenerator
|
||||
algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory
|
||||
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
|
||||
# Goal checking
|
||||
goal_checker_name: GoalChecker
|
||||
|
||||
PNKXGoStraightLocalPlanner:
|
||||
# Algorithm
|
||||
library_path: libpnkx_local_planner
|
||||
trajectory_generator_name: LimitedAccelGenerator
|
||||
algorithm_nav_name: MKTAlgorithmDiffGoStraight
|
||||
# Goal checking
|
||||
goal_checker_name: GoalChecker
|
||||
|
||||
PNKXRotateLocalPlanner:
|
||||
# Algorithm
|
||||
library_path: libpnkx_local_planner
|
||||
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
|
||||
trajectory_generator_name: LimitedAccelGenerator
|
||||
# Goal checking
|
||||
goal_checker_name: SimpleGoalChecker
|
||||
stateful: true
|
||||
|
||||
LimitedAccelGenerator:
|
||||
library_path: libmkt_plugins_standard_traj_generator
|
||||
max_vel_x: 1.2
|
||||
min_vel_x: -1.2
|
||||
|
||||
max_vel_y: 0.0 # diff drive robot
|
||||
min_vel_y: 0.0 # diff drive robot
|
||||
|
||||
max_speed_xy: 2.0 # max_trans_vel: 0.8 # choose slightly less than the base's capability
|
||||
min_speed_xy: 0.25 # min_trans_vel: 0.1 # this is the min trans velocity when there is negligible rotational velocity
|
||||
|
||||
max_vel_theta: 0.4 # max_rot_vel: 1.0 # choose slightly less than the base's capability
|
||||
min_vel_theta: 0.05 # min_rot_vel: 0.1 default: 0.4 # this is the min angular velocity when there is negligible translational velocity
|
||||
|
||||
acc_lim_x: 3.0
|
||||
acc_lim_y: 0.0 # diff drive robot
|
||||
acc_lim_theta: 1.5
|
||||
decel_lim_x: -3.0
|
||||
decel_lim_y: -0.0
|
||||
decel_lim_theta: -2.0
|
||||
|
||||
# Whether to split the path into segments or not
|
||||
split_path: true
|
||||
sim_time: 1.5
|
||||
vx_samples: 15
|
||||
vy_samples: 1
|
||||
vtheta_samples: 10
|
||||
discretize_by_time: true
|
||||
angular_granularity: 0.05
|
||||
linear_granularity: 0.1
|
||||
# sim_period
|
||||
include_last_point: true
|
||||
|
||||
MKTAlgorithmDiffPredictiveTrajectory:
|
||||
library_path: libmkt_algorithm_diff
|
||||
xy_local_goal_tolerance: 0.05
|
||||
angle_threshold: 0.6
|
||||
index_samples: 60
|
||||
follow_step_path: true
|
||||
|
||||
# Kalman filter tuning (filters v and w commands)
|
||||
kf_q_v: 0.25
|
||||
kf_q_w: 0.8
|
||||
kf_r_v: 0.05
|
||||
kf_r_w: 0.08
|
||||
kf_p0: 0.5
|
||||
kf_filter_angular: false
|
||||
|
||||
# Lookahead
|
||||
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false)
|
||||
# only when false:
|
||||
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6)
|
||||
# only when true:
|
||||
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3)
|
||||
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9)
|
||||
lookahead_time: 1.9 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5)
|
||||
min_journey_squared: 0.2 # Minimum squared journey to consider for goal (default: 0.2)
|
||||
max_journey_squared: 0.5 # Maximum squared journey to consider for goal (default: 0.2)
|
||||
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2)
|
||||
|
||||
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true
|
||||
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true)
|
||||
# only when true:
|
||||
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785)
|
||||
angular_decel_zone: 0.1
|
||||
|
||||
# stoped
|
||||
rot_stopped_velocity: 0.03
|
||||
trans_stopped_velocity: 0.03
|
||||
|
||||
use_final_heading_alignment: true
|
||||
final_heading_xy_tolerance: 0.1
|
||||
final_heading_angle_tolerance: 0.05
|
||||
final_heading_min_velocity: 0.05
|
||||
final_heading_kp_angular: 1.2
|
||||
final_heading_ki_angular: 0.002
|
||||
final_heading_kd_angular: 0.12
|
||||
|
||||
MKTAlgorithmDiffGoStraight:
|
||||
library_path: libmkt_algorithm_diff
|
||||
xy_local_goal_tolerance: 0.05
|
||||
angle_threshold: 0.8
|
||||
index_samples: 60
|
||||
follow_step_path: true
|
||||
|
||||
# Lookahead
|
||||
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false)
|
||||
# only when false:
|
||||
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6)
|
||||
# only when true:
|
||||
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3)
|
||||
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9)
|
||||
lookahead_time: 2.0 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5)
|
||||
min_journey_squared: 1.0 # Minimum squared journey to consider for goal (default: 0.2)
|
||||
max_journey_squared: 1.0 # Maximum squared journey to consider for goal (default: 0.2)
|
||||
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2)
|
||||
|
||||
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true
|
||||
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true)
|
||||
# only when true:
|
||||
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785)
|
||||
angular_decel_zone: 0.1
|
||||
|
||||
# stoped
|
||||
rot_stopped_velocity: 0.03
|
||||
trans_stopped_velocity: 0.03
|
||||
|
||||
use_final_heading_alignment: true
|
||||
final_heading_xy_tolerance: 0.1
|
||||
final_heading_angle_tolerance: 0.05
|
||||
final_heading_min_velocity: 0.05
|
||||
final_heading_kp_angular: 1.5
|
||||
final_heading_ki_angular: 0.2
|
||||
final_heading_kd_angular: 0.05
|
||||
|
||||
MKTAlgorithmDiffRotateToGoal:
|
||||
library_path: libmkt_algorithm_diff
|
||||
xy_local_goal_tolerance: 0.05
|
||||
angle_threshold: 0.47
|
||||
index_samples: 60
|
||||
follow_step_path: true
|
||||
|
||||
# Lookahead
|
||||
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false)
|
||||
# only when false:
|
||||
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6)
|
||||
# only when true:
|
||||
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3)
|
||||
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9)
|
||||
lookahead_time: 1.9 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5)
|
||||
min_journey_squared: 0.2 # Minimum squared journey to consider for goal (default: 0.2)
|
||||
max_journey_squared: 0.8 # Maximum squared journey to consider for goal (default: 0.2)
|
||||
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2)
|
||||
|
||||
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true
|
||||
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true)
|
||||
# only when true:
|
||||
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785)
|
||||
angular_decel_zone: 0.1
|
||||
|
||||
# stoped
|
||||
rot_stopped_velocity: 0.03
|
||||
trans_stopped_velocity: 0.03
|
||||
|
||||
use_final_heading_alignment: true
|
||||
final_heading_xy_tolerance: 0.1
|
||||
final_heading_angle_tolerance: 0.05
|
||||
final_heading_min_velocity: 0.05
|
||||
final_heading_kp_angular: 2.0
|
||||
near_goal_heading_kp: 1.5
|
||||
near_goal_heading_ki: 0.0
|
||||
near_goal_heading_kd: 0.0
|
||||
|
||||
GoalChecker:
|
||||
library_path: libmkt_plugins_goal_checker
|
||||
|
||||
SimpleGoalChecker:
|
||||
library_path: libmkt_plugins_goal_checker
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/priest_local_planner_params.yaml
|
||||
56
config/runtime/priest_local_planner_params.yaml
Normal file
56
config/runtime/priest_local_planner_params.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
PriestLocalPlanner:
|
||||
library_path: libpriest_local_planner
|
||||
|
||||
# ================= Horizon / optimizer =================
|
||||
t_fin: 7.0 # [s] planning horizon
|
||||
num_steps: 30 # trajectory samples over the horizon
|
||||
num_batch: 60 # trajectories per CEM iteration
|
||||
initial_up_sampling: 5 # candidate oversampling factor
|
||||
ellite_num: 40 # elites ranked by projection residual
|
||||
num_warm: 20 # warm-started trajectories between cycles
|
||||
max_proj_iter: 8 # alternating projection iterations
|
||||
max_cem_iter: 4 # CEM iterations per control cycle
|
||||
optimizer_threads: 4 # bounded workers; avoid severe overhead from using all CPU cores
|
||||
solve_time_warn_ms: 30.0 # [ms] leaves margin inside the 30 Hz controller period
|
||||
lateral_std: 0.8 # [m] std of lateral waypoint perturbations
|
||||
|
||||
# ================= Robot limits (differential drive) =================
|
||||
max_velocity: 0.5 # [m/s] forward velocity limit
|
||||
max_angular_velocity: 0.4 # [rad/s] also enforced inside the optimizer as a
|
||||
# lateral-acceleration clamp |a_n| <= omega_max * v
|
||||
max_acceleration: 0.5 # [m/s^2] used in the trajectory projection
|
||||
reference_velocity: 0.4 # [m/s] desired cruise speed along the path
|
||||
v_eps: 0.05 # [m/s] below this speed the curvature clamp/cost is skipped
|
||||
v_min_seed: 0.05 # [m/s] initial-velocity seed along yaw when the robot is stopped
|
||||
|
||||
# Trajectory -> differential (v, omega) conversion with curvature feedforward:
|
||||
# omega = clamp(omega_traj, +-max_angular_velocity) - heading_gain * heading_error
|
||||
heading_gain: 1.5 # [1/s] feedback gain on the heading error
|
||||
heading_error_stop: 1.2 # [rad] above this, rotate in place (v = 0)
|
||||
min_in_place_yawrate: 0.2 # [rad/s]
|
||||
|
||||
# ================= Goal / plan =================
|
||||
xy_goal_tolerance: 0.10 # [m]
|
||||
yaw_goal_tolerance: 0.10 # [rad]
|
||||
max_global_plan_lookahead_dist: 3.0 # [m]
|
||||
|
||||
# ================= Obstacles (from local costmap) =================
|
||||
num_obs: 40 # obstacles in the CEM cost
|
||||
num_obs_proj: 30 # closest obstacles inside the projection
|
||||
obstacle_range: 2.5 # [m] costmap scan radius around the robot
|
||||
robot_radius: 0.50 # [m]
|
||||
obstacle_point_radius: 0.08 # [m]
|
||||
footprint_padding: 0.05 # [m]
|
||||
obstacle_cost_threshold: 150
|
||||
obstacle_cell_step: 2
|
||||
max_obstacle_points: 150
|
||||
|
||||
# ================= Cost weights =================
|
||||
weight_smoothness: 0.1
|
||||
weight_track: 0.2
|
||||
weight_obs: 1.2
|
||||
weight_clearance: 3.0 # bounded proximity term in (0,1]: 1 at an obstacle
|
||||
# centre, 0.5 on the collision boundary, 0 out of range
|
||||
weight_angular: 0.5 # hinge penalty on |omega| > max_angular_velocity
|
||||
cem_lamda: 0.9 # CEM temperature
|
||||
cem_alpha: 0.7 # CEM mean/cov blending factor
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/recovery_behaviors_params.yaml
|
||||
310
config/runtime/recovery_behaviors_params.yaml
Normal file
310
config/runtime/recovery_behaviors_params.yaml
Normal file
@@ -0,0 +1,310 @@
|
||||
# =================================================================================================
|
||||
# recovery_core — bộ recovery behavior (gen-2, tick-based) và tham số vận hành.
|
||||
#
|
||||
# Quy ước comment: dòng mô tả = LÀ GÌ / vì sao; `► Chỉnh:` = tăng giảm theo triệu chứng nào.
|
||||
#
|
||||
# Đây là cây config RUNTIME. Bản dùng cho test của gói nằm ở
|
||||
# `Test/recovery_core/test/config/recovery_behaviors_params.yaml` — sửa tham số vận hành thì sửa ở
|
||||
# đây, đừng sửa bản test.
|
||||
#
|
||||
# Danh sách này được `recovery_core::RecoveryRegistry` đọc; caller (RecoveryRunner của move_base2)
|
||||
# truyền namespace `recovery` vào. Khoá `recovery_behaviors:` trong `move_base_common_params.yaml`
|
||||
# thuộc về move_base cũ và KHÔNG liên quan tới file này.
|
||||
# =================================================================================================
|
||||
|
||||
recovery:
|
||||
# `behaviors` là registry mọi plugin/instance CÓ THỂ dùng. Thứ tự ở đây chỉ là thứ tự nạp,
|
||||
# không còn quyết định luồng chạy. `routes` bên dưới chọn riêng chuỗi theo trigger.
|
||||
#
|
||||
# wait : không di chuyển. Vật cản động (người, xe khác) tự đi qua là xong.
|
||||
# clear : xoá vật cản đã tích trong costmap, gần trước rồi xa sau.
|
||||
# rotate : quay tại chỗ cho costmap nhìn lại xung quanh.
|
||||
# back_up: LÙI — hướng robot không có sensor, nên xếp cuối cùng.
|
||||
#
|
||||
# ► Chỉnh: khai ở đây KHÔNG làm behavior chạy — phải đưa tên nó vào một `route` bên dưới. Một
|
||||
# `type` được phép khai nhiều `name` khác nhau để có nhiều instance khác tuning (vd một
|
||||
# `back_up` lùi 0.1 m và một `back_up_far` lùi 0.6 m).
|
||||
behaviors:
|
||||
- {name: wait, type: WaitRecovery}
|
||||
- {name: clear, type: ClearCostmapRecovery}
|
||||
# Đặt schema trước plugin: chưa có `DetourPathRecovery`/library_path thì RecoveryRunner bỏ
|
||||
# entry này cùng warning, và bỏ nó khỏi từng route. Khi plugin SBPL được thêm sau này, không
|
||||
# cần sửa move_base2 hay route.
|
||||
- {name: detour_path, type: DetourPathRecovery}
|
||||
- {name: rotate, type: RotateRecovery}
|
||||
- {name: back_up, type: BackUpRecovery}
|
||||
|
||||
# trigger -> tên behavior thử tuần tự; lần lỗi kế tiếp cùng trigger mới tiến tới phần tử tiếp
|
||||
# theo của route đó. Đường quay về sau khi một behavior kết thúc (contract 2026-08-04b):
|
||||
# - planning_failed -> quay về PLANNING lập plan lại (không có plan nào để bám);
|
||||
# - controlling/oscillation-> quay về CONTROLLING bám tiếp GLOBAL PATH CŨ, KHÔNG lập plan lại
|
||||
# (thay plan trong lúc chạy là việc riêng của planner_frequency);
|
||||
# riêng khi leo thang từ PLANNING vì mất pose thì về PLANNING;
|
||||
# - behavior họ detour (output kPath, vd DetourPathRecovery) nộp path mới -> path đó được áp
|
||||
# và robot bám tiếp — cách duy nhất một recovery được thay plan.
|
||||
# Robot đi được quá `oscillation_distance` thì mọi cursor route được reset — ngân sách recovery
|
||||
# đầy lại theo tiến độ thật (2026-08-04).
|
||||
#
|
||||
# Ý NGHĨA TỪNG TRIGGER:
|
||||
# planning_failed : planner CÓ dữ liệu nhưng không tìm được đường.
|
||||
# controlling_failed : MẤT DỮ LIỆU/LỆNH — controller không ra lệnh (kể cả mất pose) quá
|
||||
# `controller_patience`, hoặc mất pose ngay trong PLANNING, hoặc costmap
|
||||
# stale liên tục quá `sensor_patience`.
|
||||
# oscillation : quẩn trong bán kính `oscillation_distance` quá `oscillation_timeout`.
|
||||
# path_blocked : DỰ BÁO tuyến phía trước bị chắn (giám sát tuyến).
|
||||
# off_path : DỰ BÁO robot đã lệch khỏi plan quá ngưỡng.
|
||||
#
|
||||
# ► Chỉnh route:
|
||||
# - route RỖNG = tắt hẳn trigger đó. `path_blocked`/`off_path` được phép rỗng; ba route còn lại
|
||||
# bắt buộc có ít nhất một behavior (config validate chặn).
|
||||
# - route được phép LẶP behavior: mỗi lần xuất hiện là một lượt thử (`[detour, wait, detour]`).
|
||||
# - route dài hơn = kiên nhẫn hơn nhưng chậm báo lỗi lên fleet hơn.
|
||||
# - thứ tự nên đi từ RẺ và AN TOÀN tới ĐẮT và RỦI RO: wait/clear -> rotate -> detour -> back_up.
|
||||
routes:
|
||||
planning_failed: [wait, clear]
|
||||
controlling_failed: [detour_path]
|
||||
oscillation: [wait]
|
||||
# Cursor reset (2026-08-05): recovery THÀNH CÔNG + NỘP PATH MỚI (detour) thì cursor của trigger
|
||||
# đó reset NGAY — lần chắn kế tiếp là sự cố mới, detour được chạy lại. Từ chối/thất bại mới ăn
|
||||
# vào ngân sách route.
|
||||
#
|
||||
# Cạn route KHÔNG còn nghĩa là ABORT (contract 2026-08-05e): `path_blocked`/`off_path` là DỰ
|
||||
# BÁO, plan vẫn hợp lệ và controller vẫn ra lệnh được, nên robot bám tiếp plan cũ và trigger bị
|
||||
# KHOÁ tới khi đi được quá `oscillation_distance`. Đường ABORT hợp lệ duy nhất đi qua
|
||||
# `controlling_failed` (controller thật sự hết ra lệnh quá controller_patience) hoặc
|
||||
# `planning_failed`.
|
||||
path_blocked: [detour_path]
|
||||
off_path: [detour_path]
|
||||
|
||||
# --- wait: đứng yên, không phát vận tốc ---------------------------------------------------------
|
||||
wait:
|
||||
# [s] Thời gian đứng yên.
|
||||
# ► Chỉnh: TĂNG (5–10) ở khu đông người để vật cản động kịp đi qua; GIẢM nếu robot đứng chờ quá
|
||||
# lâu ở chỗ vật cản thật ra là tĩnh. Thời gian này robot KHÔNG phát cmd_vel.
|
||||
wait_duration: 3.0
|
||||
|
||||
# --- clear: xoá vật cản đã tích trong costmap ---------------------------------------------------
|
||||
#
|
||||
# Đường thoát đúng khi bẫy là VẬT CẢN MA (costmap giữ lại thứ không còn ở đó). Rẻ nhất trong bộ,
|
||||
# nên thường đặt đầu route.
|
||||
clear:
|
||||
# [m] Cạnh vùng vuông quanh robot sẽ bị xoá.
|
||||
# ► Chỉnh: TĂNG nếu ma nằm xa hơn (nhưng xoá rộng = mất cả vật cản THẬT vừa quan sát được, robot
|
||||
# có thể lao vào chỗ vừa xoá). GIẢM để an toàn hơn. Đừng vượt quá cửa sổ costmap local (8 m).
|
||||
reset_distance: 3.0
|
||||
# false = xoá BÊN TRONG vùng; true = xoá BÊN NGOÀI (giữ lại vùng gần robot).
|
||||
# ► Chỉnh: true chỉ hợp lý khi muốn giữ vật cản gần và bỏ dữ liệu xa đã cũ.
|
||||
invert_area_to_clear: false
|
||||
# local | global | both — costmap nào bị xoá.
|
||||
# ► Chỉnh: `local` nếu chỉ muốn làm mới dữ liệu sensor mà không đụng bản đồ tích luỹ.
|
||||
affected_maps: both
|
||||
# Phải khớp `plugins:` của costmap; sai tên -> log kèm tên layer thật.
|
||||
# ► Chỉnh: thêm tên layer nếu costmap có nhiều layer vật cản (vd `[obstacles, voxel_layer]`).
|
||||
# Đây KHÔNG phải số tinh chỉnh — sai tên là behavior không xoá gì cả.
|
||||
layer_names: [obstacles]
|
||||
|
||||
# --- rotate: quay tại chỗ cho sensor quét lại xung quanh -----------------------------------------
|
||||
rotate:
|
||||
# true = quay đủ 2*pi để costmap thấy toàn bộ xung quanh.
|
||||
# ► Chỉnh: false = quay theo `goal.angle` do caller đặt, và nếu caller không đặt thì dùng
|
||||
# `target_angle` bên dưới. Giữ true cho mục đích "nhìn lại xung quanh".
|
||||
full_rotation: true
|
||||
|
||||
# [rad] Góc quay mặc định khi `full_rotation: false` VÀ caller không truyền `goal.angle`.
|
||||
# Giá trị hiện tại = 2*pi (tức bằng full_rotation), nên khi `full_rotation: true` nó nằm im.
|
||||
# ► Chỉnh: viết SỐ CỤ THỂ, đừng viết biểu thức kiểu `2 * 3.14159` — parser YAML không tính.
|
||||
# Dấu quyết định chiều quay. Ví dụ nửa vòng: 3.141592653589793.
|
||||
# Giá trị bị clamp về |target_angle| nên không thể quay quá một vòng.
|
||||
target_angle: 6.283185307179586
|
||||
# [rad/s] Độ lớn tốc độ quay; dấu do goal.angle quyết định.
|
||||
# ► Chỉnh: phải <= max_vel_theta của robot. GIẢM nếu có tải cao/dễ đổ; TĂNG để recovery nhanh
|
||||
# hơn nhưng sensor có thể nhoè khi quét.
|
||||
angular_speed: 0.4
|
||||
# [rad/s^2] Ramp gia tốc, tránh giật khi có tải.
|
||||
# ► Chỉnh: GIẢM khi chở hàng dễ đổ; TĂNG nếu robot mất quá nhiều thời gian mới đạt tốc độ.
|
||||
acc_lim_theta: 0.8
|
||||
# [rad] Bước quét footprint dọc cung lúc start (kiểm va chạm trước khi quay).
|
||||
# ► Chỉnh: GIẢM (0.05) để kiểm kỹ hơn ở chỗ chật, đổi lại tốn CPU lúc start. TĂNG thì có nguy cơ
|
||||
# bỏ sót một vị trí góc bị chạm.
|
||||
sim_granularity: 0.1
|
||||
# [s] Lưới cuối nếu robot bị giữ cơ học (bánh trượt, bị chèn).
|
||||
# ► Chỉnh: phải > thời gian quay 2*pi ở `angular_speed` (2π/0.4 ≈ 15.7 s) cộng dư địa ramp.
|
||||
# Đặt thấp hơn là behavior LUÔN kết thúc bằng timeout.
|
||||
timeout: 20.0
|
||||
|
||||
# --- back_up: lùi thẳng -------------------------------------------------------------------------
|
||||
#
|
||||
# Hướng lùi KHÔNG có sensor -> rủi ro cao nhất trong bộ, thường xếp cuối route.
|
||||
back_up:
|
||||
# [m] Quãng lùi mặc định khi caller không chỉ định.
|
||||
# ► Chỉnh: TĂNG (0.3–0.6) nếu robot cần lùi hẳn ra khỏi hốc/khe kệ mới xoay được; GIẢM nếu phía
|
||||
# sau thường có người/vật. Nhớ phía sau là vùng mù.
|
||||
backup_distance: 0.1
|
||||
# [m] Trần cứng, chặn cả `goal.distance` do caller truyền lẫn param ở trên.
|
||||
# ► Chỉnh: đây là chốt an toàn, đặt bằng quãng lùi mù xa nhất còn chấp nhận được ở hiện trường.
|
||||
backup_distance_max: 1.0
|
||||
# [m/s] ĐỘ LỚN; dấu âm (lùi) do plugin đặt.
|
||||
# ► Chỉnh: giữ chậm (<= 0.15) vì đi mù. TĂNG chỉ khi có sensor sau.
|
||||
linear_speed: 0.1
|
||||
# [m/s^2] Ramp gia tốc.
|
||||
# ► Chỉnh: GIẢM khi chở tải dễ đổ.
|
||||
acc_lim_x: 0.3
|
||||
# [s] Lưới cuối.
|
||||
# ► Chỉnh: phải > backup_distance_max / linear_speed (1.0/0.1 = 10 s) cộng dư địa ramp.
|
||||
timeout: 15.0
|
||||
|
||||
# --- detour_path: lập đường vòng quanh vật cản rồi NỐI LẠI tuyến --------------------------------
|
||||
#
|
||||
# Gói `sbpl_recovery`, họ kPath: nó KHÔNG lái robot, chỉ TRẢ VỀ một path; runtime áp path đó và
|
||||
# local planner đang active bám theo. Đường vòng được bám ngay, không replan (contract 08-04b).
|
||||
detour_path:
|
||||
# Instance planner RIÊNG, không dùng chung SBPLLatticePlanner của backup: detour gọi makePlan
|
||||
# ĐỒNG BỘ trên control thread, nên `allocated_time` của instance này là trần treo control loop
|
||||
# mỗi tick. Xem khối SBPLDetourPlanner ở cuối file.
|
||||
#
|
||||
# ► Chỉnh: `planner_name` là NAMESPACE PARAM (khối bên dưới), `planner_symbol` là ALIAS Boost.DLL
|
||||
# CÓ THẬT trong .so. Đây không phải số tinh chỉnh — đổi sai là runtime không nạp được plugin.
|
||||
planner_name: SBPLDetourPlanner
|
||||
planner_symbol: SBPLLatticePlanner # libsbpl_lattice_planner chỉ export đúng một symbol này.
|
||||
# Khác bộ local planner, nơi mỗi biến thể là một class riêng
|
||||
# nên tên instance trùng alias.
|
||||
|
||||
# "combined" (2026-08-05, vòng 3 — LƯỚI GỘP, xem DETOUR_MERGED_GRID_PLAN.md): snapshot global
|
||||
# làm nền (tường/kệ tĩnh toàn bản đồ) + đè cửa sổ local lên (vật cản sensor tươi), SBPL lập
|
||||
# đường TRÊN BẢN CHỤP GỘP — không giữ mutex costmap nào trong lúc search, map update không bị
|
||||
# bỏ đói dù attempt thua. Một bên báo chắn là chắn; local FREE không xoá tường global.
|
||||
# Cần planner export capability "<planner_symbol>ExternalGrid" (sbpl_lattice_planner có sẵn).
|
||||
#
|
||||
# ► Chỉnh: giữ `combined`. `local` = chỉ cửa sổ lăn, cho hệ không có global costmap — điểm nối
|
||||
# kẹt trong cửa sổ. `global` = chỉ lưới tĩnh: ĐÃ ĐO và LOẠI trên sim, global không nạp sensor
|
||||
# nên goal nào SBPL cũng vẽ xuyên đúng chỗ vật cản tươi (6/6 attempt hỏng).
|
||||
costmap_source: combined
|
||||
|
||||
# [m] Điểm nối phải cách robot tối thiểu chừng này (đo Euclid).
|
||||
# ► Chỉnh: TĂNG nếu đường vòng quá ngắn/gấp khiến local planner không bám nổi. GIẢM nếu ở chỗ
|
||||
# chật không tìm nổi điểm nối. Phải < `max_rejoin_distance` khi cái đó > 0.
|
||||
planning_distance: 1.0
|
||||
|
||||
# [m] TRẦN quét dọc plan, thuần tuỳ chọn. 0 = quét tới CUỐI PLAN (lưới gộp phủ toàn bản đồ nên
|
||||
# không còn ràng buộc cửa sổ local). Quét luôn tự dừng ở rìa lưới.
|
||||
# ► Chỉnh: GIỮ 0. Hai lần sim 2026-08-05 đặt cap hữu hạn (3.8 rồi 8.0) đều cắt quét ngay sau pose
|
||||
# bẩn cuối và báo "không có chỗ sạch" OAN. Chỉ đặt > 0 khi muốn chặn cứng độ dài đường vòng.
|
||||
max_rejoin_distance: 0.0
|
||||
|
||||
# [m] Khoảng cách dọc plan giữa hai ứng viên điểm nối liên tiếp.
|
||||
# ► Chỉnh: TĂNG để ba ứng viên trải rộng hơn (thử được nhiều chỗ khác nhau hơn); GIẢM để thử
|
||||
# dày quanh một vùng. Cùng `attempts_per_run` quyết định tầm phủ: 3 x 0.5 = ~1.5 m.
|
||||
sample_step: 0.5
|
||||
|
||||
# [m] Điểm nối phải cách pose bẩn gần nhất CẢ HAI PHÍA dọc plan chừng này, và nằm SAU pose bẩn
|
||||
# CUỐI CÙNG CÒN NHÌN THẤY ĐƯỢC (trong cửa sổ local — contract 2026-08-05f). Chỗ chắn ngoài tầm
|
||||
# nhìn là dữ liệu cũ, không được quyền quyết định điểm nối.
|
||||
# ► Chỉnh: TĂNG (0.8–1.0) nếu nhiều lượt SBPL báo `Solution not found` — 0.5 m có thể quá sát:
|
||||
# "bẩn" ở đây do kiểm MỘT ô, còn SBPL kiểm footprint đầy đủ (0.6x0.6 + inflation 0.55 m).
|
||||
# GIẢM nếu ở khu chật không bao giờ tìm được điểm nối.
|
||||
rejoin_clearance: 0.5
|
||||
|
||||
# Số ứng viên điểm nối thử tối đa trong một lượt; mỗi control cycle thử ĐÚNG MỘT ứng viên.
|
||||
# ► Chỉnh: TĂNG = kiên nhẫn hơn nhưng mỗi lượt hỏng tốn thêm `allocated_time` giây treo control
|
||||
# thread. GIẢM = từ bỏ nhanh, nhường cho behavior kế tiếp của route.
|
||||
attempts_per_run: 3
|
||||
|
||||
# Tuyến để NỐI LẠI (2026-08-05e). "reference" = tuyến GỐC của chặng, tức plan do planner sinh và
|
||||
# recovery không thay được: đường vòng luôn quay về tuyến order, và `max_deviation` đo đúng hành
|
||||
# lang fleet đã duyệt. "current" = plan đang bám (hành vi cũ) — sim đo được tuyến bị ăn mòn dần
|
||||
# qua từng lượt detour (rejoin 106/305 -> 130/289 -> 132/273) và robot không bao giờ về tuyến.
|
||||
# ► Chỉnh: giữ `reference`. Chỉ đổi sang `current` khi runtime không cấp được tuyến tham chiếu
|
||||
# (khi đó behavior tự quay về `current` kèm cảnh báo, không cần sửa gì).
|
||||
rejoin_on: reference
|
||||
|
||||
# [m] Hành lang lệch tuyến cho phép quanh tuyến gốc của order. 0 = KHÔNG giới hạn.
|
||||
# ► Chỉnh: giữ 0 cho tới khi biết dung sai thật của fleet master — đặt số mò còn tệ hơn tắt.
|
||||
# Khi bật, đặt bằng chiều rộng hành lang mà fleet cho phép robot rời tuyến (thường 1–2 m).
|
||||
# Đường vòng vượt hành lang sẽ bị TỪ CHỐI và thử ứng viên kế tiếp.
|
||||
max_deviation: 0.0
|
||||
|
||||
# [s] Trần cho cả lượt recovery này (base cưỡng chế, khác `allocated_time` của một lượt SBPL).
|
||||
# ► Chỉnh: phải > attempts_per_run * allocated_time (3 x 0.4 = 1.2 s) cộng dư địa, nếu không
|
||||
# behavior bị cắt giữa chừng trước khi thử hết ứng viên.
|
||||
timeout: 10.0
|
||||
|
||||
# Bảng symbol -> thư viện cho Boost.DLL. KHÔNG phải tham số tinh chỉnh — 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".
|
||||
WaitRecovery:
|
||||
library_path: librecovery_core_wait_recovery
|
||||
|
||||
ClearCostmapRecovery:
|
||||
library_path: librecovery_core_clear_costmap_recovery
|
||||
|
||||
RotateRecovery:
|
||||
library_path: librecovery_core_rotate_recovery
|
||||
|
||||
BackUpRecovery:
|
||||
library_path: librecovery_core_back_up_recovery
|
||||
|
||||
DetourPathRecovery:
|
||||
library_path: libsbpl_recovery
|
||||
|
||||
# =================================================================================================
|
||||
# Instance SBPL RIÊNG cho detour — cùng .so với SBPLLatticePlanner, khác tuning.
|
||||
#
|
||||
# Vì sao không dùng chung: `DetourPathRecovery::onUpdate` gọi makePlan ĐỒNG BỘ trên control thread,
|
||||
# nên `allocated_time` ở đây là trần thời gian control loop bị treo mỗi tick — `cancel`/`pause` từ
|
||||
# host không được xử lý trong khoảng đó. Bản backup để 10.0 s là hợp lý cho vai trò của nó, nhưng
|
||||
# treo loop 10 s thì không.
|
||||
# =================================================================================================
|
||||
SBPLDetourPlanner:
|
||||
# KHÔNG có `library_path` ở đây: `SBPLDetourPlanner` không phải symbol, nó chỉ là namespace param.
|
||||
# Việc nạp .so đi theo `planner_symbol: SBPLLatticePlanner` ở trên.
|
||||
|
||||
# Kiểu môi trường và thuật toán. XYThetaLattice là loại DUY NHẤT port này hỗ trợ.
|
||||
# ► Chỉnh: `planner_type` có ARAPlanner (anytime, dùng epsilon) và ADPlanner (anytime + dynamic,
|
||||
# tận dụng thay đổi costmap giữa hai lượt). Giữ ARAPlanner trừ khi đo được ADPlanner nhanh hơn.
|
||||
environment_type: XYThetaLattice
|
||||
planner_type: ARAPlanner
|
||||
|
||||
# [s] TRẦN CỨNG cho một lượt SBPL — cũng là trần treo control thread mỗi tick.
|
||||
# ► Chỉnh: TĂNG nếu log nhiều `Solution not found` mà thời điểm trả về đúng bằng giá trị này (tức
|
||||
# HẾT GIỜ). GIẢM nếu control loop bị giật khi detour chạy. Trả về sớm hơn nhiều giá trị này
|
||||
# nghĩa là search CẠN STATE — tăng thêm cũng vô ích, vấn đề nằm ở goal không tới được.
|
||||
allocated_time: 0.4
|
||||
|
||||
# Hệ số nới heuristic của ARA*: nghiệm đầu được phép đắt gấp `initial_epsilon` lần tối ưu, rồi
|
||||
# thuật toán siết dần trong thời gian còn lại.
|
||||
# ► Chỉnh: đây là nút ĐÁNH ĐỔI TỐC ĐỘ/CHẤT LƯỢNG quan trọng nhất.
|
||||
# - TĂNG (5–15) = ra nghiệm rất nhanh nhưng đường xấu: gấp khúc, xoay tại chỗ, vòng xoắn.
|
||||
# - GIẢM (1.0–2.0) = đường đẹp nhưng chậm, dễ hết giờ ở quãng xa.
|
||||
# Đường vòng xấu mà vẫn ra nghiệm ⇒ giảm số này TRƯỚC khi đụng vào .mprim.
|
||||
initial_epsilon: 2.0
|
||||
|
||||
# Số ô costmap thay đổi tối đa còn cho phép lập plan tăng dần; vượt ngưỡng thì lập lại từ đầu.
|
||||
# ► Chỉnh: hiếm khi cần. GIẢM nếu nghi plan tăng dần đang dùng dữ liệu cũ.
|
||||
force_scratch_limit: 10000
|
||||
|
||||
# Hướng tìm kiếm: true = từ start tới goal.
|
||||
# ► Chỉnh: đổi sang false (backward) chỉ khi đo được nhanh hơn cho hình học tuyến của mình.
|
||||
forward_search: true
|
||||
|
||||
# Bỏ ràng buộc heading tại điểm xuất phát: SBPL được phép giả định robot đã xoay sẵn theo hướng
|
||||
# tới goal, phần xoay để local planner lo.
|
||||
# ► Chỉnh: `true` làm mỗi lượt HỎNG chạy HAI lần search (log: "no solution with free start
|
||||
# heading, retrying with actual robot heading"), và lượt thành công có thể chạy BA lần (thêm
|
||||
# một lượt "realign"). Đặt `false` cho detour để tiết kiệm — detour chạy khi robot ĐANG BÁM plan
|
||||
# nên heading thật đã xuôi theo tuyến. Chỉ để `true` nếu local planner có bước xoay tại chỗ đầu
|
||||
# path (turn_around_priority).
|
||||
free_start_heading: true
|
||||
|
||||
# [m/s] và [s] — dùng để quy quãng đường/góc thành CHI PHÍ thời gian, không phải giới hạn vận tốc
|
||||
# thật của robot (giới hạn thật nằm ở local planner).
|
||||
# ► Chỉnh: tỉ lệ giữa hai số này quyết định robot "thà đi vòng" hay "thà xoay tại chỗ".
|
||||
# `timetoturn45degsinplace_secs` LỚN ⇒ xoay tại chỗ đắt ⇒ SBPL vẽ cung vòng thay vì xoay.
|
||||
# Đặt sát tốc độ hành trình thật để chi phí phản ánh đúng thời gian.
|
||||
nominalvel_mpersecs: 0.3
|
||||
timetoturn45degsinplace_secs: 1.31
|
||||
|
||||
# File motion primitive: tập cử động cơ sở (tiến, lùi, cung rẽ, xoay tại chỗ) kèm hệ số chi phí.
|
||||
# ► Chỉnh: `resolution_m` trong file PHẢI khớp resolution costmap (0.05 m), nếu không SBPL từ chối
|
||||
# nạp. Hình dạng đường vòng (gấp khúc / xoắn / nhiều đoạn xoay tại chỗ) do các
|
||||
# `additionalactioncostmult` trong file này quyết định — sinh lại bằng `Test/mprim_gen`. Nên
|
||||
# dùng file RIÊNG cho detour, đừng đè file mà global planner đang dùng chung.
|
||||
primitive_filename: /home/duongtd/rl_ws/mir_robot/mir_navigation/mprim/unicycle_highcost_5cm.mprim
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/sbpl_global_params.yaml
|
||||
15
config/runtime/sbpl_global_params.yaml
Normal file
15
config/runtime/sbpl_global_params.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
SBPLLatticePlanner:
|
||||
library_path: libsbpl_lattice_planner
|
||||
environment_type: XYThetaLattice
|
||||
planner_type: ARAPlanner
|
||||
allocated_time: 10.0
|
||||
initial_epsilon: 1.0
|
||||
force_scratch_limit: 10000
|
||||
forward_search: true
|
||||
# Bỏ ràng buộc heading xuất phát: local planner đã có bước quay tại chỗ đầu path
|
||||
# (turn_around_priority) nên không cần SBPL vẽ cung quay đầu khi goal ở phía sau.
|
||||
# Nếu không ra nghiệm, planner tự retry một lần với heading thật của robot.
|
||||
free_start_heading: true
|
||||
nominalvel_mpersecs: 0.3
|
||||
timetoturn45degsinplace_secs: 1.31 # = 0.6 rad/s
|
||||
primitive_filename: /home/duongtd/rl_ws/mir_robot/mir_navigation/mprim/unicycle_highcost_5cm.mprim
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/stanley_local_planner_params.yaml
|
||||
179
config/runtime/stanley_local_planner_params.yaml
Normal file
179
config/runtime/stanley_local_planner_params.yaml
Normal file
@@ -0,0 +1,179 @@
|
||||
LocalPlannerAdapter:
|
||||
library_path: liblocal_planner_adapter
|
||||
yaw_goal_tolerance: 0.017
|
||||
xy_goal_tolerance: 0.03
|
||||
min_approach_linear_velocity: 0.06
|
||||
|
||||
StanleyLocalPlanner:
|
||||
library_path: libstanley_local_planner
|
||||
|
||||
# ============================================================================
|
||||
# PROFILE MO PHONG (move_base2 runtime). Khac profile robot that
|
||||
# (stanley_local_planner/cfg/...) dung 3 diem:
|
||||
# steer_zero_offset 0.0 | heading_bias_mode "off" | steer_bias_gain 0.0
|
||||
# (sim khong co zero servo / IMU anchor -> cac bo bu tat het)
|
||||
# max_plan_tf_jump_rate 1.5 (dynamic TF sim jitter chu dich, 0.6 gay reset oan)
|
||||
# ============================================================================
|
||||
|
||||
# ================= Robot limits =================
|
||||
max_vel_x: 0.50 # [m/s] forward, > 0
|
||||
min_vel_x: -0.25 # [m/s] reverse, < 0
|
||||
wheel_base: 0.0 # [m] 0 = derive from TF front_axle_frame -> rear_axle_frame
|
||||
front_axle_frame: "steer_link"
|
||||
rear_axle_frame: "base_link"
|
||||
|
||||
# Two SEPARATE steering limits.
|
||||
# Path tracking must not use a large angle: forward_vel_ scales with cos(delta) so it
|
||||
# collapses to speed_base, and vel_steer = v/cos(steer) is guarded to 0 as cos -> 0.
|
||||
# Pivoting in place uses the full 90 deg the hardware has.
|
||||
steer_limit_standstill: 1.5708 # [rad] TO BE MEASURED - ceiling at |v| ~ 0
|
||||
steer_limit_at_max_vel: 0.5000 # [rad] TO BE MEASURED - ceiling at |v| = max_vel_x
|
||||
align_steer_angle: 1.5708 # [rad] steering while pivoting. Literal number, NOT M_PI/2
|
||||
min_steer_angle: 0.20 # [rad] threshold for "steering is engaged"
|
||||
max_steer_rate: 1.00 # [rad/s] measured by [DBG-STEER] 07/08: servo peak 1.08-1.35
|
||||
|
||||
# Measured zero offset of the steering channel, ADDED to every command.
|
||||
# 05/08 log: robot driving straight while the encoder read +0.0373 rad (2.1 deg)
|
||||
# -> the proportional law paid for it with a standing 5-8 cm cross-track error.
|
||||
# BRIDGE until the servo encoder zero is calibrated; set back to 0.0 after that.
|
||||
steer_zero_offset: 0.0 # [rad]
|
||||
|
||||
# ================= Goal tolerance =================
|
||||
xy_goal_tolerance: 0.030 # [m] should match LocalPlannerAdapter
|
||||
yaw_goal_tolerance: 0.020 # [rad]
|
||||
goal_sq_dist_tol: 0.05 # [m^2] early exit of the closest-point scan
|
||||
|
||||
# ================= Control law (Stanley) =================
|
||||
path_yaw_mode: "tangent" # tangent | bearing - "bearing" is the old behaviour, kept for rollback
|
||||
control_gain_e: 2.0 # heading gain (path tangent - robot yaw)
|
||||
control_gain_d: 1.5 # base cross-track gain
|
||||
gain_cte_weight: 0.8 # added to k per |cross-track error| [1/m]
|
||||
gain_heading_weight: 0.5 # added to k per |heading error| [1/rad]
|
||||
gain_min: 0.5 # lower clamp of k
|
||||
gain_max: 1.8 # upper clamp of k
|
||||
soft_min_vel: 0.20 # [m/s] FLOOR of the atan2(k*e, v) denominator. NO ceiling
|
||||
alpha_gain: 0.0 # steering low-pass [0..1]; 0 = off, max_steer_rate is used instead
|
||||
curve_gain_e_bonus: 2.0 # added to control_gain_e in curve mode
|
||||
tangent_window_pts: 3 # points averaged for the tangent when the plan carries no yaw
|
||||
|
||||
# Curve tracking rework (08/08): cross-track error is measured at the BASE in both
|
||||
# directions (front-axle variants manufacture an L^2/2R curve phantom - the robot
|
||||
# cut INSIDE curves forward and drifted OUTSIDE in reverse); the heading reference
|
||||
# previews a short distance ahead symmetrically; the curve itself is carried by an
|
||||
# explicit atan(L*kappa) feedforward. Swept optimum in sim (R=1.5/3.0, both
|
||||
# directions): max error 0.013-0.016 m vs 0.061/0.129 before.
|
||||
heading_preview: 0.10 # [m] heading (tangent) reference ahead of the base anchor
|
||||
curve_feedforward_gain: 1.0 # atan(L*kappa) gain; 0 = OFF (rollback), 1.0 = geometric nominal
|
||||
|
||||
# ================= Heading bias (yawR - course, measured +0.030 rad 07/08) =========
|
||||
# The yaw estimate leads the actual course by a constant that RE-ANCHORS differently
|
||||
# every session (IMU absolute anchor), so it is learned online from course-over-ground
|
||||
# instead of configured. A steering offset cannot compensate this: the heading
|
||||
# REFERENCE is wrong, not the actuator.
|
||||
heading_bias_mode: "off" # off = disabled
|
||||
# log = estimate only, [DBG-YAWBIAS] prints the calib number
|
||||
# apply= subtract the learned bias from the yaw being controlled
|
||||
# (rollback in the field: switch to "log", no rebuild)
|
||||
heading_bias_tau: 30.0 # [s] EMA time constant
|
||||
heading_bias_min_vel: 0.45 # [m/s] below this the course is too noisy to learn from
|
||||
heading_bias_clamp: 0.05 # [rad] ceiling of the APPLIED correction
|
||||
heading_bias_min_samples: 60 # [cycles] learned samples required before applying
|
||||
|
||||
# ================= Steering bias (integrator, cleans up the residue) =============
|
||||
# With heading_bias_mode: apply the main disturbance is handled above; the
|
||||
# integrator only sweeps up what is left. Do NOT run both at full strength.
|
||||
steer_bias_gain: 0.0 # [rad/(m*s)] SIM: 0 = OFF — plant sim khong co zero servo hay
|
||||
# heading bias, integrator bat len chi tich nhieu.
|
||||
# ROBOT THAT: 0.10 khi mode != apply, 0.02 khi mode = apply.
|
||||
steer_bias_clamp: 0.05 # [rad] anti-windup ceiling
|
||||
steer_bias_decay: 0.9999 # per-cycle bleed when the integrate conditions do not hold
|
||||
# (robot that dung 0.9999 de bias song qua cac quang dung 30-60 s)
|
||||
steer_bias_min_vel: 0.30 # [m/s] below this, do not integrate
|
||||
steer_bias_max_heading_err: 0.10 # [rad] above this, do not integrate
|
||||
|
||||
# ================= Plan window / lookahead =================
|
||||
max_global_plan_lookahead_dist: 3.0 # [m] window ceiling
|
||||
min_lookahead: 0.50 # [m] window floor
|
||||
min_lookahead_near_goal: 0.40 # [m] separate floor near the goal
|
||||
dyn_lookahead_gain: 2.50 # [m/(m/s)] lookahead = min + gain*|v|
|
||||
near_goal_freeze_dist: 0.50 # [m] below this: freeze yaw_path, run theta_d only
|
||||
|
||||
# Index continuity thresholds, given in METRES and converted to indices with the
|
||||
# point spacing measured at runtime - the plan resolution is the global planner's
|
||||
# choice, not a constant.
|
||||
# The old code used fixed indices (back=3, fwd=15 ~ 0.75 m on a 0.05 m/point plan) and
|
||||
# therefore never fired: at 1.2 m/s the robot covers 0.04 m = 0.8 index per 33 ms cycle.
|
||||
# Applied to BOTH closest (window anchor) and target_idx_ (inside the core).
|
||||
max_advance_dist: 0.20 # [m] forward travel allowed along the plan per cycle
|
||||
max_back_dist: 0.10 # [m] backward travel allowed along the plan per cycle
|
||||
|
||||
# ================= Curvature =================
|
||||
high_curvature: 0.30 # [1/m] above: shrink lookahead
|
||||
mid_curvature: 0.20 # [1/m] above: cut the transform window
|
||||
low_curvature: 0.10 # [1/m] above: enter curve mode
|
||||
straight_confirm_steps: 110 # consecutive straight cycles before leaving curve mode
|
||||
|
||||
# ================= Speed profile =================
|
||||
speed_base: 0.30 # [m/s] base of the cosine steering profile
|
||||
curve_max_speed: 0.25 # [m/s] ceiling while curving
|
||||
min_drive_speed: 0.07 # [m/s] floor while driving
|
||||
accel_distance: 2.00 # [m] ramp length after leaving a curve
|
||||
decel_min: 0.05 # [m/s per cycle] deceleration on predicted collision
|
||||
decel_max: 0.10 # [m/s per cycle]
|
||||
collision_horizon_factor: 2.0 # multiplies max_vel_x to get the collision check distance
|
||||
|
||||
# Braking-distance governor: v <= sqrt(2*a*d_to_stop). The horizon profile alone
|
||||
# starts braking ~v*horizon out (1.5 m at 1.2 m/s, demanding ~1 m/s^2) — the drive
|
||||
# cannot follow and the robot overshot 30 cm. The old build was saved by an
|
||||
# accident (the bearing blow-up tripped the steer gate and cut the drive early).
|
||||
goal_decel_limit: 0.40 # [m/s^2] TO BE MEASURED — must stay BELOW the drive's real brake.
|
||||
# Braking starts at v^2/(2a): 1.8 m @ 1.2 m/s, 0.3 m @ 0.5 m/s
|
||||
min_approach_speed: 0.06 # [m/s] approach floor so the sqrt profile still reaches the goal
|
||||
|
||||
# ================= Align / phase =================
|
||||
heading_eps: 0.020 # [rad] heading error accepted as aligned
|
||||
steer_eps: 0.020 # [rad] steering error accepted as "servo arrived"
|
||||
heading_align_tol: 0.050 # [rad] gate for the final straight-line approach (was 0.01 = too tight)
|
||||
near_goal_dist: 1.00 # [m] below this: enable the final straight mode
|
||||
steer_realign_off: 0.503 # [rad] above this: CUT drive (0.16*pi)
|
||||
steer_realign_on: 0.150 # [rad] below this: RESUME drive - must be smaller than _off
|
||||
steering_active: 0.094 # [rad] above this the steering counts as active (0.03*pi)
|
||||
segment_transition_threshold: 0.010 # [m]
|
||||
segment_end_ratio: 0.05 # fraction of the segment left before advancing
|
||||
xy_reached_gate_factor: 3.0 # multiplies xy_goal_tolerance; a 1-point window may only latch inside this
|
||||
|
||||
# ================= TF guard =================
|
||||
# Measured on the robot: 225 map->odom jumps, max 12.381 m, coinciding with the
|
||||
# localisation FinishTrajectory(1) 10:41:18 / AddTrajectory(2) 10:41:21. The source is
|
||||
# outside this package; this is containment, not a cure.
|
||||
tf_lookup_at_pose_stamp: true # true = look up at pose.header.stamp instead of "latest".
|
||||
# "latest" returns a different entry each call when the
|
||||
# buffer holds two map->odom transforms
|
||||
transform_tolerance: 0.20 # [s] accepted age when looking up by timestamp
|
||||
max_plan_tf_jump_rate: 1.50 # [m/s] threshold as a RATE, multiplied by the real elapsed time.
|
||||
# SIM: 1.5 — dynamic TF sim jitter 0.02-0.065 m/chu ky; de 0.6
|
||||
# thi budget ~0.02 m -> reject don 30/30, reset giua duong
|
||||
# (log 08/08: 8 reset trong 2 luot lui). ROBOT THAT: 0.60.
|
||||
max_plan_tf_jump_abs: 1.00 # [m] hard cap of the accepted step: the rate budget grows while
|
||||
# the transform sits still, and without the cap a multi-metre
|
||||
# step after a long static stretch would be accepted outright
|
||||
max_plan_tf_yaw_jump: 0.20 # [rad] rotation threshold - the old code checked translation only
|
||||
tf_reject_window_cycles: 30 # sliding window; exceeding it means a real relocalisation
|
||||
tf_reject_ratio: 0.5 # reject fraction inside the window that triggers the reset
|
||||
|
||||
# ================= Debug =================
|
||||
debug_tf: false # nhom log TF (accepted-step, authority, chi tiet reject, fallback).
|
||||
# SIM: dynamic_tf nhieu chu dich -> tat cho log doc duoc.
|
||||
# ROBOT THAT: bat lai (true) khi san TF that.
|
||||
# Reset do reject keo dai van LUON duoc log bat ke cong tac nay.
|
||||
debug_offset: true # [DBG-OFF] 5 Hz bam path + thong ke max/mean |e| moi luot cua
|
||||
# (in kem dong DBG-CURVE exit) — soi lech trong duong cong.
|
||||
debug_level: 2 # 0=off 1=on state change 2=throttled 1 Hz 3=every cycle
|
||||
# 2 is safe as the operating default: this package throttles with
|
||||
# its own per-purpose clocks (robot_cpp's log_*_throttle shares ONE
|
||||
# static timer per function for the whole process, so its throttled
|
||||
# lines silently eat each other - never rely on it).
|
||||
# 3 produces >1800 lines/min at 30 Hz - field debugging only
|
||||
|
||||
StanleyDockingLocalPlanner:
|
||||
library_path: libstanley_local_planner
|
||||
@@ -1 +0,0 @@
|
||||
../../../../pnkx_nav_core/config/two_points_global_params.yaml
|
||||
3
config/runtime/two_points_global_params.yaml
Normal file
3
config/runtime/two_points_global_params.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
TwoPointsPlanner:
|
||||
library_path: libtwo_points_planner
|
||||
lethal_obstacle: 20
|
||||
@@ -30,20 +30,51 @@ enum class VelocitySource
|
||||
|
||||
const char* toString(VelocitySource source);
|
||||
|
||||
/**
|
||||
* @enum CommandSemantics
|
||||
* @brief Twist ra khỏi runtime này mang nghĩa gì — hai convention cùng tồn tại trong workspace.
|
||||
*
|
||||
* kTwist là chuẩn ROS: linear.x = vận tốc dài của base [m/s], angular.z = tốc độ quay [rad/s].
|
||||
*
|
||||
* kSteering là convention của robot lái một bánh (BicycleKinematic): linear.x = vận tốc BÁNH
|
||||
* STEER dọc theo hướng bánh [m/s], angular.z = GÓC bánh steer [rad]. Cùng struct Twist nhưng
|
||||
* đơn vị và vật lý khác hẳn: clamp angular theo "rad/s" trên một GÓC là cắt cụt lệnh đánh lái —
|
||||
* đúng lỗi đã bắt được trên sim (lệnh pivot 1.5708 bị kẹp còn 1.0, robot kẹt align vĩnh viễn).
|
||||
* Khai đúng semantics để arbiter kiểm theo đơn vị thật và HÉT LÊN khi lệnh lái bị cắt.
|
||||
*/
|
||||
enum class CommandSemantics
|
||||
{
|
||||
kTwist, ///< linear.x [m/s base], angular.z [rad/s].
|
||||
kSteering, ///< linear.x [m/s bánh steer], angular.z [rad — góc lái].
|
||||
};
|
||||
|
||||
const char* toString(CommandSemantics semantics);
|
||||
|
||||
/**
|
||||
* @struct VelocityLimits
|
||||
* @brief Giới hạn động học áp cho mọi lệnh trước khi ra khỏi runtime.
|
||||
*
|
||||
* Đây là hàng rào cuối cùng, không phải bộ điều khiển: local planner đã có giới hạn riêng, nhưng
|
||||
* runtime không được tin bất kỳ nguồn nào — kể cả recovery behavior nạp từ plugin ngoài.
|
||||
* runtime không được tin bất kỳ nguồn nào — kể cả recovery behavior nạp từ plugin ngoài. Hệ quả
|
||||
* bắt buộc: mọi trần ở đây phải NỚI hơn trần tương ứng của planner một khoảng margin — hai chỗ
|
||||
* nếu đặt sát/chặt hơn sẽ tái sinh lỗi thật đã đo: accel_x chặt hơn goal_decel_limit của planner
|
||||
* làm mềm cú phanh (trượt đích trở lại), accel_theta chặt hơn max_steer_rate tạo slew kép trên
|
||||
* lệnh lái.
|
||||
*/
|
||||
struct VelocityLimits
|
||||
{
|
||||
double max_vel_x = 0.5; ///< [m/s] trần tốc độ tiến (dương).
|
||||
/// Nghĩa của Twist đi qua arbiter. Đơn vị của các trần bên dưới đổi theo — xem từng field.
|
||||
CommandSemantics semantics = CommandSemantics::kTwist;
|
||||
|
||||
double max_vel_x = 0.5; ///< [m/s] trần tốc độ tiến (kSteering: tốc độ bánh steer).
|
||||
double min_vel_x = -0.2; ///< [m/s] trần tốc độ lùi (ÂM). 0 = cấm lùi.
|
||||
double max_vel_theta = 1.0; ///< [rad/s] trần tốc độ quay tuyệt đối.
|
||||
double max_vel_theta = 1.0; ///< kTwist: [rad/s] trần tốc độ quay.
|
||||
///< kSteering: [rad] trần GÓC lái = giới hạn cơ khí; phải >=
|
||||
///< align_steer_angle của planner, không thì pivot bị cắt.
|
||||
double max_accel_x = 1.0; ///< [m/s^2] trần biến thiên tốc độ dài, áp cho cả tăng và giảm.
|
||||
double max_accel_theta = 2.0; ///< [rad/s^2] trần biến thiên tốc độ quay.
|
||||
double max_accel_theta = 2.0; ///< kTwist: [rad/s^2] trần biến thiên tốc độ quay.
|
||||
///< kSteering: [rad/s] trần TỐC ĐỘ đánh lái; phải >= servo thật
|
||||
///< và >= max_steer_rate của planner.
|
||||
|
||||
/// [m/s] và [rad/s] — dưới ngưỡng này coi như đã dừng.
|
||||
double zero_velocity_epsilon = 1e-3;
|
||||
@@ -134,6 +165,18 @@ public:
|
||||
return velocity_clamps_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Số lần lệnh GÓC LÁI của controller bị cắt bởi max_vel_theta (chỉ đếm ở kSteering).
|
||||
*
|
||||
* Khác 0 nghĩa là planner đang xin một góc vượt trần khai báo — hoặc trần khai sai so với cơ
|
||||
* khí, hoặc planner cấu hình sai. Cả hai đều là lỗi cấu hình phải sửa, không phải nhiễu:
|
||||
* phiên bản không có kiểm này đã kẹt pivot 40 giây trong câm lặng.
|
||||
*/
|
||||
std::size_t steeringAngleClamps() const
|
||||
{
|
||||
return steering_angle_clamps_;
|
||||
}
|
||||
|
||||
/// @brief Số lần phải clamp vì vượt trần gia tốc.
|
||||
std::size_t accelerationClamps() const
|
||||
{
|
||||
@@ -173,6 +216,7 @@ private:
|
||||
std::size_t velocity_clamps_ = 0;
|
||||
std::size_t acceleration_clamps_ = 0;
|
||||
std::size_t handover_cycles_ = 0;
|
||||
std::size_t steering_angle_clamps_ = 0; ///< chỉ tăng ở kSteering, xem steeringAngleClamps()
|
||||
};
|
||||
|
||||
} // namespace move_base2
|
||||
|
||||
@@ -64,11 +64,26 @@ Vì vậy chuyển đổi = trỏ `PNKX_NAV_CORE_CONFIG_DIR` sang cây khác:
|
||||
| cũ | `pnkx_nav_core/config` | `libmove_base` |
|
||||
| mới | `move_base2/config/runtime` | `libmove_base2` |
|
||||
|
||||
`move_base2/config/runtime/` là **symlink tới toàn bộ** `pnkx_nav_core/config/`, trừ đúng một file
|
||||
thật: `move_base_common_params.yaml`. Chọn symlink thay vì copy là có lý do — `CLAUDE.md` cảnh báo
|
||||
rõ về hai cây config trùng tên ("file khớp đầu tiên thắng", "sửa mãi không có tác dụng vì sửa nhầm
|
||||
bản cũ"). Với symlink, sửa tham số ở cây gốc là cả hai đường chạy cùng thấy; chỉ đúng một dòng thật
|
||||
sự khác nhau.
|
||||
`move_base2/config/runtime/` là cây config **tự đủ**: mọi file đều là file thật, không còn symlink.
|
||||
Trước đây thư mục này symlink sang `pnkx_nav_core/config/`, nhưng symlink trỏ ra ngoài repo nên
|
||||
clone `move_base2` lẻ ra là link chết — và `robot::NodeHandle` bỏ qua link chết trong im lặng
|
||||
(`entry.is_regular_file()` trả false, không log), robot chạy bằng default hard-code mà không ai
|
||||
biết. Đổi lấy tính tự đủ khi clone.
|
||||
|
||||
Bốn file thuộc **riêng** move_base2, không có bản tương ứng bên `pnkx_nav_core`:
|
||||
`move_base_common_params.yaml` (chứa `MoveBase: library_path: libmove_base2`),
|
||||
`action_handlers_params.yaml`, `compound_actions_params.yaml`, `maker_sources.yaml`.
|
||||
|
||||
Số còn lại là **bản sao** của `pnkx_nav_core/config/`. Hệ quả phải nhớ, đúng thứ `CLAUDE.md` cảnh
|
||||
báo ("sửa mãi không có tác dụng vì sửa nhầm bản cũ"): hai bản KHÔNG còn tự đồng bộ. Sửa tham số
|
||||
planner/costmap cho move_base2 thì sửa ở đây; sửa cho `move_base` cũ / `c_api` / standalone thì sửa
|
||||
bên `pnkx_nav_core/config`. Kiểm lệch:
|
||||
|
||||
```bash
|
||||
diff -rq Test/move_base2/config/runtime pnkx_nav_core/config \
|
||||
-x action_handlers_params.yaml -x compound_actions_params.yaml \
|
||||
-x maker_sources.yaml -x move_base_common_params.yaml
|
||||
```
|
||||
|
||||
`libmove_base2.so` export **cả hai** alias `MoveBase` và `MoveBase2`, nên host không phải sửa dòng
|
||||
nào.
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
|
||||
<!--
|
||||
ĐIỂM KHÁC BIỆT DUY NHẤT của cả đường chạy: nav core đọc config từ đây.
|
||||
Cây overlay là symlink tới toàn bộ `pnkx_nav_core/config/`, trừ đúng một file thật
|
||||
`move_base_common_params.yaml` với `MoveBase: library_path: libmove_base2`.
|
||||
Cây overlay là file thật (không symlink), tự đủ khi clone repo lẻ. Bốn file riêng của
|
||||
move_base2: move_base_common_params.yaml (`MoveBase: library_path: libmove_base2`),
|
||||
action_handlers_params.yaml, compound_actions_params.yaml, maker_sources.yaml. Số còn lại là
|
||||
bản sao của `pnkx_nav_core/config/` và KHÔNG tự đồng bộ — xem launch/README.md.
|
||||
-->
|
||||
<env name="PNKX_NAV_CORE_CONFIG_DIR" value="$(find move_base2)/config/runtime" />
|
||||
|
||||
|
||||
@@ -209,6 +209,22 @@ void readMoveBase2Fields(robot::NodeHandle& nh, MoveBase2Config& config)
|
||||
readInt(nh, "max_planning_retries", config.state_machine.max_planning_retries);
|
||||
readBool(nh, "recovery_behavior_enabled", config.state_machine.recovery_enabled);
|
||||
|
||||
// Nghĩa của Twist đi qua arbiter — quyết định đơn vị của cả cụm giới hạn bên dưới. "steering"
|
||||
// (linear.x = tốc độ bánh steer, angular.z = GÓC lái) là convention của robot lái một bánh
|
||||
// trong workspace; để mặc định "twist" cho robot vi sai. Giá trị lạ giữ nguyên mặc định và
|
||||
// cảnh báo, không chết boot — nhưng validate() của VelocityLimits sẽ chặn tổ hợp vô nghĩa.
|
||||
{
|
||||
std::string semantics = toString(config.velocity.semantics);
|
||||
readString(nh, "command_semantics", semantics);
|
||||
if (semantics == "steering")
|
||||
config.velocity.semantics = CommandSemantics::kSteering;
|
||||
else if (semantics == "twist")
|
||||
config.velocity.semantics = CommandSemantics::kTwist;
|
||||
else
|
||||
robot::log_warning("[move_base2] unknown command_semantics '%s', keeping '%s'",
|
||||
semantics.c_str(), toString(config.velocity.semantics));
|
||||
}
|
||||
|
||||
readDouble(nh, "max_vel_x", config.velocity.max_vel_x);
|
||||
readDouble(nh, "min_vel_x", config.velocity.min_vel_x);
|
||||
readDouble(nh, "max_vel_theta", config.velocity.max_vel_theta);
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
#include <robot/robot.h>
|
||||
|
||||
namespace move_base2
|
||||
{
|
||||
namespace
|
||||
@@ -45,6 +47,11 @@ double clampTo(double value, double lower, double upper, bool& clamped)
|
||||
// VelocityLimits
|
||||
// ================================================================================================
|
||||
|
||||
const char* toString(CommandSemantics semantics)
|
||||
{
|
||||
return semantics == CommandSemantics::kSteering ? "steering" : "twist";
|
||||
}
|
||||
|
||||
bool VelocityLimits::validate(std::string& error) const
|
||||
{
|
||||
if (!(max_vel_x > 0.0))
|
||||
@@ -60,7 +67,17 @@ bool VelocityLimits::validate(std::string& error) const
|
||||
}
|
||||
if (!(max_vel_theta > 0.0))
|
||||
{
|
||||
error = "max_vel_theta must be > 0 [rad/s]";
|
||||
error = semantics == CommandSemantics::kSteering
|
||||
? "max_vel_theta must be > 0 [rad] (steering semantics: mechanical steer limit)"
|
||||
: "max_vel_theta must be > 0 [rad/s]";
|
||||
return false;
|
||||
}
|
||||
if (semantics == CommandSemantics::kSteering && max_vel_theta > M_PI)
|
||||
{
|
||||
// Một GÓC lái quá pi không tồn tại về cơ khí — gần như chắc chắn là người vận hành đang điền
|
||||
// yaw-rate vào profile steering, tức chọn nhầm semantics. Chết ở boot rẻ hơn kẹt giữa ca.
|
||||
error = "max_vel_theta must be <= pi [rad] under steering semantics (it is the MECHANICAL "
|
||||
"steering-angle limit; a larger value means the wrong command_semantics is selected)";
|
||||
return false;
|
||||
}
|
||||
if (!(max_accel_x > 0.0))
|
||||
@@ -83,14 +100,21 @@ bool VelocityLimits::validate(std::string& error) const
|
||||
|
||||
std::string VelocityLimits::describe() const
|
||||
{
|
||||
// In đúng đơn vị theo semantics: dòng log lúc boot là chỗ duy nhất người vận hành đối chiếu
|
||||
// được con số với thực tế cơ khí; in "rad/s" cho một góc lái là giấu đúng cái lỗi cần thấy.
|
||||
const bool steering = semantics == CommandSemantics::kSteering;
|
||||
|
||||
std::ostringstream out;
|
||||
out << "VelocityLimits:\n";
|
||||
out << " max_vel_x : " << max_vel_x << " m/s (forward)\n";
|
||||
out << "VelocityLimits (" << toString(semantics) << " semantics):\n";
|
||||
out << " max_vel_x : " << max_vel_x
|
||||
<< (steering ? " m/s (steer-wheel speed, forward)" : " m/s (forward)") << '\n';
|
||||
out << " min_vel_x : " << min_vel_x << " m/s (reverse"
|
||||
<< (min_vel_x == 0.0 ? ", reversing forbidden" : "") << ")\n";
|
||||
out << " max_vel_theta : " << max_vel_theta << " rad/s\n";
|
||||
out << " max_vel_theta : " << max_vel_theta
|
||||
<< (steering ? " rad (MECHANICAL steering-angle limit)" : " rad/s") << '\n';
|
||||
out << " max_accel_x : " << max_accel_x << " m/s^2\n";
|
||||
out << " max_accel_theta : " << max_accel_theta << " rad/s^2\n";
|
||||
out << " max_accel_theta : " << max_accel_theta
|
||||
<< (steering ? " rad/s (steering slew limit)" : " rad/s^2") << '\n';
|
||||
out << " zero_velocity_epsilon: " << zero_velocity_epsilon << '\n';
|
||||
return out.str();
|
||||
}
|
||||
@@ -126,6 +150,7 @@ void VelocityArbiter::reset()
|
||||
velocity_clamps_ = 0;
|
||||
acceleration_clamps_ = 0;
|
||||
handover_cycles_ = 0;
|
||||
steering_angle_clamps_ = 0;
|
||||
}
|
||||
|
||||
bool VelocityArbiter::stopped() const
|
||||
@@ -151,8 +176,28 @@ robot_geometry_msgs::Twist VelocityArbiter::sanitize(const robot_geometry_msgs::
|
||||
|
||||
bool clamped = false;
|
||||
clean.linear.x = clampTo(candidate.linear.x, limits_.min_vel_x, limits_.max_vel_x, clamped);
|
||||
|
||||
bool angular_clamped = false;
|
||||
clean.angular.z =
|
||||
clampTo(candidate.angular.z, -limits_.max_vel_theta, limits_.max_vel_theta, clamped);
|
||||
clampTo(candidate.angular.z, -limits_.max_vel_theta, limits_.max_vel_theta, angular_clamped);
|
||||
clamped = clamped || angular_clamped;
|
||||
|
||||
// Dưới steering semantics, angular.z là GÓC LÁI: một lệnh vượt trần không phải nhiễu mà là
|
||||
// xung đột cấu hình (trần khai sai so với cơ khí, hoặc planner xin góc không tồn tại). Phiên
|
||||
// bản không có tiếng hét này đã kẹt pivot 40 giây trong câm lặng: lệnh 1.5708 bị kẹp còn 1.0,
|
||||
// servo tới 1.0 rồi đứng, gate align không bao giờ mở. Hét lần đầu ngay, sau đó thưa dần —
|
||||
// không spam control loop nhưng không bao giờ im hẳn khi lỗi còn đó.
|
||||
if (angular_clamped && limits_.semantics == CommandSemantics::kSteering)
|
||||
{
|
||||
++steering_angle_clamps_;
|
||||
if (steering_angle_clamps_ == 1 || steering_angle_clamps_ % 300 == 0)
|
||||
{
|
||||
robot::log_error("[move_base2] steering-angle command %.4f rad exceeds max_vel_theta %.4f "
|
||||
"rad and was clamped (%zu times so far) — either raise max_vel_theta to "
|
||||
"the mechanical steering limit or fix the planner's align/steer config",
|
||||
candidate.angular.z, limits_.max_vel_theta, steering_angle_clamps_);
|
||||
}
|
||||
}
|
||||
|
||||
// Robot của workspace là phi holonomic ở mức contract cmd_vel: mọi thành phần còn lại bị bỏ, cố
|
||||
// ý không truyền tiếp để tránh một plugin lạ đẩy ra trục mà tầng dưới không kiểm.
|
||||
|
||||
@@ -100,6 +100,79 @@ TEST(VelocityLimits, DescribeMarksReverseAsDisabledWhenZero)
|
||||
EXPECT_NE(limits.describe().find("reversing forbidden"), std::string::npos);
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
// Steering semantics — angular.z là GÓC lái, không phải yaw rate
|
||||
// ================================================================================================
|
||||
|
||||
/// Trần góc lái quá pi không tồn tại về cơ khí: gần như chắc chắn người vận hành điền yaw-rate vào
|
||||
/// profile steering. Phải chết ở boot thay vì kẹt giữa ca.
|
||||
TEST(VelocityLimits, SteeringSemanticsRejectsAngleLimitBeyondPi)
|
||||
{
|
||||
VelocityLimits limits = baseLimits();
|
||||
limits.semantics = move_base2::CommandSemantics::kSteering;
|
||||
limits.max_vel_theta = 4.0; // [rad] — vô nghĩa với một GÓC lái
|
||||
|
||||
std::string error;
|
||||
EXPECT_FALSE(limits.validate(error));
|
||||
EXPECT_NE(error.find("steering"), std::string::npos);
|
||||
|
||||
limits.max_vel_theta = 1.5708; // đúng giới hạn cơ khí
|
||||
EXPECT_TRUE(limits.validate(error));
|
||||
}
|
||||
|
||||
/// describe() phải nói đúng đơn vị theo semantics — dòng log boot là chỗ duy nhất người vận hành
|
||||
/// đối chiếu số với cơ khí; in "rad/s" cho một góc là giấu lỗi.
|
||||
TEST(VelocityLimits, DescribeSpeaksSteeringUnits)
|
||||
{
|
||||
VelocityLimits limits = baseLimits();
|
||||
limits.semantics = move_base2::CommandSemantics::kSteering;
|
||||
limits.max_vel_theta = 1.5708;
|
||||
|
||||
const std::string text = limits.describe();
|
||||
EXPECT_NE(text.find("steering semantics"), std::string::npos);
|
||||
EXPECT_NE(text.find("MECHANICAL steering-angle limit"), std::string::npos);
|
||||
EXPECT_NE(text.find("steer-wheel speed"), std::string::npos);
|
||||
|
||||
// Profile twist giữ nguyên mô tả cũ.
|
||||
VelocityLimits twist_limits = baseLimits();
|
||||
EXPECT_NE(twist_limits.describe().find("rad/s"), std::string::npos);
|
||||
}
|
||||
|
||||
/// Tái hiện đúng lỗi đã bắt trên sim: lệnh pivot 1.5708 đi qua arbiter khai max_vel_theta = 1.0.
|
||||
/// Ở steering semantics việc cắt này phải bị ĐẾM (và hét ra log) — nó là xung đột cấu hình,
|
||||
/// không phải nhiễu; ở twist semantics thì cắt yaw-rate là việc thường, không đếm.
|
||||
TEST(VelocityArbiter, SteeringAngleClampIsCountedLoudly)
|
||||
{
|
||||
VelocityLimits limits = baseLimits();
|
||||
limits.semantics = move_base2::CommandSemantics::kSteering;
|
||||
limits.max_vel_theta = 1.0; // trần khai SAI so với cơ khí 1.5708
|
||||
|
||||
VelocityArbiter arbiter = makeArbiter(limits);
|
||||
const auto cmd = arbiter.arbitrate(VelocitySource::kController, twist(0.0, 1.5708), kDt);
|
||||
|
||||
EXPECT_DOUBLE_EQ(cmd.angular.z, 1.0); // hành vi clamp giữ nguyên (hàng rào vẫn là hàng rào)
|
||||
EXPECT_EQ(arbiter.steeringAngleClamps(), 1u); // nhưng phải bị ghi nhận
|
||||
|
||||
// Twist semantics: cùng lệnh, không đếm vào steering clamps.
|
||||
VelocityArbiter twist_arbiter = makeArbiter(baseLimits());
|
||||
twist_arbiter.arbitrate(VelocitySource::kController, twist(0.0, 1.5708), kDt);
|
||||
EXPECT_EQ(twist_arbiter.steeringAngleClamps(), 0u);
|
||||
}
|
||||
|
||||
/// Lệnh trong trần: không đếm gì cả.
|
||||
TEST(VelocityArbiter, SteeringAngleWithinLimitIsNotCounted)
|
||||
{
|
||||
VelocityLimits limits = baseLimits();
|
||||
limits.semantics = move_base2::CommandSemantics::kSteering;
|
||||
limits.max_vel_theta = 1.5708;
|
||||
|
||||
VelocityArbiter arbiter = makeArbiter(limits);
|
||||
const auto cmd = arbiter.arbitrate(VelocitySource::kController, twist(0.0, 1.5708), kDt);
|
||||
|
||||
EXPECT_DOUBLE_EQ(cmd.angular.z, 1.5708);
|
||||
EXPECT_EQ(arbiter.steeringAngleClamps(), 0u);
|
||||
}
|
||||
|
||||
TEST(VelocityArbiter, RefusesToEmitBeforeConfigure)
|
||||
{
|
||||
VelocityArbiter arbiter;
|
||||
|
||||
Reference in New Issue
Block a user