Update hexapod.py

master
Zhengyu Peng 3 years ago
parent caa6ccf1be
commit 267ac69a1a

@ -291,15 +291,15 @@ class Hexapod(Thread):
def run(self): def run(self):
while True: while True:
if self.current_motion is None: # if self.current_motion is None:
try: try:
cmd_string = self.cmd_queue.get(block=False) cmd_string = self.cmd_queue.get(block=False)
print(cmd_string) print(cmd_string)
except Empty: except Empty:
time.sleep(self.interval) time.sleep(self.interval)
pass pass
else: else:
self.cmd_handler(cmd_string) self.cmd_handler(cmd_string)
if self.current_motion['type'] == 'motion': if self.current_motion['type'] == 'motion':
self.motion(self.current_motion['coord']) self.motion(self.current_motion['coord'])

Loading…
Cancel
Save