This commit is contained in:
2026-08-06 15:17:59 +07:00
parent 701d25f952
commit 5375a9da9e
33 changed files with 3199 additions and 137 deletions

View File

@@ -82,6 +82,21 @@ TEST(RecoveryRunner, ResolvesPerTriggerRoutesByBehaviorName)
EXPECT_EQ(routes.oscillation[0], 1u); // wait_long
}
TEST(RecoveryRunner, RouteMayRepeatABehavior)
{
// Lặp behavior = cấp thêm lượt thử cho vòng "thử — chờ — nhích lại gần — thử lại" (2026-08-05):
// cursor chỉ reset khi robot đi đủ oscillation_distance, nên route không lặp thì cạn ngay sau
// một cặp [detour, wait] dù chỗ nối sắp vào tầm.
Rig rig;
ASSERT_TRUE(rig.load("recovery"));
const move_base2::RecoveryRoutes& routes = rig.runner.routes();
ASSERT_EQ(routes.path_blocked.size(), 3u);
EXPECT_EQ(routes.path_blocked[0], 0u); // wait_short
EXPECT_EQ(routes.path_blocked[1], 1u); // wait_long
EXPECT_EQ(routes.path_blocked[2], 0u); // wait_short lần hai — cùng behavior, lượt thử mới
}
TEST(RecoveryRunner, SkipsFuturePluginFromRoutesWithoutCreatingInvalidIndexes)
{
Rig rig;