navigation icon indicating copy to clipboard operation
navigation copied to clipboard

Support in map_server for Rather Large Maps

Open DLu opened this issue 6 years ago • 4 comments

As reported here

I need to localize a robot in a warehouse of 415x270 meters with a <3cm precision, which make a map of 20768x13612px at 0.020 m/px and a pgm file of 282 MB. (Or 1.7 MB in png). I tried to load it to AMCL but map_server cannot even load the map on a PC with 16GB of ram because SDL yell "Out of memory". I manage to load it by cropping some part of the map, but that's not a real solution. I could also lower the resolution, but it would be a temporary fix until I need a bigger map.

DLu avatar Nov 16 '17 18:11 DLu

@DLu Probably 1 year later is too much but I have to ask. Did you find a solution? I have the same problem. Since now I've saved into a .txt file the data of the occupancy grid (created in MATLAB); I've wrote a node that takes this file and create the occupancyGrid msg and the service "static_map". As you can see is a long ride to get the job done but I wonder if there is a better solution...

PizzocaroSolomon avatar Sep 09 '18 15:09 PizzocaroSolomon

I think this ticket was solely created from the discussion -- AFAIK, there is nobody actively working on a fix specifically for this. Separately, there is a ticket about changing the datatypes in AMCL -- https://github.com/ros-planning/navigation/issues/778 -- which also has an active PR -- https://github.com/ros-planning/navigation/pull/791 -- you might give that a try. (if you do try out that PR, please drop a comment here or on the PR letting us know if it helped)

mikeferguson avatar Sep 10 '18 15:09 mikeferguson

For a given application, I know plenty of companies that tile their maps and load only sections at a time that are relevant in order to help deal with this. It's also a common strategy used in 3D dense and sparse reconstruction due to the amount of data stored.

SteveMacenski avatar Sep 10 '18 17:09 SteveMacenski

This issue would be due to restriction in SDL-1.2.

https://github.com/libsdl-org/SDL-1.2/blob/main/src/video/SDL_surface.c#L47-L52

SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
			int width, int height, int depth,
			Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
	:

	/* Make sure the size requested doesn't overflow our datatypes */
	/* Next time I write a library like SDL, I'll use int for size. :) */
	if ( width >= 16384 || height >= 65536 ) {
		SDL_SetError("Width or height is too large");
		return(NULL);
	}

	:
}

eduidl avatar Jun 01 '21 05:06 eduidl