diff options
author | Julian Oes <joes@student.ethz.ch> | 2012-11-07 10:56:25 -0800 |
---|---|---|
committer | Julian Oes <joes@student.ethz.ch> | 2012-11-07 10:56:25 -0800 |
commit | 25ed791b7016cbbcd2dfeac8b62461733bd5a26e (patch) | |
tree | a9f026e28b9ffc0f2a55c75f2c967adcea3a0f34 /apps/multirotor_att_control/multirotor_att_control_main.c | |
parent | 5995240a078828a3de41aea6ad03aa0cb3952613 (diff) | |
download | px4-firmware-25ed791b7016cbbcd2dfeac8b62461733bd5a26e.tar.gz px4-firmware-25ed791b7016cbbcd2dfeac8b62461733bd5a26e.tar.bz2 px4-firmware-25ed791b7016cbbcd2dfeac8b62461733bd5a26e.zip |
Forgot to comment
Diffstat (limited to 'apps/multirotor_att_control/multirotor_att_control_main.c')
-rw-r--r-- | apps/multirotor_att_control/multirotor_att_control_main.c | 5 |
1 files changed, 4 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 78ea63018..951840ab1 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -73,7 +73,7 @@ #include "multirotor_attitude_control.h" #include "multirotor_rate_control.h" -PARAM_DEFINE_FLOAT(MC_RCLOSS_THROT, 0.0f); +PARAM_DEFINE_FLOAT(MC_RCLOSS_THROT, 0.0f); // This defines the throttle when the RC signal is lost. __EXPORT int multirotor_att_control_main(int argc, char *argv[]); @@ -145,6 +145,7 @@ mc_thread_main(int argc, char *argv[]) bool flag_system_armed = false; bool man_yaw_zero_once = false; + /* prepare the handle for the failsafe throttle */ param_t failsafe_throttle_handle = param_find("MC_RCLOSS_THROT"); float failsafe_throttle = 0.0f; @@ -233,7 +234,9 @@ mc_thread_main(int argc, char *argv[]) } att_sp.thrust = manual.throttle; + /* if the RC signal is lost, try to stay level and go slowly back down to ground */ if(state.rc_signal_lost) { + /* the failsafe throttle is stored as a parameter, as it depends on the copter and the payload */ param_get(failsafe_throttle_handle, &failsafe_throttle); att_sp.roll_body = 0.0f; att_sp.pitch_body = 0.0f; |