Occupancy Grid é um formato de mapa para robôs e navegação autónoma em ROS/ROS 2. Mapa como imagem raster (PGM): cada pixel é 'livre', 'ocupado' ou 'desconhecido'. Usado para SLAM, planeamento de trajetórias e Nav2.
Principais características

Sobre o formato ROS Grid
An occupancy grid is how a mobile robot sees the world: the territory is split into square cells, each marked as free, occupied or unknown. In ROS and ROS 2 such a map is stored as a pair of files — a raster .pgm and a .yaml description — served through map_server, and the Nav2 planners build a route on it.
Usually the robot builds such a map itself, driving around the territory with a scanner. A map from OpenStreetMap is needed where the robot has not driven yet: to model deliveries across a block, to test a planner on a real street and courtyard network, to prepare a scene for simulation, to give the robot an initial idea of the district.
What is inside: a ZIP with map.pgm (a black-and-white raster) and map.yaml with the resolution, the origin and the occupancy thresholds. Buildings, water and permanent barriers such as walls and fences become occupied cells; roads, sidewalks and parks become free ones; everything else stays unknown. The default resolution is 0.5 meters per pixel and can be set down to 0.1 meters; the raster side is capped at 10,000 pixels, so a large district has to be taken at a coarser resolution.
Que programa abre ficheiros ROS Grid
Os seguintes programas e aplicações podem abrir, editar e trabalhar com ficheiros ROS Occupancy Grid (.zip) exportados do OSM2CDR:
Format specifications
- Open standard
- 2D only
- Lossless (no quality loss)
- No attributes
- Output: 2 files in archive
- ROS occupancy grid map: .pgm raster + .yaml metadata (ZIP). For ROS / ROS 2 navigation stack (move_base, Nav2).
Quem utiliza mapas ROS Grid
Como exportar para ROS Grid
Como abrir depois da exportação
- ROS 1 — put both files next to each other and launch map_server with the path to map.yaml: the map will appear in the /map topic and in RViz.
- ROS 2 and Nav2 — the path to map.yaml is given in the nav2_map_server parameters inside the launch file, and from there the planner uses the map as is.
- RViz — Add > Map, topic /map: a quick way to make sure the walls and the passages are in place and the scale is right.
- Gazebo — the map works well as the base of a scene for simulating a drive before going out to a real test site.
- GIMP or any raster editor — the .pgm can be edited by hand: paint a closed zone black, a passage white, and leave gray for the unknown.
Mapas populares em ROS Grid
Obtenha exportações de mapas em ROS Occupancy Grid
Descarregue mapas profissionais em ROS Grid a partir do OpenStreetMap. Geração instantânea, qualquer área.