Browse Source

AP_InertialSensor: rotate acccel/gyro for PXF

master
Andrew Tridgell 11 years ago
parent
commit
848b563fc3
  1. 4
      libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

4
libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

@ -295,6 +295,10 @@ bool AP_InertialSensor_MPU9250::update( void ) @@ -295,6 +295,10 @@ bool AP_InertialSensor_MPU9250::update( void )
_accel[0].rotate(_board_orientation);
_accel[0] *= MPU9250_ACCEL_SCALE_1G / _num_samples;
// rotate for bbone default
_accel[0].rotate(ROTATION_ROLL_180_YAW_90);
_gyro[0].rotate(ROTATION_ROLL_180_YAW_90);
Vector3f accel_scale = _accel_scale[0].get();
_accel[0].x *= accel_scale.x;
_accel[0].y *= accel_scale.y;

Loading…
Cancel
Save