From 5995240a078828a3de41aea6ad03aa0cb3952613 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 7 Nov 2012 10:50:52 -0800 Subject: [PATCH] Failsafe throttle when RC is lost is now a parameter --- .../multirotor_att_control/multirotor_att_control_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/apps/multirotor_att_control/multirotor_att_control_main.c index bfa5e1b1f6..78ea630189 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -68,10 +68,13 @@ #include #include +#include #include "multirotor_attitude_control.h" #include "multirotor_rate_control.h" +PARAM_DEFINE_FLOAT(MC_RCLOSS_THROT, 0.0f); + __EXPORT int multirotor_att_control_main(int argc, char *argv[]); static bool thread_should_exit; @@ -142,6 +145,9 @@ mc_thread_main(int argc, char *argv[]) bool flag_system_armed = false; bool man_yaw_zero_once = false; + param_t failsafe_throttle_handle = param_find("MC_RCLOSS_THROT"); + float failsafe_throttle = 0.0f; + while (!thread_should_exit) { /* wait for a sensor update, check for exit condition every 500 ms */ @@ -228,10 +234,11 @@ mc_thread_main(int argc, char *argv[]) att_sp.thrust = manual.throttle; if(state.rc_signal_lost) { + param_get(failsafe_throttle_handle, &failsafe_throttle); att_sp.roll_body = 0.0f; att_sp.pitch_body = 0.0f; att_sp.yaw_body = 0.0f; - att_sp.thrust = 0.4f; + att_sp.thrust = failsafe_throttle; } att_sp.timestamp = hrt_absolute_time();