Hi, I'm really new to Invensense, but I need to get accelerometer, gyroscope and magnetometer readings (not as much magnetometer, but would be helpful), and I'm not sure how to use the datalogging capabilities within the MotionFit SDK 5.1. I've gotten the teapot demo to work, but being new to the CCS environment, I'm really not sure how to access or use this. Any help is greatly appreciated.
Thanks!
- Log in to post comments
phpbb Topic ID
16209
Re: Re: Raw data logging
you can do raw-data-logging in the window. there are two kinds of teapot demo. if you use the teapot of the python . you can do raw-data-logging in the command window using some command provided by ModtionFit SDK(Teapot Application).
first step: comman window of some Window OS(Window Key + R and write "cmd" then the command window would open)
==> c:ca-sdk>python eMPL-client.py 7 for viewing raw-data in the command window
or c:ca-sdk>python eMPL-client.py 7 > log_file_name.txt for logging (7 is com port number for bluetooth, this depends on your pc environments)
second step: you should write the following command in the focus of teapot application for logging
"inva" ==> acceleration data
"invg" ==> gyroscope data
"invc" ==> compass data
"invf" ==> dmp on
you could find another command in the document or comments in the source
=======================================================
there is another way to log raw-data using CCS(Come Composer Studio)
first you should modify MotionFit SDK Source.
In my case, I modified function "read_from_mpl()"
which is used for sending data to PC Application by Bluetooth
I subtituted those printing souce for accel or gyro with function "MPL_LOGI" to log data. but in orger to get the device Units(g or degree/s) you should divide them by 65536 because MotionFit SDK output is ADC output * Full scale *2. (Python Application do this) and now then you could get raw data in the command window after you write the modified binary to the development kit board using CCS.
another way is that you could write the logging code after the fuction of dmp_read_fifo or mpu_read_fifo.
keep in mind that those data is ADC raw output
in order to get the Physical Units(g or degree/s)
you should multiply those data by full scale value and divide result by 32768.
example:
for acceleration, long accel[3];
MPL_LOGI(" %7.3f %7.3f %7.3frn", accel[1]*2/32768.f, -accel[0]*2/32768.f, accel[2]*2/32768.f);
for gyro
MPL_LOGI(" %9.5f %9.5f %9.5frn", gyro[1]*2000/32768.f, -gyro[0]*2000/32768.f, gyro[2]*2000/32768.f);
of course this need writing the modified binary to the development kit board using CCS.
i hope this would be helpful for you.
Re: Re: Raw data logging
I used the Command prompt application and just saved my results in a .csv file so it was compatible with Excel and a lot of other programs.
Thanks so much!!