سؤال

I'm currently working on a project that is supposed to represent data collected from gyroscope as a simple 3d graph, but what I wrote doesn't quite work - I simply integrated axes and then rotated the object.

Been looking for a solution and found something called rotation matrix, but I don't quite understand how it works - guess I need to take start angles [0,0,0] and convert them into such matrix, then take gyro data [yaw,pitch,roll] and convert them into similar matrix, multiply them and calculate new angles based on this new matrix? And repeat this every time I get new package of gyro data using previous matrix as 'base'?

Did I get it right? What I need is how to rotate object that's already rotated, are there any resources about on this subject somewhere? Been looking for '3d rotation matrix' but not quite what I've been looking for...

هل كانت مفيدة؟

المحلول

A tutorial on rotation matrices, as well as the integration you need is described in the

Direction Cosine Matrix IMU: Theory

manuscript.

Long story short, you cannot "simply integrate the axes and then rotate the object", unfortunately it's more sophisticated than that. :( Don't worry though, the manuscript tells you step-by-step what to do.

Euler angles (aka roll, pitch and yaw) are evil, they screw up the stability of your app, see for example

They are not useful for interpolation either. Just use rotation matrices and you will be happy you did.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top