Drop terminal_direction from the docking planner allow-list
Nothing reads the key. DockPlanner's config takes dock_anchor, the footprint and the drive model; terminal_direction was copied down into the planner namespace and sat there. The direction of the final straight leg is derived instead: dock_calc tries nose-first and reverse and keeps whichever needs the smaller pivot, so the side the robot stands on carries the intent. The layer above has already offset the goal so base_link ends up on it, which means a marker key forcing the other direction would contradict the goal position it was handed. Docking in reverse is a different goal, not a different flag. Leaving it in the allow-list makes the planner namespace advertise a live key that does nothing, and a config that lies is worse than one that lacks the key. The fixture test now asserts the allow-list stays closed instead: the marker profile also carries global_planner and local_planner, and copying the whole block down would put meaningless keys into the planner namespace where they can shadow real ones.
This commit is contained in:
@@ -44,9 +44,13 @@ bool isFinitePose(const robot_geometry_msgs::PoseStamped& pose)
|
||||
///
|
||||
/// `dock_anchor` khai goal pose của marker nằm ở tâm footprint dock (`center`) hay ngay trên mặt
|
||||
/// tiếp cận (`face`). `face` thì DockPlanner bỏ qua `footprint_dock` hoàn toàn.
|
||||
/// `terminal_direction` chọn chiều chuyển động trên đoạn thẳng cuối: forward/reverse/auto.
|
||||
///
|
||||
/// KHÔNG có `terminal_direction` ở đây, và cố ý như vậy: chiều chạy của đoạn thẳng cuối được SUY RA
|
||||
/// từ phía robot đứng so với goal (`dock_calc.cpp`), vì tầng trên đã offset goal sao cho base_link
|
||||
/// dừng đúng tại đó khi manơ hoàn tất. Một khoá cho phép marker ép chiều khác sẽ mâu thuẫn với
|
||||
/// chính vị trí goal, nên khoá đó đã được gỡ thay vì hiện thực.
|
||||
constexpr const char* kMarkerPlannerParams[] = {
|
||||
"footprint_dock", "dock_anchor", "terminal_direction"
|
||||
"footprint_dock", "dock_anchor"
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -466,9 +466,10 @@ TEST(PlannerRunnerDockingMarker, CopiesTheMarkerFootprintIntoThePlannerNamespace
|
||||
ASSERT_EQ(copied.size(), 4U);
|
||||
EXPECT_DOUBLE_EQ(copied[0][0].as<double>(), 0.5);
|
||||
EXPECT_DOUBLE_EQ(copied[0][1].as<double>(), -0.4);
|
||||
std::string terminal_direction;
|
||||
ASSERT_TRUE(nh.getParam("TestPlannerOk/terminal_direction", terminal_direction));
|
||||
EXPECT_EQ(terminal_direction, "forward");
|
||||
// Allow-list đóng: profile của marker còn mang `global_planner`/`local_planner`, chép cả cụm sang
|
||||
// sẽ tạo ra khoá vô nghĩa trong namespace planner và có thể đè lên khoá cùng tên.
|
||||
std::string leaked;
|
||||
EXPECT_FALSE(nh.getParam("TestPlannerOk/global_planner", leaked, std::string()));
|
||||
}
|
||||
|
||||
TEST(PlannerRunnerDockingMarker, TargetsWhateverPlannerTheProfileNamesNotJustDockPlanner)
|
||||
|
||||
Reference in New Issue
Block a user