06-22-2022 03:36 PM - edited 06-22-2022 07:04 PM
Hello,
I'm using a BHI260AB chip and I'd like to know the difference between the Rotation Vector and Orientation virtual sensors. I see that one is expressed in quaternions and the other in Euler angles. Both use a magnetometer (NDOF mode). I don't understand clearly what's the difference between both of them.
In my application, I need to use the BHI chip to measure some inclination angles (vertical respect to the horizon and horizontal respect to a reference orientation), those inclination angles are the angles formed by the orientation of the BHI chip and a fixed frame of reference on the inertial frame (a frame fixed to the Earth).
What would be the right virtual sensor to use for that purpose?
Thanks!
Solved! Go to Solution.
07-05-2022 08:32 AM
Hi btruden_henway,
I gave you a example, you can provide the information like this.
07-05-2022 03:19 PM
Hello BSTRobin,
Thank you for your repply.
Here's the picture of my device and the different coordinates (sensors and target device coordinate system):
Regards!
07-07-2022 09:46 AM
Hi btruden_henway,
For your sensor placement and target device coordinate system, you can refer the following code to do the axis remap.
struct bhy2_orient_matrix acc_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
struct bhy2_orient_matrix gyro_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
struct bhy2_orient_matrix mag_matrix = {1, 0, 0, 0, -1, 0, 0, 0, -1};
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_ACC, acc_matrix, dev);
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_GYRO, gyro_matrix, dev);
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_MAG, mag_matrix, dev);
07-12-2022 04:32 PM
Excellent, thanks