Skip to content

Annotating ROS occupancy grid maps

After a few hours of SLAM tuning you have a beautiful occupancy grid. Now you need to put it in a paper, a report, or a presentation, with the planned route drawn on it, the target poses labelled, the no-go zones shaded. This is what drawtonomy’s ROS map import is for.

drawtonomy reads a ROS map pair (.pgm image + .yaml metadata) and:

  • Places the occupancy grid on the canvas at the correct metric scale.
  • Uses the resolution and origin fields from the YAML so world coordinates round-trip.
  • Lets you draw lanes, intersections, vehicles, pedestrians, traffic lights, and free-form arrows / text on top.

The drawing layer is a separate set of shapes; the original .pgm is never modified.

  • Paper figures. “Figure 3: nav2 planning around obstacles.” A bare occupancy grid is barely legible; a grid with planned routes and target poses tells the story.
  • Internal docs. A SLAM map annotated with no-go zones, charging-dock locations, and named subareas is the kind of artifact that survives team turnover.
  • Lecture material. When teaching nav2 or AMCL, an annotated grid lets students see what the planner sees.
  • Bug reproducers. “Robot got stuck here, here is the grid, here is the planned path that fails.”
  1. Import. Import → ROS map. Drop both .pgm and .yaml (or zip them together).
  2. Verify scale. The yaml’s resolution and origin are applied automatically. The drawtonomy ruler shows metres.
  3. Annotate. Use Lane, Vehicle, Path, Polygon, and Text shapes. The Polygon tool with low opacity works well for shading no-go zones.
  4. Save as .drawtonomy.svg (drawtonomy’s native SVG format). Annotations on a SLAM map are almost never one-shot — new no-go zones get added, named subareas change, the map itself sometimes gets re-recorded. .drawtonomy.svg reopens with every annotation in place, so iteration is an edit instead of a redraw.
  5. Export for distribution. From the same scene, export PNG for documentation that doesn’t need scalable vectors, or a flat SVG (with the grid as a raster background and your annotations as vectors) for papers and slides.
  • Use a single accent color for the annotation layer. Multiple colors on top of a grayscale grid create visual noise.
  • Add a scale bar manually with a Linestring and a Text shape — drawtonomy doesn’t auto-render one, but the rulers tell you exactly how many metres a given length is.
  • Drawtonomy is not a replacement for nav2’s map_server editing tools (CLI utilities to crop / inflate / rotate the grid). For those, stay in the ROS toolchain.
  • The annotation layer is drawtonomy-native; keep the .drawtonomy.svg file as the source of truth, and export a flat SVG only when you need the annotation geometry in another tool.

See the Import ROS occupancy grid guide for the import details.