Skip to content

Commit 6a58990

Browse files
nav2_costmap_2d: fix unit tests following change
Signed-off-by: Dylan De Coeyer <[email protected]>
1 parent b3efe17 commit 6a58990

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

nav2_costmap_2d/test/integration/inflation_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ TEST_F(TestNode, testInflation)
462462
layers.updateMap(0, 0, 0);
463463
// printMap(*costmap);
464464
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE), 20u);
465-
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 28u);
465+
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 78u);
466466

467467
/*/ Iterate over all id's and verify they are obstacles
468468
for(std::vector<unsigned int>::const_iterator it = occupiedCells.begin(); it != occupiedCells.end(); ++it){
@@ -480,7 +480,7 @@ TEST_F(TestNode, testInflation)
480480
// It and its 2 neighbors makes 3 obstacles
481481
ASSERT_EQ(
482482
countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE) +
483-
countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 51u);
483+
countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 98u);
484484

485485
// @todo Rewrite
486486
// Add an obstacle at <2,0> which will inflate and refresh to of the other inflated cells
@@ -494,7 +494,7 @@ TEST_F(TestNode, testInflation)
494494
// at <0, 1>
495495
ASSERT_EQ(
496496
countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE) +
497-
countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 54u);
497+
countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 98u);
498498

499499
// Add an obstacle at <1, 9>. This will inflate obstacles around it
500500
addObservation(olayer, 1, 9);

nav2_costmap_2d/test/integration/plugin_container_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ TEST_F(TestNode, testDifferentInflationLayers) {
268268
nav2_costmap_2d::Costmap2D * costmap = layers.getCostmap();
269269

270270
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE), 21);
271-
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 4);
271+
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 77);
272272
}
273273

274274
TEST_F(TestNode, testDifferentInflationLayers2) {
@@ -317,7 +317,7 @@ TEST_F(TestNode, testDifferentInflationLayers2) {
317317
nav2_costmap_2d::Costmap2D * costmap = layers.getCostmap();
318318

319319
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE), 21);
320-
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 28);
320+
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 77);
321321
}
322322

323323
TEST_F(TestNode, testResetting) {
@@ -447,7 +447,7 @@ TEST_F(TestNode, testClearing) {
447447
nav2_costmap_2d::Costmap2D * costmap = layers.getCostmap();
448448

449449
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::LETHAL_OBSTACLE), 21);
450-
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 29);
450+
ASSERT_EQ(countValues(*costmap, nav2_costmap_2d::INSCRIBED_INFLATED_OBSTACLE), 77);
451451
ASSERT_EQ(olayer_b->getCost(9, 9), nav2_costmap_2d::LETHAL_OBSTACLE);
452452

453453
pclayer_a->clearArea(-1, -1, 10, 10, false);

0 commit comments

Comments
 (0)