diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-30 09:53:45 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-12-30 09:53:45 +0100 |
commit | 62a95bf8e6592b31ae7e84e53b654bc5e6b71cd1 (patch) | |
tree | 07d27e3f0c56bb34c2d505fdafcce4490bf1b17e /apps/fixedwing_att_control/fixedwing_att_control_main.c | |
parent | 0298714db53c44a28ab19d5ba01d70de28dd39b3 (diff) | |
download | px4-firmware-62a95bf8e6592b31ae7e84e53b654bc5e6b71cd1.tar.gz px4-firmware-62a95bf8e6592b31ae7e84e53b654bc5e6b71cd1.tar.bz2 px4-firmware-62a95bf8e6592b31ae7e84e53b654bc5e6b71cd1.zip |
Stabilization enabling / switching
Diffstat (limited to 'apps/fixedwing_att_control/fixedwing_att_control_main.c')
-rw-r--r-- | apps/fixedwing_att_control/fixedwing_att_control_main.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_main.c b/apps/fixedwing_att_control/fixedwing_att_control_main.c index cd479d40d..646deb62e 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_main.c +++ b/apps/fixedwing_att_control/fixedwing_att_control_main.c @@ -208,7 +208,13 @@ int fixedwing_att_control_thread_main(int argc, char *argv[]) att_sp.roll_body = 0.3f; att_sp.pitch_body = 0.0f; att_sp.yaw_body = 0; - att_sp.thrust = 0.4f; + + /* limit throttle to 60 % of last value */ + if (isfinite(manual_sp.throttle)) { + att_sp.thrust = 0.6f * manual_sp.throttle; + } else { + att_sp.thrust = 0.0f; + } // XXX disable yaw control, loiter @@ -250,7 +256,13 @@ int fixedwing_att_control_thread_main(int argc, char *argv[]) //param_get(failsafe_throttle_handle, &failsafe_throttle); att_sp.roll_body = 0.3f; att_sp.pitch_body = 0.0f; - att_sp.thrust = 0.4f; + + /* limit throttle to 60 % of last value */ + if (isfinite(manual_sp.throttle)) { + att_sp.thrust = 0.6f * manual_sp.throttle; + } else { + att_sp.thrust = 0.0f; + } att_sp.yaw_body = 0; // XXX disable yaw control, loiter |