File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -363,16 +363,16 @@ def _get_servo_version(id_num):
363363 ret3 = self .get_servo_addr_16 (id_num , 0x0803 )
364364
365365 code = 0
366- if ret1 [0 ] in [0 , 1 , 2 ] and len (ret1 ) > 1 and ret1 [ 1 ] < 1000 :
367- versions [0 ] = ret1 [1 ]
366+ if ret1 [0 ] in [0 , 1 , 2 ] and len (ret1 ) > 1 :
367+ versions [0 ] = ret1 [1 ] if abs ( ret1 [ 1 ]) < 1000 else 0
368368 else :
369369 code = ret1 [0 ]
370- if ret2 [0 ] in [0 , 1 , 2 ] and len (ret2 ) > 1 and ret2 [ 1 ] < 1000 :
371- versions [1 ] = ret2 [1 ]
370+ if ret2 [0 ] in [0 , 1 , 2 ] and len (ret2 ) > 1 :
371+ versions [1 ] = ret2 [1 ] if abs ( ret2 [ 1 ]) < 1000 else 0
372372 else :
373373 code = ret2 [0 ]
374- if ret3 [0 ] in [0 , 1 , 2 ] and len (ret3 ) > 1 and ret3 [ 1 ] < 1000 :
375- versions [2 ] = ret3 [1 ]
374+ if ret3 [0 ] in [0 , 1 , 2 ] and len (ret3 ) > 1 :
375+ versions [2 ] = ret3 [1 ] if abs ( ret3 [ 1 ]) < 1000 else 0
376376 else :
377377 code = ret3 [0 ]
378378 # if code != 0:
You can’t perform that action at this time.
0 commit comments