scanse / sweep-ros

Scanse Sweep ROS Driver and Node
MIT License
68 stars 62 forks source link

Support sensor_msgs/LaserScan #2

Closed sevenbitbyte closed 7 years ago

sevenbitbyte commented 7 years ago

Typically planar LIDAR systems are supported in ROS using the sensor_msgs/LaserScan message type documented here rather than PointCloud2(though its great you provide this). This message type supports the angle and signal_strength fields of sweep_response_scan_packet_t in the LaserScan.angle_* and LaserScan.intensities fields respectively. By correctly supporting your LIDAR using sensor_msgs/LaserScan you can fully support every bit of data coming from the sensor. There already exist many ROS tools and examples for assembling multiple LaserScans into PointCloud2s no to mention numerous navigation tools that require LaserScan over PointCloud2 such as gmapping. In gmapping you would force the user to convert the current PointCloud2 back to a LaserScan which is likely to be a very common use case in robotic navigation.

@kent-williams

kent-williams commented 7 years ago

@sevenbitbyte Thanks for sharing your thoughts! I certainly agree that LaserScan makes the most sense, but we had decided to use PointCloud2 for a few different reasons. To start with though, there is a launch file sweep2scan.launch provided for doing the conversion to LaserScan and it works just fine. The main reason we chose the point cloud type is because sweep works a little differently than most traditional LiDAR scanners. Instead of one or two measurement pulses, the LidarLite sensor will send several pulses until it receives a sufficient amount of good return signal to complete a ranging. The side of effect of this is that it's not always deterministic, so we can't assume it will take measurements at even angular increments. The LaserScan msg type assumes that the distance measurements are taken at even angular increments and therefore would incorrectly represent when the measurements actually took place. The PointCloud msg type is much more flexible of course and allows us to represent the ranges at any angle.

Hope this helps!

sevenbitbyte commented 7 years ago

Makes perfect sense, thanks for the explanation. Can't wait to try this out when units ship.