|
|
|
@ -38,7 +38,7 @@ class UGVComms(E32):
@@ -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__":
@@ -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() |
|
|
|
|
|
|
|
|
|