Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BNO080 - problem to obtain yaw, pitch and roll

    BNO080 - problem to obtain yaw, pitch and roll

    GMarco_Utech12
    Established Member

    Hi,

    I have a problem with the BNO80 sensor to obtain yaw, pitch and roll.

    With this buffer 'cargo':
    0x17 0x80 0x03 0xAF 0xFB 0x19 0x00 0x00 0x00 0x05 0x0B 0x00 0x00 0xC6 0xFE 0xB0 0x01 0x29 0x3A 0xA2 0x1A 0x44 0x32

    I have obtain this results:

    I processing the cargo buffer to obtain the quaternions :
    q1 = ( ( ( int16_t ) cargo [ 14 ] << 8 ) | cargo [ 13 ] ) ;
    q2 = ( ( ( int16_t ) cargo [ 16 ] << 8 ) | cargo [ 15 ] ) ;
    q3 = ( ( ( int16_t ) cargo [ 18 ] << 8 ) | cargo [ 17 ] ) ;
    q0 = ( ( ( int16_t ) cargo [ 20 ] << 8 ) | cargo [ 19 ] ) ;

    #define QP14 0.0000610352f

    q0 *= QP14 ;
    q1 *= QP14 ;
    q2 *= QP14 ;
    q3 *= QP14 ;

    Results:
    q1 = 3.9808
    q2 = 0.0263
    q3 = 0.9087
    q0 = 0.4161

    To obtain yaw, pitch and roll i have applied this conversions :
    tmp_yaw = atan2 ( ( q1 * q2 + q0 * q3 ) , ( ( q0 * q0 + q1 * q1 ) - 0.5f ) ) ;
    tmp_pitch = -asin ( 2.0f * ( q1 * q3 - q0 * q2 ) ) ;
    tmp_roll = atan2 ( ( q0 * q1 + q2 * q3 ) , ( ( q0 * q0 + q3 * q3 ) - 0.5f ) ) ;

    Results:
    tmp_yaw = 0.0311
    tmp_pitch = 0
    tmp_roll = 1.2821

    I have convert this variables in degrees:
    pitch = tmp_pitch * ( 180.0 / M_PI ) ;
    yaw = tmp_yaw * ( 180.0 / M_PI ) ;
    roll = tmp_roll * ( 180.0 / M_PI ) ;

    Results:
    pitch = 0
    yaw = 1.78
    roll = 73.46

    These results are in degrees, it are not real because the BNO080 sensor is stopped. Where is the problem ? It's urgent !

    Thanks you!

    Regards,

    1 REPLY 1

    handytech
    Community Moderator
    Community Moderator

    BNO080/085 are programmed, sold, and supported by Hillcrest Labs. Please refer to them or your local sales channel for support for these products.

    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