简体   繁体   English

为什么在teapotPacket []数组中没有传递索引2,3,6,7,10,11的“fifoBuffer”值?

[英]Why “fifoBuffer” values of indexes 2,3,6,7,10,11 are not passed in the teapotPacket[] array ?

I'm using the MPU6050 library by Jeff Rowberg. 我正在使用Jeff Rowberg的MPU6050库。 In the code, whole fifobuffer is not passed to the 'teapotPacket' array (for processing ,ie, graphics emulation). 在代码中,整个fifobuffer不会传递给'teapotPacket'数组(用于处理,即图形仿真)。 Why only certain indexes are passed in the 'teapotPacket' array ?(to be precise, only indexes given below are passed) 为什么只有某些索引在'teapotPacket'数组中传递?(确切地说,只传递下面给出的索引)

teapotPacket[2] = fifoBuffer[0];
teapotPacket[3] = fifoBuffer[1];
teapotPacket[4] = fifoBuffer[4];
teapotPacket[5] = fifoBuffer[5];
teapotPacket[6] = fifoBuffer[8];
teapotPacket[7] = fifoBuffer[9];
teapotPacket[8] = fifoBuffer[12];
teapotPacket[9] = fifoBuffer[13];

and please clarify one more thing, why the 'teapotPacket' array is initialized with the $ , hex numbers and '\\n' & '\\r' characters ? 请澄清一下,为什么'teapotPacket'数组用$,十六进制数字和'\\ n'&'\\ r'字符初始化?

uint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' };

Duplicate of Question : Why “fifoBuffer” values of indexes 2,3,6,7,10,11 are not passed in the teapotPacket[] array? 问题重复: 为什么在teapotPacket []数组中没有传递索引2,3,6,7,10,11的“fifoBuffer”值?

Quoting my answer again here for completeness: 再次引用我的答案以获得完整性:

In the code, while passing data to the Teapot library(for processing,ie, graphics emulation), whole fifobuffer is not passed. 在代码中,在将数据传递到Teapot库(用于处理,即图形仿真)时,不传递整个fifobuffer。 Why is that so ? 为什么会这样 ?

Digging deeper into the library code, I found out that its just a "InvenSense Teapot demo" format for displaying the quaternion values. 深入研究库代码,我发现它只是一个用于显示四元数值的“InvenSense Teapot demo”格式。

Why the teapotPacket[14] array is initialised with these weird hex numbers ? 为什么用这些奇怪的十六进制数字初始化teapotPacket [14]数组?

Its a packet structure format for InvenSense teapot, used for storing the sensor readings like quaternion values. 它是InvenSense茶壶的数据包结构格式,用于存储四元数值等传感器读数。

A little more information about : "Quaternion values" : 关于以下内容的更多信息:“四元数值”:

Quaternions is a number system that extends the complex numbers used for calculations involving three-dimensional rotations such as in three-dimensional computer graphics, computer vision, and crystallographic texture analysis. 四元数是一个数字系统,它扩展了用于涉及三维旋转的计算的复数,例如三维计算机图形,计算机视觉和晶体学纹理分析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM