@@ -105,7 +105,9 @@ def _process_scan(raw: bytes) -> Tuple[bool, int, float, float]:
105
105
return new_scan , quality , angle , distance
106
106
107
107
108
- def _process_express_scan (data : "ExpressPacket" , new_angle : float , frame : int ) -> Tuple [bool , None , float , float ]:
108
+ def _process_express_scan (
109
+ data : "ExpressPacket" , new_angle : float , frame : int
110
+ ) -> Tuple [bool , None , float , float ]:
109
111
new_scan = (new_angle < data .start_angle ) & (frame == 1 )
110
112
angle = (
111
113
data .start_angle
@@ -132,7 +134,14 @@ class RPLidar:
132
134
express_data = False
133
135
express_old_data = None
134
136
135
- def __init__ (self , motor_pin : DigitalInOut , port : UART , baudrate : int = 115200 , timeout : float = 1 , logging : bool = False ) -> None :
137
+ def __init__ (
138
+ self ,
139
+ motor_pin : DigitalInOut ,
140
+ port : UART ,
141
+ baudrate : int = 115200 ,
142
+ timeout : float = 1 ,
143
+ logging : bool = False ,
144
+ ) -> None :
136
145
"""Initialize RPLidar object for communicating with the sensor.
137
146
138
147
Parameters
@@ -224,7 +233,7 @@ def start_motor(self) -> None:
224
233
self .set_pwm (DEFAULT_MOTOR_PWM )
225
234
self .motor_running = True
226
235
227
- def stop_motor (self ) > None :
236
+ def stop_motor (self ) - > None :
228
237
"""Stops sensor motor"""
229
238
self .log ("info" , "Stopping motor" )
230
239
# For A2
@@ -402,7 +411,9 @@ def reset(self) -> None:
402
411
time .sleep (0.002 )
403
412
self .clear_input ()
404
413
405
- def iter_measurements (self , max_buf_meas : int = 500 , scan_type : int = SCAN_TYPE_NORMAL ) -> Iterator [Tuple [bool , Optional [int ], float , float ]]:
414
+ def iter_measurements (
415
+ self , max_buf_meas : int = 500 , scan_type : int = SCAN_TYPE_NORMAL
416
+ ) -> Iterator [Tuple [bool , Optional [int ], float , float ]]:
406
417
"""Iterate over measurements. Note that consumer must be fast enough,
407
418
otherwise data will be accumulated inside buffer and consumer will get
408
419
data with increasing lag.
@@ -488,7 +499,9 @@ def iter_measurements(self, max_buf_meas: int = 500, scan_type: int = SCAN_TYPE_
488
499
self .express_frame ,
489
500
)
490
501
491
- def iter_measurments (self , max_buf_meas : int = 500 ) -> Iterator [Tuple [bool , int , float , float ]]:
502
+ def iter_measurments (
503
+ self , max_buf_meas : int = 500
504
+ ) -> Iterator [Tuple [bool , int , float , float ]]:
492
505
"""For compatibility, this method wraps `iter_measurements`"""
493
506
warnings .warn (
494
507
"The method `iter_measurments` has been renamed "
@@ -497,7 +510,9 @@ def iter_measurments(self, max_buf_meas: int = 500) -> Iterator[Tuple[bool, int,
497
510
)
498
511
self .iter_measurements (max_buf_meas = max_buf_meas )
499
512
500
- def iter_scans (self , max_buf_meas : int = 500 , min_len : int = 5 ) -> List [int , float , float ]:
513
+ def iter_scans (
514
+ self , max_buf_meas : int = 500 , min_len : int = 5
515
+ ) -> List [int , float , float ]:
501
516
"""Iterate over scans. Note that consumer must be fast enough,
502
517
otherwise data will be accumulated inside buffer and consumer will get
503
518
data with increasing lag.
0 commit comments