This commit is contained in:
Dream
2024-08-07 17:00:29 +08:00
parent e8e96d9a97
commit 5254a4ecbe
5 changed files with 215 additions and 18 deletions

35
test.py Normal file
View File

@ -0,0 +1,35 @@
import asyncio
async def send_update_command():
while True:
command = "update_position_command\n"
print('command')
await asyncio.sleep(2)
#await writer.drain()
await asyncio.sleep(1)
async def query_robot_status():
while True:
command = "query_status_command\n"
print('status')
await asyncio.sleep(1)
# await writer.drain()
#feedback = await reader.read(1024)
#if feedback:
# print("Received feedback:", feedback.decode())
await asyncio.sleep(2)
async def main():
#reader, writer = await asyncio.open_connection('f', 'f')
await asyncio.gather(
send_update_command(),
query_robot_status()
)
print('UI')
asyncio.run(main())