Background
Nav2's costmap filter framework provides SpeedFilter, KeepoutFilter, and BinaryFilter as built-in plugins. Each reads an OccupancyGrid filter mask and applies a different behavior when the robot enters a marked zone.
There is currently no filter for hazardous road surface conditions — ice roads, snow-covered passes, or zones where the map data (OSM highway=winter_road, highway=ice_road) indicates degraded traction. Operators who annotate such zones on their maps have no pluggable way to feed that annotation into the Nav2 costmap/planner pipeline.
Proposal
Add SurfaceConditionFilter — a new costmap filter plugin following the SpeedFilter pattern:
- Reads a
CostmapFilterInfo + OccupancyGrid filter mask (same subscription pattern as existing filters)
- When the robot is in a marked cell, publishes
std_msgs::msg::Bool to a configurable surface_condition_topic (allows downstream nodes to adapt behavior — slow down, increase warning threshold, change planner params)
- Inflates costmap costs in hazardous zones by a configurable
cost_scaling_factor, causing the planner to prefer routes that avoid those zones when alternatives exist
- Adds
SURFACE_CONDITION_FILTER = 4 to filter_values.hpp
Motivation
With growing OSM coverage of highway=winter_road (~35K ways) and highway=ice_road (~15K ways), and ADAS systems reading surface condition signals from VSS (Vehicle.RoadCondition.SurfaceCondition), there is a clear integration gap in Nav2. This plugin would close it at the costmap layer — the right architectural boundary.
Implementation sketch
3 new files + 3 modified files:
plugins/costmap_filters/surface_condition_filter.cpp (~200 lines)
include/nav2_costmap_2d/costmap_filters/surface_condition_filter.hpp (~60 lines)
costmap_plugins.xml — add class entry
CMakeLists.txt — add to filters library
filter_values.hpp — add constant
Happy to open a PR if this direction looks good to you.
AI-assisted — authored with Claude, reviewed by Komada.
Background
Nav2's costmap filter framework provides
SpeedFilter,KeepoutFilter, andBinaryFilteras built-in plugins. Each reads anOccupancyGridfilter mask and applies a different behavior when the robot enters a marked zone.There is currently no filter for hazardous road surface conditions — ice roads, snow-covered passes, or zones where the map data (OSM
highway=winter_road,highway=ice_road) indicates degraded traction. Operators who annotate such zones on their maps have no pluggable way to feed that annotation into the Nav2 costmap/planner pipeline.Proposal
Add
SurfaceConditionFilter— a new costmap filter plugin following theSpeedFilterpattern:CostmapFilterInfo+OccupancyGridfilter mask (same subscription pattern as existing filters)std_msgs::msg::Boolto a configurablesurface_condition_topic(allows downstream nodes to adapt behavior — slow down, increase warning threshold, change planner params)cost_scaling_factor, causing the planner to prefer routes that avoid those zones when alternatives existSURFACE_CONDITION_FILTER = 4tofilter_values.hppMotivation
With growing OSM coverage of
highway=winter_road(~35K ways) andhighway=ice_road(~15K ways), and ADAS systems reading surface condition signals from VSS (Vehicle.RoadCondition.SurfaceCondition), there is a clear integration gap in Nav2. This plugin would close it at the costmap layer — the right architectural boundary.Implementation sketch
3 new files + 3 modified files:
plugins/costmap_filters/surface_condition_filter.cpp(~200 lines)include/nav2_costmap_2d/costmap_filters/surface_condition_filter.hpp(~60 lines)costmap_plugins.xml— add class entryCMakeLists.txt— add tofilterslibraryfilter_values.hpp— add constantHappy to open a PR if this direction looks good to you.
AI-assisted — authored with Claude, reviewed by Komada.