feat(move_base2): wait for a ready global costmap and replay maps in host order

- Replay static maps in arrival order instead of topic order, so a
  direction grid can no longer be replayed before its static map (F3).
- PlannerRunner checks every enabled global layer under the same lock as
  the snapshot; while not current it keeps the goal, reports
  waiting_for_costmap, logs the stale layers (throttled) and does not
  spend planner_patience or watchdog budget. After costmap_ready_timeout
  [s] (default 10, 0 = legacy behaviour) the attempt fails as before.
- Test fixture destroys the server before its fake ports; the control
  thread could call a destroyed port (race existed before this change).
This commit is contained in:
2026-11-04 11:14:15 +07:00
parent 7bfb3c362d
commit 6decd8db32
18 changed files with 446 additions and 31 deletions

View File

@@ -72,6 +72,20 @@ TEST(Watchdog, IdleRowsAreNeverHung)
EXPECT_FALSE(dog.anyHung()) << "idle for a long time is not 'hung'";
}
TEST(Watchdog, WaitingForCostmapDoesNotConsumePlannerBudget)
{
ComponentStatusBoard board;
Watchdog dog;
std::string error;
WatchdogConfig c = fastConfig();
c.period = 0.0;
ASSERT_TRUE(dog.start(&board, c, error)) << error;
board.enter(Component::kGlobalPlanner, ComponentPhase::kWaitingForCostmap);
sleepMs(80);
dog.checkOnce();
EXPECT_FALSE(dog.hung(Component::kGlobalPlanner));
}
TEST(Watchdog, BusyWithoutProgressBecomesHungAndRecoversOnProgress)
{
ComponentStatusBoard board;