Hi,
I'm trying to stream out accelerometer and gyro readings from UC3 eval board with the Inertial 2 daughter board. I have had no problem flashing the device with MotionApps UC3 project and reading the quat data over my serial port, but I am having trouble figuring out how to modify the MotionApps project to also send accel and gyro data.
Could anyone supply some code snippets or suggestions on how to implement this?
Bryan
- Log in to post comments
phpbb Topic ID
13341
Re: Re: Streaming Accel & Gyro Data?
The Functional Specification document explains the APIs that would allow you to do this.
MLGetGyrosFixed, MLGetGyrosFloat --> For Gyro Data
MLGetAccelsFixed, MLGetAccelsFload --> For Accel Data
Re: Re: Streaming Accel & Gyro Data?
Within the library files mlFIFO.h contains several APIs that can be used to send different data types to the FIFO. I suggest you start looking at around line 63.
Re: Re: Streaming Accel & Gyro Data?
I am also working on this, and I have the Accel and Gyro data (using the example program uc3_a3_xplained, but I was wondering if there is a way to access a time stamp? Also, I need to sample at a constant rate. Is there a way to set the sample rate?
Re: Re: Streaming Accel & Gyro Data?
To get a time stamp you can print the timer counter value: inv_get_tick_count().
You can change the sampling rate by changing the fifo rate with inv_set_fifo_rate(). This uses the 200/(n+1) formula.