range-sensor-layer

Integrate short-range ToF, ultrasonic, and IR sensors into Nav2 costmaps.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

RangeSensorLayer integrates short-range sensors (ultrasonic, IR, VL53L0X time-of-flight) that publish sensor_msgs/Range messages. These sensors detect obstacles that lidar may miss: low obstacles below the lidar plane, transparent surfaces (glass), and very close objects inside the lidar's minimum range.

Core Features & Use Cases

  • Integration of ToF/ultrasonic/IR range sensors into the Nav2 costmap as a dynamic obstacle source.
  • Configurable with multiple topics, sensor cone angle (phi), cone inflation, and probabilistic thresholds to mark/clear cells.
  • Use Case: Detect glass doors or close-range obstacles that lidar alone might miss, by combining range readings with the costmap.

Quick Start

Configure the range_sensor_layer by adding the plugin with topics and thresholds, then launch the costmap to enable range-based obstacle marking.

Frequently Asked Questions about range-sensor-layer

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

FAQPage Schema
How do I integrate ultrasonic or ToF range sensors into a Nav2 costmap?

You can integrate short-range sensors into a Nav2 costmap by configuring the range sensor layer plugin via YAML. This allows ToF, ultrasonic, and IR sensors publishing sensor_msgs/Range to mark obstacles dynamically.

Why does my Nav2 robot crash into glass doors that the lidar misses?

Lidar often misses transparent surfaces like glass doors. Adding a range sensor layer to your Nav2 costmap allows short-range ToF or ultrasonic sensors to detect and mark these obstacles for safer navigation.

How do I configure cone inflation and marking thresholds for range sensors in Nav2?

You can configure cone inflation, marking thresholds, and clearing behavior by adjusting the phi, clear_on_max_reading, and combination_method parameters in your Nav2 costmap YAML configuration file.

Can I use multiple range sensor topics simultaneously in a single Nav2 costmap layer?

Yes, the range sensor layer supports configuration with multiple topics. You can define several ToF, ultrasonic, or IR sensor topics in the YAML to collectively mark and clear costmap cells.

What is the best way to detect low obstacles below the lidar plane in ROS2?

Integrating short-range IR or ultrasonic sensors using a Nav2 costmap range layer is an effective approach. These sensors detect low obstacles below the lidar plane and mark them in the costmap.

Why is my range sensor layer not clearing obstacles correctly in Nav2?

Obstacle clearing issues in the range sensor layer often relate to YAML misconfiguration. Verify your clear_on_max_reading setting and combination_method to ensure cells are cleared correctly when sensors report maximum readings.