28 #include <fast_methods/ndgridmap/ndgridmap.hpp>
31 using namespace cimg_library;
36 typedef typename std::array<unsigned int, 2> Coord2D;
37 typedef typename std::array<double, 2> Point2D;
38 typedef typename std::vector <Point2D> Path2D;
39 typedef typename std::vector <Path2D> Paths2D;
53 template<
class T,
size_t ndims>
54 static void selectMapPoints
55 (
nDGridMap<T, ndims> & grid, std::array<unsigned int,ndims> & coords_init, std::array<unsigned int,ndims> & coords_goal,
const bool flipY = 1) {
56 unsigned int y = 0, x = 0;
59 CImg<double> img(d[0],d[1],1,1,0);
62 cimg_forXY(img,x,y) { img(x,y) = grid[img.width()*(img.height()-y-1)+x].getOccupancy()*255; }
64 cimg_forXY(img,x,y) { img(x,y) = grid[img.width()*y+x].getOccupancy(); }
66 CImgDisplay main_disp(img,
"Click a point");
71 if (main_disp.button() && main_disp.mouse_y()>=0) {
73 y = img.height()- 1- main_disp.mouse_y();
75 y = main_disp.mouse_y();
76 x = main_disp.mouse_x();
86 if (main_disp.button() && main_disp.mouse_y()>=0) {
88 y = img.height()- 1- main_disp.mouse_y();
90 y = main_disp.mouse_y();
91 x = main_disp.mouse_x();
Templated class which represents a n-dimensional grid map. Its cells are assumed to be cubic...
std::array< unsigned int, ndims > getDimSizes() const
Returns the size of each dimension.
Auxiliar class which helps to select initial and goal points in a 2D grid.