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:
@@ -393,6 +393,31 @@ TEST(StateMachinePlanning, PlannerPatienceEscalatesToRecovery)
|
||||
EXPECT_TRUE(out.stop_planner);
|
||||
}
|
||||
|
||||
TEST(StateMachinePlanning, CostmapWaitDoesNotSpendPatienceOrRetries)
|
||||
{
|
||||
StateMachineConfig config = baseConfig();
|
||||
config.max_planning_retries = 0;
|
||||
Driver driver(config);
|
||||
StateMachineInput request;
|
||||
request.has_pending_request = true;
|
||||
ASSERT_EQ(driver.tick(request).state, NavigationState::kPlanning);
|
||||
StateMachineInput waiting;
|
||||
waiting.planner = PlannerFeedback::kWaitingForCostmap;
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
driver.advance(0.6);
|
||||
EXPECT_EQ(driver.tick(waiting).state, NavigationState::kPlanning);
|
||||
}
|
||||
StateMachineInput busy;
|
||||
busy.planner = PlannerFeedback::kBusy;
|
||||
busy.planner_costmap_wait_finished = true;
|
||||
driver.advance(0.6);
|
||||
EXPECT_EQ(driver.tick(busy).state, NavigationState::kPlanning);
|
||||
driver.advance(0.6);
|
||||
EXPECT_EQ(driver.tick(StateMachineInput()).state, NavigationState::kPlanning);
|
||||
EXPECT_EQ(driver.tick(plannerFailed()).state, NavigationState::kRecovering);
|
||||
}
|
||||
|
||||
TEST(StateMachinePlanning, MaxRetriesEscalatesBeforePatienceExpires)
|
||||
{
|
||||
StateMachineConfig config = baseConfig();
|
||||
|
||||
Reference in New Issue
Block a user