So I am using an app which streams gyroscope and accelerometer data to a port to which I then can pick up this information in python. My questions is how can I create a live graph of data that I am receiving. I have provided the code that is given which picks up the data in python.
import socket, traceback
host = ''
port = 5555
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((host, port))
print("Success binding")
while 1:
message, address = s.recvfrom(8192)
messageString = message.decode("utf-8")
print(messageString)
This is the type of output that is continuous as its streaming.
0.29927522,0.30885202,9.651027,6.1086525E-4,6.1086525E-4,0.0036651916
0.28491,0.30166942,9.636662,0.0030543262,-0.0012217305,0.0
0.2705448,0.30885202,9.64145,0.0061086523,0.0012217305,0.0012217305
0.5650316,1.0414777,3.4261026,-0.18997909,0.012217305,-6.1086525E-4
I think the first 3 numbers are the accelerometer and the next 3 are the gyroscope
question from:
https://stackoverflow.com/questions/65929222/how-can-i-create-a-live-graph-in-python-of-data-that-i-am-streaming-from-a-phone 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…