AP_InertialSensor: fix order of accelerometer corrections

This commit is contained in:
Jonathan Challinger 2015-07-22 11:19:31 -07:00 committed by Andrew Tridgell
parent 562db11159
commit 3b480bd6ec
1 changed files with 3 additions and 3 deletions

View File

@ -17,15 +17,15 @@ void AP_InertialSensor_Backend::_rotate_and_correct_accel(uint8_t instance, Vect
offsets and scaling.
*/
// apply offsets
accel -= _imu._accel_offset[instance];
// apply scaling
const Vector3f &accel_scale = _imu._accel_scale[instance].get();
accel.x *= accel_scale.x;
accel.y *= accel_scale.y;
accel.z *= accel_scale.z;
// apply offsets
accel -= _imu._accel_offset[instance];
// rotate to body frame
accel.rotate(_imu._board_orientation);
}