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/multirotor_att_control/multirotor_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/multirotor_att_control/multirotor_att_control_main.c')
-rw-r--r-- | apps/multirotor_att_control/multirotor_att_control_main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/apps/multirotor_att_control/multirotor_att_control_main.c index f184859a3..1b03e8c22 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -253,7 +253,20 @@ mc_thread_main(int argc, char *argv[]) param_get(failsafe_throttle_handle, &failsafe_throttle); att_sp.roll_body = 0.0f; att_sp.pitch_body = 0.0f; - att_sp.thrust = failsafe_throttle; + + /* + * Only go to failsafe throttle if last known throttle was + * high enough to create some lift to make hovering state likely. + * + * This is to prevent that someone landing, but not disarming his + * multicopter (throttle = 0) does not make it jump up in the air + * if shutting down his remote. + */ + if (isfinite(manual.throttle) && manual.throttle > 0.2f) { + att_sp.thrust = failsafe_throttle; + } else { + att_sp.thrust = 0.0f; + } /* keep current yaw, do not attempt to go to north orientation, * since if the pilot regains RC control, he will be lost regarding |