Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BSXLite libraryinput_t units

    BSXLite libraryinput_t units

    mga
    New Poster

    Hi,

    we have a recording of 9 axis data acquired using a BMI160 in corresponding units (rad/s for gyro, g for acceleration, T for magnetic field). We'd now like to fuse the existing data using BSXLite in a non-realtime manner (yes, it is very unusual use-case). To do that, we need to convert the 9 axis data back to raw integer format, but it is not clear how. We can configure the BSXLite for acccelerometer by:

     

    bsx_set_accrange(1); // BSX_ACCRANGE_4G

     

    and then convert accelerometer recoding

     

    acc_=acc/4.0*(2^15)

     

    For the gyro, this would be done analogously

     

    bsx_get_gyrorange(&init_status); // 500 Dps
    gyro_=rad2deg(gyro)/500*2^15

     

     but the linker reports "undefined reference to `bsx_get_gyrorange', 'bsx_set_gyrorange'" although these signatures exists in BsxFusionLibrary.h.

    For the magnetometer, the range doesn't seem to be configurable at all. It is not clear what the units are? I'm guessing

     

    mag_=mag/±2500μT*2^15

     

    I presume that these parameters are determined by the "ConfigStrings", but we couldn't find their meaning in the library guide pdf. Could you provide some help on how to determine the sensing ranges for all modalities?

    1 REPLY 1

    o_o
    Contributor
    The `bsx_get_gyrorange' and 'bsx_set_gyrorange' are undefined because BSXLite uses the same include file as BSX (non-Lite). In any case, The gyro range is fixed to 500dps in BSXLite. This is outlined in the BSXlite library integration guide.

    Your calculations are correct at first glance.

    However for magnetometer, the input data is the same scaling as the BMM150 API when using integer compensation formulae, that is 16 * microtesla.
    https://github.com/BoschSensortec/BMM150-Sensor-API/blob/3ee41a2285823374fca80c258e93c031caa9715c/bm...

    o_o
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist