Merge branch 'beta' into acro2

This commit is contained in:
Anton Babushkin
2014-02-01 11:27:41 +01:00
7 changed files with 86 additions and 38 deletions
@@ -512,14 +512,18 @@ MulticopterAttitudeControl::control_attitude(float dt)
//}
} else {
float yaw_dz_scaled = YAW_DEADZONE * _params.rc_scale(2);
if (_params.rc_scale(2) > 0.001f && fabs(_manual_control_sp.yaw) > yaw_dz_scaled) {
/* move yaw setpoint */
yaw_sp_move_rate = _manual_control_sp.yaw / _params.rc_scale(2);
if (_manual_control_sp.yaw > 0.0f) {
yaw_sp_move_rate -= YAW_DEADZONE;
} else {
yaw_sp_move_rate += YAW_DEADZONE;
}
yaw_sp_move_rate *= _params.rc_scale(2);
_v_att_sp.yaw_body = _wrap_pi(_v_att_sp.yaw_body + yaw_sp_move_rate * dt);
_v_att_sp.R_valid = false;
@@ -683,7 +687,7 @@ MulticopterAttitudeControl::control_attitude_rates(float dt)
float rate_i = _rates_int(i) + _params.rate_i(i) * rates_err(i) * dt;
if (isfinite(rate_i) && rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT &&
_att_control(i) > -RATES_I_LIMIT && _att_control(i) < RATES_I_LIMIT) {
_att_control(i) > -RATES_I_LIMIT && _att_control(i) < RATES_I_LIMIT) {
_rates_int(i) = rate_i;
}
}