SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
95 stars 85 forks source link

Negative range_min Value After Upgrading to sick_scan_xd v3.1.0 #246

Closed m4rcs closed 8 months ago

m4rcs commented 8 months ago

Environment:

Issue Description: I recently updated the sick_scan_xd package from version 2.10.2 to version 3.1.0 to use with my picoScan150 Prime-1 scanner. In my setup, the application requires LaserScan format data. Previously, with sick_scan_xd v2.10.2, I utilized the pointcloud_to_laserscan node to convert point cloud data to LaserScan format. However, given that the new version 3.1.0 of sick_scan_xd natively supports LaserScan, I removed the pointcloud_to_laserscan node from my workflow.

I configured my application to directly subscribe to the /sick_picoscan/scan_fullframe topic, expecting it to receive LaserScan data. Unfortunately, this change led to an application crash. The crash appears to be triggered by the range_min parameter in the LaserScan data having a negative value.

Output/Error Log:

root@lidar:/# rostopic echo /sick_picoscan/scan_fullframe  | grep range_min
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
range_min: -0.0010000000474974513
...

Additionally, I would like to inquire if the negative value in the range_min field is an expected behavior with the new version 3.1.0 of sick_scan_xd, especially when using it with the picoScan150 Prime-1 scanner. Is there a known issue or a configuration parameter that I might be missing which could lead to this negative value? Understanding whether this is a standard behavior or a bug will help me in troubleshooting and adjusting my application's configuration accordingly.

rostest commented 8 months ago

Thanks for reporting this issue and your detailed description! Neg. range_min values are possible due to rounding. Please checkout the update provided in branch feature/picoscan_min_range on https://github.com/SICKAG/sick_scan_xd/tree/feature/picoscan_min_range, which fixes this issue.

m4rcs commented 8 months ago

Thanks for the quick response. I tested the fix in the branch and can confirm that it is working.