allenh1 / rplidar_ros

BSD 2-Clause "Simplified" License
42 stars 43 forks source link

Slam Toolbox compatibility #18

Closed chrisl8 closed 4 years ago

chrisl8 commented 4 years ago

As it is now. the RPLIDAR driver is not compatible with the latest version of Slam Toolbox.

This error will be received constantly instead: LaserRangeScan contains 360 range readings, expected 359.

Without this update, Slam Toolbox will not work with the RPLIDAR driver, however please let me know if you think there is a better solution.

The issue is explained here: https://github.com/SteveMacenski/slam_toolbox/issues/278

The fix I propose forces the angle_increment to be calculated using all of the nodes, which prevents this error message from being displayed. I also updated the scan_time to keep it in sync.

allenh1 commented 4 years ago

@chrisl8 Very good catch. It doesn't make any sense at all for them to subtract 1 there. I thought I was just not understanding something so I didn't change it, but I'm glad to know this fixes it.

Cheers!

Federico-Maresca commented 2 years ago

Hi I have been going down the rabbit hole of the +1 laser scan count using RP Lidar and Slam-Toolbox and have applied the patch to my RP Lidar nodes however the problem does not go away. I'm using Noetic and RPLidar A2M8

allenh1 commented 2 years ago

@Federico-Maresca Hi! Unfortunately, this repository is for ROS 2, so I"m afraid I won't be able to help you. I would encourage you to open a ticket on the official repository, hopefully they will be able to help you out :)