slam_toolbox icon indicating copy to clipboard operation
slam_toolbox copied to clipboard

ignore measurements outside lidar range

Open 981213 opened this issue 2 years ago • 2 comments

According to the comment in sensor_msgs/LaserScan, values < range_min or > range_max should be discarded. Without this, scan matching will fail for lidars publishing 0 for invalid measurements.


Basic Info

Info Please fill out this column
Primary OS tested on Ubuntu 22.04 / ROS2 Humble
Robotic platform tested on My DIY robot with LeiShen Lidar

Description of contribution in a few bullet points

  • Don't add a point to UnfilteredPoingReadings when the range reading is outside lidar range.

981213 avatar Oct 25 '22 12:10 981213

I moved the filtration outside karto_sdk in the latest iteration. The scan matching is fixed in both the old and this version, but loop closure still doesn't seem right with my half-blocked lidar.

I placed a second lidar on top of the half-blocked one to do some comparison. Here's my robot setup: Robot Setup With async slam node, the top lidar and all the default configuration, it works perfectly: Result with the top LSN10 lidar But here's the result using the bottom one: Screenshot_20230404_145322 I wrote the lidar driver myself: https://github.com/981213/ls01_ros2 and the blocked measurements are set to 0 with memset in my code.

It would be great if someone can give me some suggestions on debugging. Here's the ros2 bag for the test above. rosbag2_2023_04_04-14_16_58.zip

/scan is the half-blocked lidar and /scan2 is the one on top. The missing lidar transform:

ros2 run tf2_ros static_transform_publisher 0.03 0.0 0.1415 0 0 0 base_footprint laser_link

981213 avatar Apr 04 '23 07:04 981213

Fixed with the latest commit, but I'm not sure if it's the correct fix because I haven't actually understood how ScanMatcher works yet.

edit: dropped this. I should simply lower the threshold in config file instead.

981213 avatar Apr 05 '23 11:04 981213