Report why an action failed instead of a bare "action failed"
FrameSamplerActionHandler already builds a precise reason for each way it can fail: too few samples, detection too scattered, could not publish the output frame, raw frame never appeared. All four reached the log as the same four words, because control_loop read the tick, kept only the status, and dropped the message, while the state machine passed a hard-coded string to finish(). Three field runs in a row could not be diagnosed for that reason: the detector was healthy, the host confirmed pallet_raw was published and resolvable, and the only thing navigation said was "action failed". The handler message now travels through StateMachineInput into the terminal reason, so it reaches the host feedback as well as the log, and control_loop logs it directly - as an error when the action fails, as info when it succeeds, where it carries the sample count worth comparing against the next failure. StateMachineOutput::reason is a const char* and enter() stores the pointer rather than copying, so the composed string lives in a StateMachine member. Building it in a local would return a pointer into destroyed memory - every other reason in that class is a string literal, so nothing had hit this before. Two tests cover it: the message reaches the reason, and the reason survives the StateMachineInput that carried it. Config in this tree follows the same split as the robot: per-marker dock_anchor and footprint_dock in maker_sources.yaml, detect handlers separated into detect_charger and detect_pallet.
This commit is contained in:
@@ -24,14 +24,16 @@ position:
|
||||
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
|
||||
local_planner: StanleyLocalPlanner
|
||||
|
||||
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
|
||||
# StanleyDockingLocalPlanner = CUNG libstanley_local_planner voi profile position,
|
||||
# chi khac alias -> doc block config rieng (tolerance chat, toc do dock cham).
|
||||
local_planner: StanleyDockingLocalPlanner
|
||||
|
||||
go_straight:
|
||||
global_planner: TwoPointsPlanner
|
||||
@@ -157,7 +159,7 @@ oscillation_distance: 0.5
|
||||
# `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
|
||||
command_semantics: steering
|
||||
|
||||
# [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.
|
||||
|
||||
Reference in New Issue
Block a user