MPU6050 DMP Example - Packet Size Issue


hi everyone,

i using jeff rowberg i2cdev library access mpu6050. running dmp6 example sketch read yaw, pitch , roll (https://github.com/jrowberg/i2cdevlib/blob/master/arduino/mpu6050/examples/mpu6050_dmp6/mpu6050_dmp6.ino).

i wondering in following code 42 byte packet read:

code: [select]

else if (mpuintstatus & 0x02) {
        // wait correct available data length, should short wait
        while (fifocount < packetsize) fifocount = mpu.getfifocount();

        // read packet fifo
        mpu.getfifobytes(fifobuffer, packetsize);
       
        // track fifo count here in case there > 1 packet available
        // (this lets read more without waiting interrupt)
        fifocount -= packetsize;


is possible replace line

mpu.getfifobytes(fifobuffer, packetsize);

with this

mpu.getfifobytes(fifobuffer, packetsize-28);


because quaternions present in first 14 bytes being used calculate ypr. rest contains raw accel , raw gyro readings don't need.

thanks in advance.


hi everyone,

i using jeff rowberg i2cdev library access mpu6050. running dmp6 example sketch read yaw, pitch , roll (https://github.com/jrowberg/i2cdevlib/blob/master/arduino/mpu6050/examples/mpu6050_dmp6/mpu6050_dmp6.ino).

i wondering in following code 42 byte packet read:

code: [select]

else if (mpuintstatus & 0x02) {
        // wait correct available data length, should short wait
        while (fifocount < packetsize) fifocount = mpu.getfifocount();

        // read packet fifo
        mpu.getfifobytes(fifobuffer, packetsize);
        
        // track fifo count here in case there > 1 packet available
        // (this lets read more without waiting interrupt)
        fifocount -= packetsize;


is possible replace line

mpu.getfifobytes(fifobuffer, packetsize);

with this

mpu.getfifobytes(fifobuffer, packetsize-28);


because quaternions present in first 14 bytes being used calculate ypr. rest contains raw accel , raw gyro readings don't need.

thanks in advance.
you may able collect 14 bytes , trigger reset discard remaining bytes:

code: [select]
mpu.resetfifo();// clear buffer , start on discard remaining bytes.

you have retrieve 48 bytes or get need , reset buffer discard remaining bytes in fifo buffer.

modification of fifo buffer packet size require modify compiled program loading mpu6050.  (i wish find source code this) see line : 89 in file mpu6050_6axis_motionapps20.h
quote
/* source invensense motionapps v2 demo code. original source is
 * unavailable, unless happen amazing decompiling binary by
 * hand (in case, please contact me, , i'm totally serious).
 *
 * also, i'd offer many, many noah zerkin of the
 * dmp reverse-engineering did make bit of wizardry
 * possible.
 */
packetsize = 42; referenced in mpu6050_6axis_motionapps20.h line 527 
see line 120 fifo buffer structure

the compiled binary code loaded mpu6050 starts on line 133 

let know if find way change fifo buffer structure

z


Arduino Forum > Using Arduino > Sensors > MPU6050 DMP Example - Packet Size Issue


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor