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:
2026-08-27 13:22:07 +07:00
parent d0c8a0bcdc
commit 4cdbc11470
2 changed files with 10 additions and 5 deletions

View File

@@ -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)