ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Failed to open and upload big image file, map_file and map_server

asked 2019-05-03 13:10:30 -0600

Lucas Marins gravatar image

updated 2019-05-06 13:07:06 -0600

I am using Kinetic and Ubuntu 16.04.6 LTS, I am trying to upload a map file for map_server and use it for navigation and amcl localization, but it is really big, 25500 x 5300 pixels (.pgm). The map_server is not starting and shows this message:

[ERROR] [1556905481.419883442]: failed to open image file "/home/dev/src/robot/navigation/maps/bigger_map.pgm": Out of memory

Is possible to use a map with a big number of pixels or I need to reduce the number of pixels to work well? Is it depends on computer memory RAM?

I have tried to use in .png file format, but the message was the same.

edit retag flag offensive close merge delete



I'm not into navigation at all, but 25500 x 5300 == 135150000 bytes (approx 128MB). And that is just if each cell only occupies a single byte (which is probably not the case). High resolution maps could be an issue. Do things work if you subsample the map? Otherwise I'd suggest to search for some previous Q&As about map resolution and related problems.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-04 04:40:07 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-05-07 12:04:55 -0600

Lucas Marins gravatar image

I have found out that the map_server uses SDL_image to read image files and dimensions are limited to 8192 x 8192 == 67108864 pixels, approximately half of my map. There is also a one-year open issue in ros-planning GitHub repository. Until now, the best solution is to divide the map to some small maps or sections and write a map switcher node to manage it.

edit flag offensive delete link more

Question Tools



Asked: 2019-05-03 13:10:30 -0600

Seen: 1,398 times

Last updated: May 06 '19