obstacle-layer

Configure Nav2 obstacle layer parameters for laser and pointcloud obstacle marking and clearing.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Configuring the Nav2 ObstacleLayer correctly is error-prone: mismatched raytrace and obstacle ranges leave phantom obstacles in the costmap, and misconfigured observation sources cause stale data or missing detections. This Skill provides the parameter reference and rules needed to set up reliable 2D obstacle marking and clearing. ## Core Features & Use Cases - Observation Source Setup: Define named LaserScan or PointCloud2 sources with independent marking, clearing, and range settings. - Range Validation Rules: Enforce the critical constraint that raytrace_range must exceed obstacle_range to prevent phantom obstacles. - Multi-Sensor Configuration: Combine front/rear lidars and depth cameras with per-source marking-only or clearing-only roles. - Use Case: A robot's costmap accumulates ghost obstacles after turning. Use this Skill to diagnose the raytrace_range versus obstacle_range mismatch and add a clearing-only wide-FOV source. ## Quick Start Configure the Nav2 obstacle layer with a front LaserScan source using obstacle_range 3.0 and raytrace_range 4.0, and explain why the raytrace range must be larger.

Frequently Asked Questions about obstacle-layer

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

FAQPage Schema
How do I configure the Nav2 obstacle layer with a LaserScan source?

Add the source name to observation_sources, then define its block with topic, data_type LaserScan, marking and clearing flags, obstacle_range, and raytrace_range. Set raytrace_range at least 1m greater than obstacle_range so marked cells can be cleared.

Why do phantom obstacles persist in my Nav2 costmap?

Phantom obstacles occur when raytrace_range is smaller than obstacle_range, so marks at the outer range are never raytrace-cleared. Increase raytrace_range above obstacle_range and ensure at least one source has clearing set to true.

Can I use a depth camera with the Nav2 obstacle layer?

Yes, set data_type to PointCloud2 and subscribe to the camera's points topic. Use min_obstacle_height around 0.05m to filter ground noise, and consider marking-only mode while a lidar handles clearing.

What does combination_method do in Nav2 costmap layers?

combination_method controls how this layer merges with previous layers. Set it to 1 (Maximum) so obstacle marks do not overwrite higher inflation costs; Overwrite (0) erases costs from earlier layers in the plugin order.

How do I detect a disconnected sensor in the obstacle layer?

Set expected_update_rate to a positive Hz value for the source. The layer then logs a stale-data warning when no new messages arrive within that period, catching disconnected sensors or topic remapping errors.