From 25ed791b7016cbbcd2dfeac8b62461733bd5a26e Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 7 Nov 2012 10:56:25 -0800 Subject: Forgot to comment --- apps/multirotor_att_control/multirotor_att_control_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/multirotor_att_control/multirotor_att_control_main.c') 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; -- cgit v1.2.3