find_package(catkin REQUIRED ...) sat at top level, so a build without catkin
died at configure time - and it died pointing at a package that IS present:
Could not find a package configuration file provided by "recovery_core"
recovery_core is in the tree and was added before this package. What is absent
is recovery_coreConfig.cmake, which only a catkin workspace produces. The error
sends you looking for a missing package instead of a missing build mode.
Standalone names the CMake targets directly rather than searching for them. The
root CMakeLists adds every package before this one, so their include
directories arrive through each target's PUBLIC interface - the order in that
file is the real constraint, not anything expressed here.
The plugin also goes to the top of the build tree in standalone mode. It is
loaded by boost::dll under a filename that PluginLoaderHelper resolves against
the build directory; left in its own subdirectory, it builds and is then
invisible at runtime.
Separately: catkin_add_gtest marks the test EXCLUDE_FROM_ALL, so catkin_make
never built it and ctest then failed with
/bin/sh: 1: .../devel/lib/sbpl_recovery/detour_path_recovery_test: not found
which reads as a broken test rather than a missing binary. Every other package
in this repository opens the target back up; this one did not. It does now, and
the 24 tests pass.
sbpl_recovery
Recovery behavior họ path cho recovery_core: khi local planner bế tắc (vật cản chắn tuyến),
behavior lập một đường vòng bằng một global planner plugin — mặc định SBPLLatticePlanner —
rồi nối đường vòng vào phần còn lại của global plan hiện hành và trả về cho runtime bám tiếp.
Port từ navigation_experimental/sbpl_recovery
(BSD, Eitan Marder-Eppstein) sang hệ sinh thái robot_* (không roscpp).
Khác bản gốc ở đâu
| Bản gốc (ROS) | Bản này |
|---|---|
Tự lái: chạy pose_follower bên trong, publish thẳng cmd_vel |
Không lái. Trả RecoveryOutputType::kPath; runtime áp path và local planner đang active bám theo — một nguồn vận tốc duy nhất |
Plan nhận qua topic NavfnROS/plan |
Plan đến từ RecoveryContext::plan — chính plan control loop đang bám |
| Sau recovery move_base replan nên chỉ cần lập tới điểm nối | Splice: path trả về = đường vòng + phần plan cũ sau điểm nối, vì runtime không replan sau recovery (contract 2026-08-04b) |
pluginlib |
boost::dll + BOOST_DLL_ALIAS(…, DetourPathRecovery) + library_path trong YAML |
Local costmap hay global costmap?
Mặc định local costmap (use_global_costmap: false):
- vật cản buộc phải vòng là thứ sensor vừa thấy — nằm tươi nhất trong local costmap;
- cửa sổ lăn nhỏ nên một lượt SBPL bounded (~vài chục ms), chạy được trong một tick recovery.
Đổi lại hai ràng buộc:
- điểm nối phải nằm trong cửa sổ local — vật cản chắn dài hơn nửa cửa sổ thì behavior trả
kFailedvà nhường behavior kế tiếp trong route; - local costmap chạy ở frame
odom, plan ở framemap→ cầnRecoveryContext::tf(runtime đã nối sẵn). Thiếu TF thì lượt chạy bị từ chối kèm lý do.
use_global_costmap: true khi cần vòng xa hơn cửa sổ (đổi lại phụ thuộc độ tươi của obstacle
layer trên global costmap).
Cấu hình
recovery:
behaviors:
- {name: detour_path, type: DetourPathRecovery}
routes:
# Thêm detour_path vào route nào cần đường vòng, ví dụ:
# controlling_failed: [wait, detour_path]
detour_path:
planner_name: SBPLLatticePlanner # global planner gen-1, nạp qua library_path ở root config
use_global_costmap: false
planning_distance: 2.0 # [m] điểm nối cách robot tối thiểu chừng này dọc plan
sample_step: 0.5 # [m] khoảng cách dọc plan giữa hai ứng viên điểm nối
rejoin_clearance: 0.5 # [m] điểm nối cách POSE BẨN GẦN NHẤT tối thiểu chừng này
attempts_per_run: 3 # số ứng viên thử tối đa một lượt (mỗi tick thử một ứng viên)
timeout: 10.0 # [s] trần lượt, recovery_core cưỡng chế
DetourPathRecovery:
library_path: libsbpl_recovery
Planner đọc tham số từ namespace mang tên chính nó (SBPLLatticePlanner/…) — trùng tên với
backup_global_planner thì dùng chung tuning, gồm cả primitive_filename (độ phân giải mprim
phải khớp resolution của costmap được chọn).
Hai khoá lock_costmap: false và costmap_frame_override chỉ dành cho unit test với costmap
placeholder — production không đặt.
Chọn điểm nối
Ứng viên điểm nối phải đặt được robot vào (RecoveryContext::collision, footprint thật) và cách
pose bẩn gần nhất dọc plan ít nhất rejoin_clearance. Chọn thuần theo khoảng cách — như bản gốc
— cho ra ứng viên nằm ngay trên vật cản đang chắn tuyến: planner không bao giờ tới được, mà mỗi lượt
thử hỏng vẫn giữ mutex costmap trọn allocated_time và làm đói thread cập nhật costmap.
Không có ứng viên nào đặt được → start() trả false ngay, không chạy lượt SBPL nào. Context
không có collision checker → quay về luật thuần-khoảng-cách (không biết thì không loại).
Verify
catkin_make --pkg sbpl_recovery
./devel/lib/sbpl_recovery/detour_path_recovery_test
Test dùng planner giả (TestLinePlanner, nạp qua đúng đường Boost.DLL) — kiểm chọn điểm nối,
splice, thử-lại theo ứng viên, quy đổi frame map↔odom qua tf3, mất pose giữa lượt, và từ chối khi
thiếu TF. Đường chạy với SBPL thật thuộc test tích hợp trên sim.