cancel
Showing results for 
Search instead for 
Did you mean: 

AppMEMS#8b: The X-CUBE-MEMS1 libraries in detail - MotionEC functions

Eleon BORLINI
ST Employee

--- More details on MotionEC library ---

As described in the previous post, the MotionEC library acquires data from the accelerometer and magnetometer and provides information about the device orientation and movement status based on data from a device.

The central function that runs the E-Compass algorithm (accelerometer and magnetometer data fusion) is the following one:

void MotionEC_Run(MEC_input_t *data_in, MEC_output_t *data_out)

where the input data are:

  • acc[3] is an array of accelerometer data in ENU convention, measured in g
  • mag[3] is an array of magnetometer calibrated data in ENU convention, measured in μT/50
  • deltatime s is the delta time (i.e., time delay between old and new data set) measured in s

and the output data are:

  • quaternion[4] is array containing quaternion, representing the 3D-angular orientation of the device in the space; order of elements is: X, Y, Z, W, with always positive element W
  • euler[3] is an array of Euler angles, representing the 3D-angular orientation of the device in space; the order of the elements is: yaw, pitch, roll, measured in deg
  • i_gyro[3] is an array of angular rates, representing a virtual gyroscope sensor, measured in dps
  • gravity[3] is an array of accelerations, representing the gravity vector, measured in g
  • linear[3] is an array of acceleration,  representing the device linear acceleration, measured in g

See below an example of the output of MotionEC library in Unicleo-GUI framework �?�

1 REPLY 1
Eleon BORLINI
ST Employee

0690X000009YueGQAS.png