DbViewer: fit in view the graph when changing iterations. Limited to 900MB creation of the grid map (in case graph is very erroneous).

This commit is contained in:
matlabbe
2017-12-01 11:56:27 -05:00
parent 4452e637ad
commit dafaac412f
4 changed files with 7 additions and 6 deletions

View File

@@ -297,8 +297,8 @@ cv::Mat create2DMapFromOccupancyLocalMaps(
yMin += cellSize/2.0f;
float xMax = maxX+margin;
float yMax = maxY+margin;
if(fabs((yMax - yMin) / cellSize) > 99999 ||
fabs((xMax - xMin) / cellSize) > 99999)
if(fabs((yMax - yMin) / cellSize) > 30000 || // Max 1.5Km/1.5Km at 5 cm/cell -> 900MB
fabs((xMax - xMin) / cellSize) > 30000)
{
UERROR("Large map size!! map min=(%f, %f) max=(%f,%f). "
"There's maybe an error with the poses provided! The map will not be created!",