Berry IMU at 90

Home Forums Forums Technical Support for BerryIMU Berry IMU at 90

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7568
    bepeho
    Participant

    Hi,

    My GPS-IMU feeds my rpi3 with correct information. The IMU sits on the RPI3.

    However, I need  to install the RPI3 at  90°.

    X values are reading ~ -90°, wich is fine, but Y values are incorrect.

    Below is an extract of “gyro_accelerometer_tutorial01_angles”

    Loop Time 20 GyroX 182.194 AccXangle -95.571 CFangleX -95.277 GyroY -2464.163 AccYangle 143.785 CFangleY 141.763

    Could you please advise for a way to obtain a correct  Y value when the IMU is  neither on “the correct way” nor  “upside down”.

     

    Thank you very much.

    Patrice

    #7571
    Mark Williams
    Keymaster

    change this;
    AccYangle = (float) (atan2(accRaw[2],accRaw[0])+M_PI)*RAD_TO_DEG;
    to this
    AccYangle = (float) (atan2(accRaw[1],-accRaw[0])+M_PI)*RAD_TO_DEG;

    comment out these lines

    //              if (AccYangle > 90)
    //                              AccYangle -= (float)270;
    //              else

    and just leave;
    AccYangle -= (float)90;

    Mark --OzzMaker.com --

    #7572
    bepeho
    Participant

    Perfect.

    Thank you very much for your quick support.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…