diff options
author | Julian Oes <joes@student.ethz.ch> | 2012-11-07 10:50:52 -0800 |
---|---|---|
committer | Julian Oes <joes@student.ethz.ch> | 2012-11-07 10:50:52 -0800 |
commit | 5995240a078828a3de41aea6ad03aa0cb3952613 (patch) | |
tree | 3dcd8b6df6e021e45303eb0f5950566ba832c605 /apps/multirotor_att_control | |
parent | 9f92c6df67f3cdde2504c7c2b8357b7a0871fe63 (diff) | |
download | px4-firmware-5995240a078828a3de41aea6ad03aa0cb3952613.tar.gz px4-firmware-5995240a078828a3de41aea6ad03aa0cb3952613.tar.bz2 px4-firmware-5995240a078828a3de41aea6ad03aa0cb3952613.zip |
Failsafe throttle when RC is lost is now a parameter
Diffstat (limited to 'apps/multirotor_att_control')
-rw-r--r-- | apps/multirotor_att_control/multirotor_att_control_main.c | 9 |
1 files changed, 8 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 bfa5e1b1f..78ea63018 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 <systemlib/perf_counter.h> #include <systemlib/systemlib.h> +#include <systemlib/param/param.h> #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(); |