Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BNO055 Sensorfusion Quaternion

    BNO055 Sensorfusion Quaternion

    Pvand2019
    Occasional Visitor

    I'm using the BNO055 Sensorfusion algorithm to get the orientation in Quaternion of an object in world space. Now I would like to create a local coordinate system by using the gravity vector and by get an acceleration vector in one plane only. Is it possible to calculate the gravity vector from the recieved Quaternion alone (since it is used in its algorithm)?

    1 REPLY 1

    kgoveas
    Community Moderator
    Community Moderator

    Hi Pvand2019,

    the general formulas are described below to get the gravity vector in the sensor frame (typically device/object frame).

    gravityVectorNED = [0 0 1];

    rotationNED2SF= conjugate(rotationVector)

    gravitySF = rotation NED2SF ∙ gravityVectorNED ∙ rotationNED2SF-1

    Since we are using unit quaternions for the rotations, the inverse of the rotationNED2SF is equal to the conjugate of the quaternion. The operator ∙ is defined as the quaternion multiplication.

    The final equation would be this:

    grav_x = 2*(rv_x *rv_z - rv_w * rv_y)

    grav_y = 2*(rv_y*rv_z + rv_w*rv_x)

    grav_z = rv_w*rv_w - rv_x*rv_x - rv_y*rv_y - rv_z* rv_z

    Hope this helps,

    Regards,

    kgoveas

    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