map-formats

Explain ROS 2 map YAML metadata and occupancy-image encoding rules.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill map-formats
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: map-formats
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/map-formats
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill map-formats

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Understand ROS 2 map formats and how to interpret YAML metadata paired with grayscale occupancy images, enabling reliable map usage across navigation stacks.

Core Features & Use Cases

  • YAML metadata interpretation demonstrates how image, resolution, origin, negate, occupied_thresh, free_thresh, and mode define the map.
  • Image encoding guidance explains PGM and PNG formats, the meaning of pixel values, and how to map them to occupancy values in different interpretation modes (trinary, scale, raw).
  • Practical workflows include scenarios with SLAM Toolbox serialized maps and map servers for navigation tasks.

Quick Start

Explain how to interpret a ROS 2 map YAML alongside its image and determine the proper occupancy encoding.

Frequently Asked Questions about map-formats

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I interpret a ROS 2 map YAML file and its occupancy grid image?

A ROS 2 map YAML file defines occupancy grid metadata using keys like image, resolution, origin, negate, occupied_thresh, and free_thresh, which map pixel values in paired PGM or PNG images to occupancy states.

What do occupied_thresh and free_thresh mean in a ROS 2 occupancy grid?

In a ROS 2 occupancy grid, occupied_thresh and free_thresh are YAML parameters that define the pixel intensity cutoffs determining whether grayscale image pixels represent occupied, free, or unknown space.

How does the trinary, scale, and raw mode affect ROS 2 map server interpretation?

The mode parameter in ROS 2 map YAML selects between trinary, scale, and raw interpretation, controlling how grayscale pixel values in PGM or PNG images are converted into occupancy probabilities.

Can I use SLAM Toolbox serialized maps with the ROS 2 map server?

SLAM Toolbox serialized maps can be used with ROS 2 navigation stacks by correctly pairing the YAML metadata with PGM or PNG occupancy images and applying the proper interpretation mode.

What is the difference between PGM and PNG formats for ROS 2 occupancy maps?

PGM and PNG are both supported image formats for ROS 2 occupancy grids, storing grayscale pixel values that the map server interprets based on the YAML configuration's negate and threshold parameters.

Why does my ROS 2 navigation map show incorrect obstacles after loading a YAML file?

Incorrect obstacle representation in ROS 2 navigation maps often stems from misconfigured YAML parameters such as occupied_thresh, free_thresh, or the negate flag, which invert or misinterpret grayscale occupancy pixel values.