diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-10-30 17:57:26 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-10-30 17:57:26 +0100 |
commit | 56a0f14b340e57abb8f8f6e41b335baa824c3c59 (patch) | |
tree | 94e2ff253fc34cf4534d510950b99101f26b451f /apps/multirotor_att_control/multirotor_att_control_main.c | |
parent | 12e1cf3710fa5e9b9b5dd7e0d55e952af9a473fb (diff) | |
download | px4-firmware-56a0f14b340e57abb8f8f6e41b335baa824c3c59.tar.gz px4-firmware-56a0f14b340e57abb8f8f6e41b335baa824c3c59.tar.bz2 px4-firmware-56a0f14b340e57abb8f8f6e41b335baa824c3c59.zip |
Minor last tweaks
Diffstat (limited to 'apps/multirotor_att_control/multirotor_att_control_main.c')
-rw-r--r-- | apps/multirotor_att_control/multirotor_att_control_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/apps/multirotor_att_control/multirotor_att_control_main.c index f2ef13e90..63c296f96 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -213,20 +213,17 @@ mc_thread_main(int argc, char *argv[]) state.flag_control_manual_enabled != flag_control_manual_enabled || state.flag_system_armed != flag_system_armed) { att_sp.yaw_body = att.yaw; - man_yaw_zero_once = false; } att_sp.roll_body = manual.roll; att_sp.pitch_body = manual.pitch; - if ((manual.yaw > -0.1f || 0.1f > manual.yaw)) { - man_yaw_zero_once = true; - } - /* only move setpoint if manual input is != 0 */ // XXX turn into param - if ((manual.yaw < -0.01f || 0.01f < manual.yaw) && man_yaw_zero_once) { + if ((manual.yaw < -0.01f || 0.01f < manual.yaw) && manual.throttle > 0.25f) { att_sp.yaw_body = att_sp.yaw_body + manual.yaw * 0.0025f; + } else if (manual.throttle <= 0.25f) { + att_sp.yaw_body = att.yaw; } att_sp.thrust = manual.throttle; att_sp.timestamp = hrt_absolute_time(); |