Skip to content

Commit

Permalink
nav2_smac_planner: add corner case to unit tests
Browse files Browse the repository at this point in the history
Add a plan where the start and goal are placed on the same cell.

Signed-off-by: Dylan De Coeyer <[email protected]>
  • Loading branch information
DylanDeCoeyer-Quimesis committed Dec 13, 2024
1 parent 76eda26 commit 728054f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nav2_smac_planner/test/test_smac_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ TEST(SmacTest, test_smac_2d) {
} catch (...) {
}

// corner case where the start and goal are on the same cell
goal.pose.position.x = 0.01;
goal.pose.position.y = 0.01;

try {
planner_2d->createPlan(start, goal, dummy_cancel_checker);
} catch (...) {
}

planner_2d->deactivate();
planner_2d->cleanup();

Expand Down
9 changes: 9 additions & 0 deletions nav2_smac_planner/test/test_smac_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ TEST(SmacTest, test_smac_se2)
} catch (...) {
}

// corner case where the start and goal are on the same cell
goal.pose.position.x = 0.01;
goal.pose.position.y = 0.01;

try {
planner->createPlan(start, goal, dummy_cancel_checker);
} catch (...) {
}

planner->deactivate();
planner->cleanup();

Expand Down
9 changes: 9 additions & 0 deletions nav2_smac_planner/test/test_smac_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ TEST(SmacTest, test_smac_lattice)
} catch (...) {
}

// corner case where the start and goal are on the same cell
goal.pose.position.x = 0.01;
goal.pose.position.y = 0.01;

try {
planner->createPlan(start, goal, dummy_cancel_checker);
} catch (...) {
}

planner->deactivate();
planner->cleanup();

Expand Down

0 comments on commit 728054f

Please sign in to comment.