Skip to content

Commit 3dfee9f

Browse files
committed
fix: timeout in millis
1 parent 2081d21 commit 3dfee9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arduino_alvik/arduino_alvik.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def rotate(self, angle: float, unit: str = 'deg', blocking: bool = True):
283283
self._packeter.packetC1F(ord('R'), angle)
284284
uart.write(self._packeter.msg[0:self._packeter.msg_size])
285285
if blocking:
286-
self._TIMEOUT = (angle/MOTOR_CONTROL_DEG_S)*1.05
286+
self._TIMEOUT = 1000*(angle/MOTOR_CONTROL_DEG_S)*1.05
287287
self._wait_for_target(timeout=(angle/MOTOR_CONTROL_DEG_S)*1.05)
288288

289289
def move(self, distance: float, unit: str = 'cm', blocking: bool = True):
@@ -300,7 +300,7 @@ def move(self, distance: float, unit: str = 'cm', blocking: bool = True):
300300
self._packeter.packetC1F(ord('G'), distance)
301301
uart.write(self._packeter.msg[0:self._packeter.msg_size])
302302
if blocking:
303-
self._TIMEOUT = (distance/MOTOR_CONTROL_MM_S)*1.05
303+
self._TIMEOUT = 1000*(distance/MOTOR_CONTROL_MM_S)*1.05
304304
self._wait_for_target(timeout=(distance/MOTOR_CONTROL_MM_S)*1.05)
305305

306306
def stop(self):

0 commit comments

Comments
 (0)