obstacle-layer

Manage lethal obstacle marking and clearing in a Nav2 costmap.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill obstacle-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: obstacle-layer
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/obstacle-layer
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill obstacle-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mark lethal obstacles in a 2D Nav2 costmap and clear them as the robot moves, using data from multiple sensors to maintain an accurate representation of the environment.

Core Features & Use Cases

  • Multi-source observation handling: supports multiple sensors (e.g., scan, depth_camera) with independent marking and clearing configurations.
  • Raytracing clearing: clears cells along sensor rays to prevent stale obstacles.
  • Footprint-aware clearing: clears cells under the robot's footprint to avoid self-obstacles.
  • Real-time validation: configurable expected_update_rate to detect stale data.

Quick Start

Run the obstacle-layer with your Nav2 configuration to begin marking obstacles from sensors and clearing cells during robot motion.

Frequently Asked Questions about obstacle-layer

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

FAQPage Schema
How do I mark and clear dynamic obstacles in a ROS2 Nav2 costmap?

To handle multiple sensors in a Nav2 costmap, configure independent observation sources like scan and depth_camera. The obstacle layer processes each source separately for marking and clearing to maintain accurate obstacle detection.

Why does my Nav2 costmap show phantom obstacles during robot motion?

Phantom obstacles in a Nav2 costmap appear when stale data is not cleared properly. Using raytrace clearing along sensor rays and configuring expected_update_rate checks ensures old obstacle cells are removed as the robot moves.

How do I clear lethal obstacles under the robot footprint in ROS2?

To clear lethal obstacles under the robot footprint in ROS2, enable footprint_clearing_enabled in your obstacle layer. This clears cells directly beneath the robot to prevent the costmap from treating the robot's own body as an obstacle.

Can I configure obstacle_range and raytrace_range per sensor in Nav2?

Yes, you can configure obstacle_range and raytrace_range per sensor in Nav2. The obstacle layer satisfies per-source configuration requirements, allowing independent marking and clearing toggles for multiple observation sources.

How do I detect stale sensor data in a ROS2 costmap obstacle layer?

To detect stale sensor data in a ROS2 costmap obstacle layer, set the expected_update_rate parameter. This real-time validation feature monitors update rates to identify when observation sources stop providing fresh data.