10-20-2022 06:37 PM
We are performing some tests on the BHI260AP shuttle board and driving it using the provided driver on GitHub repo on our custom MCU board: https://github.com/BoschSensortec/BHY2-Sensor-API
In our application we require to mount the sensor vertically; however, using the available remapping function for physical acc/gyro sensors as follows:
orient_matrix.c[0] = 0; orient_matrix.c[1] = -1; orient_matrix.c[2] = 0;
orient_matrix.c[3] = 0; orient_matrix.c[4] = 0; orient_matrix.c[5] = -1;
orient_matrix.c[6] = 1; orient_matrix.c[7] = 0; orient_matrix.c[8] = 0;
rslt += bhy2_set_orientation_matrix(1, orient_matrix, &bhy2);
rslt += bhy2_set_orientation_matrix(3, orient_matrix, &bhy2);
leads to incorrect values for virtual sensors: BHY2_SENSOR_ID_ACC, BHY2_SENSOR_ID_GYRO, and BHY2_SENSOR_ID_GAMERV. It passes those two functions without error though.
Mounting the sensor in either of the 8 orientations shown in Figure 35 of the datasheet provides expected values. Hence, I was wondering if our vertical axes remapping was wrong or if vertical mounting is not possible with this sensor at all !!!!
Solved! Go to Solution.
10-26-2022 07:38 AM
Hi soroush,
Could you provide your sensor placement and target coordinate system for your device.
This is a example:
10-26-2022 05:39 PM
Hi BSTRobin,
Here is our desired mounting orientation (T for target, S for sensor):
11-01-2022 07:03 AM
Hi soroush,
For your sensor placement and target device coordinate system, you can refer the following code to do the axis remap if you only used 6 axis.
struct bhy2_orient_matrix acc_matrix = {0,-1,0,0,0,-1,1,0,0};
struct bhy2_orient_matrix gyro_matrix = {0,-1,0,0,0,-1,1,0,0};
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_ACC, acc_matrix, dev);
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_GYRO, gyro_matrix, dev);
11-01-2022 02:56 PM
Hey BSTRobin,
That is almost the same code we used and shared in the first post, except we use addresses of physical acc and gyro, 1 and 3 respectively, instead of virtual sensors. regardless of that, it leads to the same result.