ROS node that allows to merge two sensor_msgs/LaserScan
s, projecting them onto a single plane.
First scan is a main one (main_scan
), the second one is an auxiliary one (aux_scan
). Merged scan contains ranges projected onto the main scan's plane.
The merging algorithm uses main scan's points as a reference. The merged scan contains only these points from the auxiliary scan that are closer to the sensor frame, compared to the main one.
Sensor model is considered to compare main scan's readings with the closest readings from the auxiliary scan.
A typical application is to set main_scan
as a LiDAR scan, whereas the second one as a LaserScan retrieved from a RGBD camera (converted from PCL).
Screenshots retrieved from PAL's TiAGo robot simulation.
The package was tested (so far) under Ubuntu 16.04 and ROS Kinetic.
Node can be run with:
rosrun laser_plane_merger laser_plane_merger_node scan1:=scan scan2:=rgbd_scan
/scan1
(sensor_msgs/LaserScan)/scan2
(sensor_msgs/LaserScan)/tf
(tf/tfMessage)/tf_static
(tf2_msgs/TFMessage)
The node uses message_filters::Subscriber
s with ApproximateTime
synchronization policy so the resultant scan is computed with slower scan's (main or auxiliary) frequency.
/scan_merged
(sensor_msgs/LaserScan)/laser_plane_merger/marker
(visualization_msgs/Marker)
- ~scan_main_topic_name (string, default: "/scan1")
- ~scan_aux_topic_name (string, default: "/scan2")
- ~scan_merged_topic_name (string, default: "/scan_merged")
- ~global_frame_name (string, default: "map")
Parameters default values can easily be remapped as noted in Run section or with a launch
file.
Scan with a higher resolution must be selected as a main
one if one wants to merge 2 different scans.
It comes from the fact that the algorithm tries to compare obstacle elements found in main scan to elements found in auxiliary scan (if scanning ray goes in the same direction from reference position) and selects closest obstacle element from both scans.
What's more, the resultant LaserScan
inherits all features (angle range, angle increment) from the main
scan.