|
|
|
@ -105,7 +105,11 @@ void AP_InertialSensor_Backend::_rotate_and_correct_accel(uint8_t instance, Vect
@@ -105,7 +105,11 @@ void AP_InertialSensor_Backend::_rotate_and_correct_accel(uint8_t instance, Vect
|
|
|
|
|
accel.z *= accel_scale.z; |
|
|
|
|
|
|
|
|
|
// rotate to body frame
|
|
|
|
|
accel.rotate(_imu._board_orientation); |
|
|
|
|
if (_imu._board_orientation == ROTATION_CUSTOM && _imu._custom_rotation) { |
|
|
|
|
accel = *_imu._custom_rotation * accel; |
|
|
|
|
} else { |
|
|
|
|
accel.rotate(_imu._board_orientation); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AP_InertialSensor_Backend::_rotate_and_correct_gyro(uint8_t instance, Vector3f &gyro)
|
|
|
|
@ -116,7 +120,11 @@ void AP_InertialSensor_Backend::_rotate_and_correct_gyro(uint8_t instance, Vecto
@@ -116,7 +120,11 @@ void AP_InertialSensor_Backend::_rotate_and_correct_gyro(uint8_t instance, Vecto
|
|
|
|
|
// gyro calibration is always assumed to have been done in sensor frame
|
|
|
|
|
gyro -= _imu._gyro_offset[instance]; |
|
|
|
|
|
|
|
|
|
gyro.rotate(_imu._board_orientation); |
|
|
|
|
if (_imu._board_orientation == ROTATION_CUSTOM && _imu._custom_rotation) { |
|
|
|
|
gyro = *_imu._custom_rotation * gyro; |
|
|
|
|
} else { |
|
|
|
|
gyro.rotate(_imu._board_orientation); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|