laser-scan-processing

Filter, convert, and segment 2D LaserScan data in ROS 2.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw 2D lidar scans contain invalid readings (inf, NaN), chassis self-hits, speckle noise, and shadow artifacts that corrupt downstream obstacle detection and costmap generation. This Skill provides the message structure knowledge, conversion math, and filter configurations needed to clean and process LaserScan data in ROS 2. ## Core Features & Use Cases - LaserScan Message Handling: Explains every field of sensor_msgs/msg/LaserScan, including how to compute per-ray angles and validate ranges against range_min/range_max. - Polar-to-Cartesian Conversion: Provides the math and Python snippets to convert valid range readings into 2D points in the sensor frame. - Filter Chain Configuration: Covers the laser_filters package plugins (angular bounds, range, box, shadows, speckle) with ready-to-adapt YAML and launch integration. - Use Case: A robot's lidar sees its own chassis as permanent close obstacles. Diagnose the fixed points in RViz, then apply a LaserScanAngularBoundsFilter to exclude the affected angular range before feeding the scan to a Nav2 costmap. ## Quick Start Ask the assistant to configure a laser_filters chain that removes chassis self-hits and speckle noise from the /scan topic and republishes it for a Nav2 costmap.

Frequently Asked Questions about laser-scan-processing

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

FAQPage Schema
How do I filter LaserScan data in ROS 2?

Use the laser_filters package, which applies a composable chain of filter plugins to LaserScan messages. Configure filters like LaserScanRangeFilter or LaserScanSpeckleFilter in YAML and run them via the scan_to_scan_filter_chain node.

How to convert LaserScan ranges to Cartesian points?

Compute each ray's angle as angle_min + i * angle_increment, then x = ranges[i] * cos(angle) and y = ranges[i] * sin(angle). Always check math.isfinite on the range first, since inf means no return and NaN indicates a sensor error.

Why does my lidar detect the robot chassis as an obstacle?

Chassis self-hits occur when the lidar's field of view includes the robot body, appearing as fixed close points in the base_link frame. Fix them with LaserScanAngularBoundsFilter to exclude the affected angles or LaserScanBoxFilter around the footprint.

What do inf and NaN values mean in LaserScan ranges?

An inf value means the beam did not return, indicating open space beyond the maximum range. A NaN value indicates a sensor measurement error for that ray. Both should be excluded before conversion or further processing.

Can LaserScan data feed a Nav2 costmap?

Yes, Nav2 costmaps consume LaserScan through the observation_sources configuration. Publish the filtered scan to /scan and set data_type to LaserScan with marking and clearing enabled, plus appropriate obstacle and raytrace range limits.