Skip to content

Feature: Add SurfaceConditionFilter costmap filter plugin #6080

@aki1770-del

Description

@aki1770-del

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions