keepout-zones

Configure Nav2 keepout zones using PGM filter masks and costmap plugins.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill keepout-zones-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: keepout-zones
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/keepout-zones
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill keepout-zones-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Robots navigating with Nav2 may plan paths through areas that must remain off-limits, such as staircases, fragile equipment zones, or hazardous regions. This Skill defines those no-go areas as lethal costmap cells so the planner and controller never route through them. ## Core Features & Use Cases - Mask-Based Zone Definition: Create a PGM filter mask from the navigation map where black pixels mark keepout regions and white pixels mark free space. - Nav2 Server Setup: Launch map_server and costmap_filter_info_server nodes to serve the mask and publish filter metadata (type=0 for keepout). - Costmap Integration: Add the KeepoutFilter plugin to the global (and optionally local) costmap plugin list before the inflation layer. - Use Case: A warehouse robot must never enter a charging-station maintenance area. Paint that region black in the mask, wire up the servers and filter plugin, and the global planner routes around it automatically. ## Quick Start Set up a Nav2 keepout zone for my map by creating a filter mask from my map PGM and adding the KeepoutFilter plugin to my global costmap configuration.

Frequently Asked Questions about keepout-zones

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

FAQPage Schema
How do I set up keepout zones in Nav2?

Create a PGM mask where black pixels mark keepout areas, serve it with map_server, publish filter metadata with costmap_filter_info_server (type=0), and add the KeepoutFilter plugin to the global costmap plugins list before the inflation layer.

How do I create a keepout filter mask for Nav2?

Start from your map's PGM file, open it in an editor like GIMP, paint keepout areas solid black and everything else white, then save it with a YAML file whose resolution and origin exactly match your navigation map.

Should I add the keepout filter to the local costmap too?

Usually not, since the global planner already avoids the zone. Adding KeepoutFilter to the local costmap is an optional safety layer that prevents the controller from commanding motion into the zone even under external forces.

Why does my Nav2 planner still route through the keepout zone?

Verify the mask server is active by echoing the /keepout_mask topic, confirm the KeepoutFilter plugin appears in the costmap plugins list, and check that both servers are registered with the lifecycle manager.

Why did my entire map become lethal after adding a keepout mask?

The mask image is likely inverted. Ensure negate is set to 0 in the mask YAML and that white pixels mean no restriction while black pixels mark keepout regions.

Can I update Nav2 keepout zones dynamically at runtime?

Yes. Publish a new OccupancyGrid to the /keepout_mask topic and the KeepoutFilter picks it up on the next costmap update, enabling temporary programmatic keepout zones.