e32_client graceful exit
This commit is contained in:
parent
95ea8a4155
commit
39d6298c0d
0
e32_client/requirements.txt
Normal file
0
e32_client/requirements.txt
Normal file
@ -38,7 +38,7 @@ class UGVComms(E32):
|
||||
|
||||
|
||||
def __rx_thread_entry(ugv: UGVComms):
|
||||
while True:
|
||||
while ugv.ser.is_open:
|
||||
try:
|
||||
msg = ugv.read_message()
|
||||
if msg is not None:
|
||||
@ -59,15 +59,19 @@ if __name__ == "__main__":
|
||||
# ugv.reset()
|
||||
cmd_id = 1
|
||||
time.sleep(0.2)
|
||||
while True:
|
||||
gmsg = messages.GroundMessage()
|
||||
gmsg.command.id = cmd_id
|
||||
gmsg.command.type = messages.DISABLE
|
||||
cmd_id += 1
|
||||
print("writing message: ", gmsg)
|
||||
ugv.write_message(gmsg)
|
||||
time.sleep(2.)
|
||||
try:
|
||||
while True:
|
||||
gmsg = messages.GroundMessage()
|
||||
gmsg.command.id = cmd_id
|
||||
gmsg.command.type = messages.DISABLE
|
||||
cmd_id += 1
|
||||
print("writing message: ", gmsg)
|
||||
ugv.write_message(gmsg)
|
||||
time.sleep(2.)
|
||||
except KeyboardInterrupt:
|
||||
print("exiting...")
|
||||
finally:
|
||||
ugv.ser.close()
|
||||
|
||||
rx_thread.In
|
||||
rx_thread.join()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user