feat: log eps/cost/thời gian thật của mỗi lượt replan, thêm bộ mprim R=1.06 m

Log nội bộ của SBPL bị compile bỏ (Test/sbpl/.../config.h:53 DEBUG 0 làm
SBPL_PRINTF rỗng), nên không có đường nào biết ARA* dừng ở nấc epsilon nào.
Thêm một dòng sau mỗi lượt solve:

  [sbpl_lattice_planner] solved: eps=%.3f (init %.2f), cost=%d, %zu state(s),
                         %.0f ms of %.2f s allowed

Đọc thế nào: eps == initial_epsilon nghĩa là hết giờ ngay ở nấc đầu (nới
allocated_time hoặc hạ initial_epsilon); eps == 1.0 nghĩa là đã tới nghiệm tối
ưu. Trả về sớm hơn nhiều allocated_time nghĩa là search CẠN STATE — tăng thêm
vô ích, vấn đề nằm ở goal không tới được.

Kèm bộ primitive mới diff_r106_tip3_5cm.mprim (sinh bởi Test/mprim_gen): cung
đều R=1.06 m, turninplacecostmult 3. File cũ unicycle_highcost_5cm.mprim vẫn
nằm cạnh để quay lại bằng một dòng config.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rayqed51UoUzE7QDRmM9K
This commit is contained in:
2026-09-04 19:34:26 +07:00
parent 6fbc29f6d8
commit 9c1667eb3c
2 changed files with 1350 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -447,6 +447,7 @@ bool SBPLLatticePlanner::makePlan(const robot_geometry_msgs::PoseStamped& start,
planner_->set_search_mode(false);
robot::log_debug("[sbpl_lattice_planner] run planner");
const robot::Time plan_started = robot::Time::now();
vector<int> solution_stateIDs;
int solution_cost;
try{
@@ -464,7 +465,20 @@ bool SBPLLatticePlanner::makePlan(const robot_geometry_msgs::PoseStamped& start,
}
}
if(ret)
robot::log_debug("Solution is found\n");
{
// eps THẬT đạt được, không phải eps đặt trong config. Cần thiết vì toàn bộ log nội bộ của
// SBPL bị compile bỏ (`Test/sbpl/.../config.h:53 DEBUG 0` làm `SBPL_PRINTF` rỗng), nên đây
// là đường DUY NHẤT biết ARA* dừng ở nấc nào. Không có nó thì mọi kết luận về
// `allocated_time` chỉ là suy đoán từ thời gian đo được.
//
// Đọc thế nào: eps == initial_epsilon nghĩa là hết giờ ngay ở nấc đầu — nới `allocated_time`
// hoặc hạ `initial_epsilon`. eps == 1.0 nghĩa là đã tới nghiệm tối ưu.
robot::log_info("[sbpl_lattice_planner] solved: eps=%.3f (init %.2f), cost=%d, %zu state(s), "
"%.0f ms of %.2f s allowed",
planner_->get_final_epsilon(), initial_epsilon_, solution_cost,
solution_stateIDs.size(),
(robot::Time::now() - plan_started).toSec() * 1000.0, allocated_time_);
}
else{
robot::log_info("Solution not found\n");
// publishStats(solution_cost, 0, start, goal);