34 #include <gtest/gtest.h> 45 TEST(CostmapQueue, basicQueue)
59 TEST(CostmapQueue, reverseQueue)
67 EXPECT_FLOAT_EQ(cell.
distance_, hypot(4.0 - static_cast<double>(cell.
x_),
68 4.0 - static_cast<double>(cell.
y_)));
74 TEST(CostmapQueue, bigTest)
91 EXPECT_EQ(count, 500 * 500);
94 TEST(CostmapQueue, linearQueue)
109 EXPECT_EQ(count, 25);
116 int xs[] = {1, 2, 2, 3};
117 int ys[] = {2, 1, 3, 2};
119 for (
int i = 0; i < N; i++)
129 for (
int i = 0; i < N; i++)
131 double dd = hypot(xs[i] - static_cast<float>(cell.
x_), ys[i] - static_cast<float>(cell.
y_));
132 min_d = std::min(min_d, dd);
137 EXPECT_EQ(count, 25);
140 TEST(CostmapQueue, limitedQueue)
151 EXPECT_EQ(count, 24);
161 EXPECT_EQ(count, 11);
165 TEST(CostmapQueue, changingSize)
178 unsigned int count = 0;
200 int main(
int argc,
char **argv)
202 testing::InitGoogleTest(&argc, argv);
207 return RUN_ALL_TESTS();
void reset() override
Clear the queue.
nav_core2::BasicCostmap costmap
TEST(CostmapQueue, basicQueue)
A tool for finding the cells closest to some set of originating cells.
Extension of Costmap Queue where distances are limited to a given distance from source cells...
void enqueueCell(unsigned int x, unsigned int y)
Add a cell the queue.
int main(int argc, char **argv)
Storage for cell information used during queue expansion.
bool isEmpty()
Check to see if there is anything in the queue.
void setInfo(const nav_grid::NavGridInfo &new_info) override
CellData getNextCell()
Get the next cell to examine, and enqueue its neighbors as needed.