Open jarkenau opened 9 months ago
To my understanding, the code responsible for the auto standby assumes that the motor has been started (e.g a node subscribing to the /scan topic) before it can be stopped. This is because is_scanning must be true before the motor can be automatically stopped. https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L441-L443 is_scanning is only set in the start() method https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L346 which is only called if auto_standby is disabled or /scan has more than one subscriber https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L438-L439 https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L416
/scan
is_scanning
start()
auto_standby
A possible solution is to simply skip the check when having no subscribers. Due to the LIDAR starting spinning as soon as it gets power.
To my understanding, the code responsible for the auto standby assumes that the motor has been started (e.g a node subscribing to the
/scan
topic) before it can be stopped. This is becauseis_scanning
must be true before the motor can be automatically stopped. https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L441-L443is_scanning
is only set in thestart()
method https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L346 which is only called ifauto_standby
is disabled or/scan
has more than one subscriber https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L438-L439 https://github.com/Slamtec/rplidar_ros/blob/f0ace62de964af87f8b47f2d91cbd7b5d677f2ca/src/rplidar_node.cpp#L416A possible solution is to simply skip the check when having no subscribers. Due to the LIDAR starting spinning as soon as it gets power.