From 9598c7e67bbf3573fd2ac23247383fcd5b5930aa Mon Sep 17 00:00:00 2001 From: Ryan Henderson Date: Sat, 18 Nov 2023 14:48:13 -0800 Subject: [PATCH] Update rplidar.py Receiving start_angle errors when using a Slamtec RPLIDAR A1M8 on Windows/Python and attemping to set scan_mode to 'express'. For some reason (I'm new to this) self.express_data is being set to bool. Added to the "if not self.express_data" check to see if it's bool. Works fine now in express mode. --- rplidar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rplidar.py b/rplidar.py index 89ebd5c..47c878c 100644 --- a/rplidar.py +++ b/rplidar.py @@ -399,7 +399,7 @@ def iter_measures(self, scan_type='normal', max_buf_meas=3000): if self.scanning[2] == 'express': if self.express_trame == 32: self.express_trame = 0 - if not self.express_data: + if not self.express_data or type(self.express_data) == bool: self.logger.debug('reading first time bytes') self.express_data = ExpressPacket.from_string( self._read_response(dsize))