Auxiliar static class which helps to load maps into nDGridMap. More...
#include <maploader.hpp>
Static Public Member Functions | |
template<class T , size_t ndims> | |
static void | loadMapFromImg (const char *filename, nDGridMap< T, ndims > &grid) |
Loads the initial binary map for a given grid. It is based on the nDGridMap::setOccupancy() which has to be bool valued. More... | |
template<class T , size_t ndims> | |
static int | loadMapFromText (const char *filename, nDGridMap< T, ndims > &grid) |
Loads the initial binary map for a given grid. It is based on the nDGridMap::setOccupancy() which has to be bool valued. This function has to be overloaded in another occupancy type is being used. More... | |
Include checks which ensure that the grids are adequate for the functions used.
When loading an empty grid, cells are not correctly initialized. Although it works properly, values are not set to Inf (that is why we have Nan values in obstacles.)
It is based on the CImg library, therefore it has to be accessible. Copyright (C) 2014 Javier V. Gomez www.javiervgomez.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition at line 33 of file maploader.hpp.
|
inlinestatic |
The image should be 256bits grayscale and only 2D grids should be passed.
It also stores all the false values as initial points for a later compute() function in FM2.
The Y dimension flipping is because nDGridMap works in X-Y coordinates, not in image indices as CImg.
IMPORTANT NOTE: no type-checkings are done. T type has to be Cell or any class with bool setOccupancy() method.
filename | file to be open |
grid | 2D nDGridmap |
init_points | stores the indices of all the values which are false. |
Definition at line 51 of file maploader.hpp.
|
inlinestatic |
Occupancy values should be between 0 and 1.
In also stores all the false values to as initial points for a later computeFM function in FM2.
Should be used only in 2D grids.
leafsize_
(float) ndims
(size_t) dimsize_[0]
(int) dimsize_[1]
(int) x1...
(double) x2...
(double)
The Y dimension flipping is because nDGridMap works in X-Y coordinates, not in image indices as CImg.
IMPORTANT NOTE: no type-checkings are done. T type has to be Cell or any class with bool setOccupancy() method.
filename | text file to be open |
grid | 2D nDGridmap |
init_points | stores the indices of all the values which are false. |
Definition at line 96 of file maploader.hpp.