diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-01-20 10:26:14 +0100 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-01-20 10:26:14 +0100 |
commit | f4edb448dd77088d12a1d37468014e1f21a97ad7 (patch) | |
tree | 8e632a2842ee3cf9f06e43d6c290a69f33286375 | |
parent | d811b0f0dab95949cc03428379555f0f4d1806e2 (diff) | |
download | px4-firmware-f4edb448dd77088d12a1d37468014e1f21a97ad7.tar.gz px4-firmware-f4edb448dd77088d12a1d37468014e1f21a97ad7.tar.bz2 px4-firmware-f4edb448dd77088d12a1d37468014e1f21a97ad7.zip |
mc_att_control: code style fixed
-rw-r--r-- | src/modules/mc_att_control/mc_att_control_main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 20c7f8859..44a3b2755 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -642,6 +642,7 @@ MulticopterAttitudeControl::task_main() /* update integral */ for (int i = 0; i < 3; i++) { float rate_i = rates_int(i) + _K_rate_i(i) * rates_err(i) * dt; + if (isfinite(rate_i)) { if (rate_i > -RATES_I_LIMIT && rate_i < RATES_I_LIMIT && control(i) > -RATES_I_LIMIT && control(i) < RATES_I_LIMIT) { rates_int(i) = rate_i; @@ -670,6 +671,7 @@ MulticopterAttitudeControl::task_main() _actuators.control[2] = (isfinite(control(2))) ? control(2) : 0.0f; _actuators.control[3] = (isfinite(_rates_sp.thrust)) ? _rates_sp.thrust : 0.0f; _actuators.timestamp = hrt_absolute_time(); + } else { /* controller disabled, publish zero attitude controls */ _actuators.control[0] = 0.0f; |