4 #include "boost/foreach.hpp" 6 #include <gtest/gtest.h> 30 std::list<unsigned int> to_test;
35 BOOST_FOREACH(
unsigned int idx, to_test){
45 std::list<unsigned int> to_test;
50 BOOST_FOREACH(
unsigned int idx, to_test){
74 std::fill(map, map+ (size_x*size_y)/2, 0);
75 std::fill(map+(size_x*size_y)/2 + 1, map+(size_x*size_y), 1);
83 unsigned int input = 80;
86 ASSERT_EQ(input,result);
92 unsigned int input = 20;
95 ASSERT_NE(input,result);
101 unsigned int input = std::numeric_limits<unsigned int>::max();
107 int main(
int argc,
char **argv){
108 testing::InitGoogleTest(&argc, argv);
109 return RUN_ALL_TESTS();
void resizeMap(unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y)
std::vector< unsigned int > nhood4(unsigned int idx, const costmap_2d::Costmap2D &costmap)
Determine 4-connected neighbourhood of an input cell, checking for map edges.
bool nearestCell(unsigned int &result, unsigned int start, unsigned char val, const costmap_2d::Costmap2D &costmap)
Find nearest cell of a specified value.
unsigned char * getCharMap() const
costmap_2d::Costmap2D costmap_
std::vector< unsigned int > nhood8(unsigned int idx, const costmap_2d::Costmap2D &costmap)
Determine 8-connected neighbourhood of an input cell, checking for map edges.
unsigned int getSizeInCellsY() const
unsigned int getSizeInCellsX() const
costmap_2d::Costmap2D costmap_
unsigned int getIndex(unsigned int mx, unsigned int my) const