Implementation of differents algorithms for segmentation of laserscans, splitting them into subsets of beams, with a ROS2 interface. The currently implemented algorithm are:
Jump distance clustering:
widely used method for 2D laser range data in mobile robotics. It's a simple and fast method to segment the scans: if the Euclidean distance between two adjacent beams exceeds a given threshold distance, a new segment is generated.Jump distance clustering and merge:
Similar algorithm as above but checks if pre-predecessor segments are close to each other. This deals with over-segmented data with many small cluster in outdoor environment. It uses the same threshold condition twice.
In the two implementation mentioned above the jump distance threshold is fixed. However, a dynamic jump distance threshold can be calculated using methods of Lee (Lee, 2001), Dietmayer (Dietmayer, et al., 2001) and Santos (Santos, et al., 2003). See the parameters list below to change between them.
Includes a dynamic reconfigure server parameter to change online the configuration of the algorithms and the filtering.
Laser scan | Segments |
---|---|
Keywords: ROS2, laser, segmentation, clustering
Author: Alberto Tudela
The laser_segmentation package has been tested under ROS2 Humble on Ubuntu 22.04. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.
- Robot Operating System (ROS) 2 (middleware for robotics),
- slg_msgs (Library and messages to interact with laser related geometry - use Humble branch),
To build from source, clone the latest version from the main repository into your colcon workspace and compile the package using
cd colcon_workspace/src
git clone https://github.com/ajtudela/laser_segmentation.git -b humble
cd ../
rosdep install -i --from-path src --rosdistro humble -y
colcon build --symlink-install
With some scan source running, run the laser_segmentation node with: ros2 launch laser_segmentation segmentation.launch.py
Segmentation of the laserscans.
-
scan
(sensor_msgs/LaserScan)Laser scan topic where segmentation will be performed.
-
segments
(slg_msgs/SegmentArray)Splitted segments resulting of the segmentation.
-
segments/visualization
(visualization_msgs/MarkerArray)It comprises three namespaces:
-
scan_topic
(string, default: "scan")Topic of the laserscan.
-
segment_topic
(string, default: "segments")Topic of the segmented laser scan.
-
segmentation_type
(string, default: "jump_distance")Choose between several segmentation algorithms. Jump distance clustering (
jump_distance
) and jump distance and merge (jump_distance_merge
).
-
min_points_segment
(int, default: 3)Minimium number of points per segment.
-
max_points_segment
(int, default: 200)Maximum number of points per segment.
-
min_avg_distance_from_sensor
(double, default: 0.0)Minimium average distance from sensor.
-
max_avg_distance_from_sensor
(double, default: 20.0)Maximum average distance from sensor.
-
min_segment_width
(double, default: 0.2)Minimium width of the segment.
-
max_segment_width
(double, default: 10.0)Maximum width of the segment.
-
method_threshold
(string, default: "")Method to calculate a dynamic jump distance threshold in jump_distance or jump_distance_merge algorithms. This value and methods are based on
lee
(Lee, 2001),diet
(Dietmayer, et al., 2001) orsantos
(Santos, et al., 2003). -
distance_threshold
(double, default: 0.3)If none of the algorithms mentioned above is selected, this parameters will be use as the jump distance above which a new segment is created.
-
noise_reduction
(double, default: 0.3)Parameter for noise reduction in "Santos" and "Dietmayer" algorithms.