Lolu hlelo lokusebenza ithumela izilinganiso khukhwini izinzwa zakho inertial nge UDP njengoba CSV (lihlukaniswe ukhefana Izindinganiso) kukhompyutha kunethiwekhi yakho.
Lokhu uphendulela ifoni yakho ibe wireless inertial nesilinganiso unit (IMU).
The izinzwa ezilandelayo asekelwa:
- Accelerometer
- Gyroscope
- Magnetometer
Uma ifoni yakho ine bonke laba izinzwa, kuphela inzwa idatha ezitholakalayo ngocansi.
Isibonelo UDP iphakethe:
890,71558, 3, 0,076, 9,809, 0,565, 4, -0,559, 0,032, -0,134, 5, -21,660, -36,960, -28,140
Isitembu sesikhathi [sec], sensorid, x, y, z, sensorid, x, y, z, sensorid, x, y, z
Inzwa id:
3 - Accelerometer (m / s ^ 2)
4 - Gyroscope (Rad / s)
5 - Magnetometer (micro-Tesla UT)
Ungakwazi ukusebenzisa le app ngemuva.
A lengxoxo isixwayiso livela, uma kungukuthi uxhumeke kwinethiwekhi ye-WiFi.
In the isibonelo video, umfudlana is ngqo kusetshenzwe by a script MATLAB for Kalman Ukuhlunga. Kodwa kuphuma kuwe, yini ongayenza ne idatha.
With the Python script ezilandelayo ungakwazi wasithatha idatha emfudlaneni UDP khukhwini wakho:
# ------------------------------------------------- ------
ukungenisa izisekelo, 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 ((impi, port))
ngenkathi 1:
zama:
umlayezo, ikheli = s.recvfrom (8192)
ukuphrinta umlayezo
ngaphandle (KeyboardInterrupt, SystemExit):
ukukhulisa
ngaphandle:
traceback.print_exc ()
# ------------------------------------------------- ------
Kubuyekezwe ngo-
Sep 12, 2012