costmap-filters

Configure Nav2 costmap filters for keepout zones, speed limits, and binary region triggers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Applying spatial restrictions like keepout zones or speed limits to a Nav2 navigation stack normally requires modifying the base map or writing custom costmap layers. This Skill explains how to use Nav2's costmap filter infrastructure to overlay spatial masks on the costmap without touching the original map. ## Core Features & Use Cases - Filter Architecture Setup: Configure the two required components — the CostmapFilterInfoServer node and the filter layer plugin inside the costmap — with correct topic wiring. - Three Filter Types: Apply KeepoutFilter (lethal regions), SpeedFilter (speed-limited regions), or BinaryFilter (entry/exit topic triggers) using a standard OccupancyGrid mask. - Mask Creation Guidance: Build a filter mask PGM/YAML from the navigation map with matching origin and resolution, and run multiple filters simultaneously on separate topics. - Use Case: A warehouse robot must never enter a charging area and must slow down near pedestrian walkways. Create a mask marking those regions, serve it via map_server, and add keepout and speed filter plugins to the global costmap. ## Quick Start Set up a Nav2 keepout zone for my map by creating a filter mask and adding the KeepoutFilter plugin to my global costmap configuration.

Frequently Asked Questions about costmap-filters

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

FAQPage Schema
How do I set up a keepout zone in Nav2?

Create a filter mask OccupancyGrid with the keepout region painted as occupied, serve it with a map_server node, run a costmap_filter_info_server with type 0, and add the nav2_costmap_2d::KeepoutFilter plugin to your costmap's plugin list.

How do I create a filter mask for Nav2 costmap filters?

Start from the same PGM image as your navigation map, paint filter regions in an image editor (black for keepout, grayscale for speed), and save it with a YAML file whose origin and resolution exactly match the base map.

Can I use multiple costmap filters at the same time in Nav2?

Yes. Each filter needs its own CostmapFilterInfoServer and map_server pair publishing on distinct topics, plus a separate plugin entry in the costmap configuration, such as keepout_filter and speed_filter together.

Why is my Nav2 costmap filter not working?

The most common cause is that the filter_mask_server or costmap_filter_info_server lifecycle nodes are not active. Check their state with ros2 lifecycle get, verify the mask origin and resolution match the map, and confirm filter info is published on the expected topic.

Where should filter plugins go in the Nav2 costmap plugin order?

Place filter plugins after obstacle layers but before the inflation layer. This ordering lets the inflation layer generate proper cost gradients around keepout zones marked by the filter.