Simulating motion sensor MPU

H everyone,
i want to ask all of you an question about simulating.
After creating 2 segment (symbol for 2 sensor ) in processing as picture i attach below
If i want to view the motion of them, what data i need to have?
(I had roll, ritch, yaw)
Thanks so much!

Untitled.png

guide me?

Hi
usually the "data" you have depends on the sensor you are using.
Assuming that you have an MPU (a digital Motion Processor Unit) as you wrote in the "Subject" field,
the kind of data you might have on output depends on the MPU itself.
Basically they depends on the DOF (Degree Of Freedom) that the MPU has (usually 6 or 9).
Moreover, on the datasheet of the MPU (or on the board itself), it is reported a coordinate plane reporting
which is the direction of the x,y,z axes on the chip.
Usually the MPU send out raw datas, which must be manipulated to obtain the parametrizzation needed.
This can be done with some math or using an existing library (such as i2cdev: GitHub - jrowberg/i2cdevlib: I2C device library collection for AVR/Arduino or other C++-based MCUs).
This specific library has the opportunity to choose as output the data that suits our project at best.
The parametrizzation available to describe the orientation of a rigid body in 3-dimensional space are:

  • raw data
  • Euler's angle
  • Tait–Bryan angle
  • Yaw Pitch Roll (YPR)

Once that the parametrizzation is chosen (assuming that you have used the YPR representation) you have to "align" your MPU at the "segment" you need to move.
Once that this is done you only have to see your "segment" by which axes is represented on the coordinate system. With this you know if its movement is represented by the Yaw (z), the Pitch (y) or the Roll (x).

Therefore the data you need to pass to the Processing sketck depends on how you designed your system.

Hope this is helpfull

i have a questions need your help.
the raw data from MPU and Euler angle is get on inertial frame of bode frame?

The raw data is measured by the device which is attached to the body frame, so it is data with reference to the body frame.

You then need to process those raw readings to get a representation of the object orientation with respect to the reference frame.

You then need some way of visualising the data, if that is what you want to do. This is not practical on arduino itself. You send the data to a program on the PC which can display the picture.

when i calculate the euler angle, i must use rotation matrix by multiply 3 rotation matrix
and i think: Euler angle is calculated on inertial frame.
is it right?