You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prob wanna make the vectornav driver a separate standalone thing then shove it into here actually since we are growing our number of tasks a lot in here.
The text was updated successfully, but these errors were encountered:
importasynciofrommessage_pb2importSimpleMessageimportsocketasyncdefsend_message_over_udp(message, host='localhost', port=6000):
# Note: DGRAM socket is used for UDPsock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
loop=asyncio.get_running_loop()
# Make the socket non-blockingsock.setblocking(False)
# Send the messageawaitloop.sock_sendall(sock, message.SerializeToString())
sock.close()
asyncdefmain():
message=SimpleMessage(content="Hello, Receiver!")
awaitsend_message_over_udp(message)
if__name__=="__main__":
asyncio.run(main())
importasynciofrommessage_pb2importSimpleMessageimportsocketasyncdefreceive_message_over_udp(port=6000, buffer_size=1024):
# Note: DGRAM socket is used for UDPsock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('localhost', port))
# Make the socket non-blockingsock.setblocking(False)
loop=asyncio.get_running_loop()
# Wait for and receive the messagedata, _=awaitloop.sock_recv(sock, buffer_size)
sock.close()
message=SimpleMessage()
message.ParseFromString(data)
print(f"Received: {message.content}")
if__name__=="__main__":
asyncio.run(receive_message_over_udp())
integrate vectornav data receiving correctly.
prob wanna make the vectornav driver a separate standalone thing then shove it into here actually since we are growing our number of tasks a lot in here.
The text was updated successfully, but these errors were encountered: