02-06-2024 02:22 PM
Hi,
I've got the wrist jiggle/shake feature working succesfully on the BMI270, however I noticed that it only seems to detect the gesture when the device is upright, ie the Z axis of the chip is facing up. So rotating the chip onto it's side (X axis lines up with gravity) and performing the same gesture, it does not trigger. I saw this behaviour but I could not find much about it in documentation.
That's fine but I would like to swap the axis so that the gesture works when the X axis is pointing up with gravity as the chip is oriented like this in our design.
I tried to modify the GEN_SET_1 features register but when I do this, the gesture no longer works, and also the internal status register does not log any issues with axis remapping. here is a snippet from my driver when I am trying to remap the axis after initiatlizing the feature:
02-06-2024 03:07 PM
Hi john20394
BMI270 sensor API on github(https://github.com/boschsensortec/BMI270-Sensor-API) had provided interface for mapping the physical coordinates of sensors to the target coordinates.
struct bmi2_remap remapped_axis;
rslt = bmi2_get_remap_axes(&remapped_axis, dev);
if(rslt != BMI2_OK)
{
PDEBUG("bmi270 org_axis: x=%02X, y=%02X, z=%02X\r\n", remapped_axis.x, remapped_axis.y, remapped_axis.z);
}
remapped_axis.x = BMI2_X;
remapped_axis.y = BMI2_Y;
remapped_axis.z = BMI2_NEG_Z;
rslt = bmi2_set_remap_axes(&remapped_axis, dev);
if(rslt != BMI2_OK)
{
PDEBUG("bmi270 remapped axis failed\r\n");
}
Usually, before using these gestures, you need to first perform axis mapping based on the placement of sensors on the structure and the target coordinates.