Data acquisition from WiPy in real time
-
Hi, I'm using WiPy 2.0 with an IMU ( BNO055).
I need to acquire and save my data in real time from TWO IMU. I use a list and at the end of acquisition I save data in a file.txt in the sd card.fileIMU1 = open('/sd/dati_IMU1.txt', 'w') list_eul = [ ] temp = Timer.Chrono() temp.start() while 1: t = temp.read() if t <= sec : gc.collect() list_eul.append(lib_imu.get_euler_int() fileIMU1.write(repr(temp.read()) + '\t') time.sleep(0.2) else: fileIMU1.write( '\n' + repr(list_eul) + '\t') fileIMU1.close() del list_eul breakNow data were collected in RAM and so I have an issue of 'Memory allocation' because time of acquisition is long (from 10 s to 60 s).
Another big problem is that if I use two IMU it don't work at sample rate of 0.2 s but it change and it is about 0.4s. How can I impose a sample of 0.2 s with two IMU ?
How can I do this in another way?
Is it better reciving data in real time directly on my pc and then save it in a file? -
@vflorio94 said in Data acquisition from WiPy in real time:
two IMU it don't work at sample rate of 0.2 s
Maybe check the interface library. The pysense libraries for example contained some unnecessarily long waits. Check the datasheet.
-
@martinnn I don't use any interface library
-
@vflorio94
Well, where is lib_imu.get_euler_int() coming from?
Also, where do the 0.4 s come from? Did you do mesurements which part of the code takes how long? -
@martinnn lib_imu is a library that I wrote and in this function give only data from IMU and there aren't any delay.
if I wrote data immediately on a file.txt in SD card it employ 0,2 s so the sample became 0,4.
but if I collect data and insert them in a list to save data at the end of acquisition it gives me the error 'Memory allocation'.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login