[DK-20948]How should rotatin data be handled?

By kurokisnipponradcojp , 15 March 2024

Hello to all of you who are working hard to develop using motion sensors!

Using sensor-cli on DK-20948, we send en 3 and get data for INV_ICM20948_SENSOR_ORIENTATION.

However, when I reflect the above data to the CUBE, it does not display correctly.

I am having trouble understanding how to interpret this rotation data at all.

Can someone please enlighten me on this?

Thanks in advance.

Kuroki

mustafayildiri…

2 years ago

Hello Kuroki,

You need to understand a few concepts. For example, An angular frame is a representation of an object’s orientation in 3D space. It is commonly described using Euler angles or a quaternion. Please see http://en.wikipedia.org/wiki/Euler_angles, and http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation.

phpbb Post ID
45555

kurokisnipponradcojp

1 year 12 months ago

Hi MOD_Mustafa

Thank you for your response.

I was able to find from the source code how Orientation is handled in the FW of DK-20948.

It seems that the first value represents the azimuth angle and the other two represent Pitch,Roll.

I'm not too convinced about the behavior of the eMD cube, but I understand how the values are handled.

Thanks.

/** @brief Gets the 3 axis orientation value based on RV quaternion
* @param[out] orientation 3 components resulting orientation in Q16 in degrees
The x field is azimuth, the angle between the magnetic north direction and the y axis around the the z axis.
The y field is pitch, the rotation arounf x axis, positive when the z axis moves toward the y axis.
The z field is roll, the rotation arount the y axis, positive when the x axis moves toward the z axis.
* @param[in] quat9axis_3e 3 components input AGM-based quaternion in Q30
* @return 0 in case of success, -1 for any error
*/
int INV_EXPORT inv_icm20948_augmented_sensors_get_orientation(long orientation[3], const long quat9axis_3e[4]);

phpbb Post ID
45559
phpbb Topic ID
45551