diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-09-02 23:30:32 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-09-02 23:30:32 +0200 |
commit | 40e18948727b41843fc0766e520f92b8cc841296 (patch) | |
tree | 47d251f6d5898815f46f97926a94b8dc567e2cb9 /src/modules | |
parent | 193a52d8132ce03aa0de9547f77ca8aeb67220f1 (diff) | |
download | px4-firmware-40e18948727b41843fc0766e520f92b8cc841296.tar.gz px4-firmware-40e18948727b41843fc0766e520f92b8cc841296.tar.bz2 px4-firmware-40e18948727b41843fc0766e520f92b8cc841296.zip |
Added parameter NAV_TAKEOFF_GAP
Diffstat (limited to 'src/modules')
4 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index f22dac0c1..40d0386d5 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -46,6 +46,7 @@ #include <systemlib/param/param.h> PARAM_DEFINE_FLOAT(NAV_TAKEOFF_ALT, 5.0f); +PARAM_DEFINE_FLOAT(NAV_TAKEOFF_GAP, 3.0f); PARAM_DEFINE_FLOAT(TRIM_ROLL, 0.0f); PARAM_DEFINE_FLOAT(TRIM_PITCH, 0.0f); PARAM_DEFINE_FLOAT(TRIM_YAW, 0.0f); diff --git a/src/modules/multirotor_pos_control/multirotor_pos_control.c b/src/modules/multirotor_pos_control/multirotor_pos_control.c index 5260a0963..336523072 100644 --- a/src/modules/multirotor_pos_control/multirotor_pos_control.c +++ b/src/modules/multirotor_pos_control/multirotor_pos_control.c @@ -424,7 +424,7 @@ static int multirotor_pos_control_thread_main(int argc, char *argv[]) if (reset_auto_pos) { local_pos_sp.x = local_pos.x; local_pos_sp.y = local_pos.y; - local_pos_sp.z = - params.takeoff_alt - 3.0f; + local_pos_sp.z = - params.takeoff_alt - params.takeoff_gap; local_pos_sp.yaw = att.yaw; local_pos_sp_valid = true; att_sp.yaw_body = att.yaw; diff --git a/src/modules/multirotor_pos_control/multirotor_pos_control_params.c b/src/modules/multirotor_pos_control/multirotor_pos_control_params.c index 4d6511851..bf9578ea3 100644 --- a/src/modules/multirotor_pos_control/multirotor_pos_control_params.c +++ b/src/modules/multirotor_pos_control/multirotor_pos_control_params.c @@ -60,6 +60,7 @@ PARAM_DEFINE_FLOAT(MPC_TILT_MAX, 0.5f); int parameters_init(struct multirotor_position_control_param_handles *h) { h->takeoff_alt = param_find("NAV_TAKEOFF_ALT"); + h->takeoff_gap = param_find("NAV_TAKEOFF_GAP"); h->thr_min = param_find("MPC_THR_MIN"); h->thr_max = param_find("MPC_THR_MAX"); h->z_p = param_find("MPC_Z_P"); @@ -85,7 +86,8 @@ int parameters_init(struct multirotor_position_control_param_handles *h) int parameters_update(const struct multirotor_position_control_param_handles *h, struct multirotor_position_control_params *p) { - param_get(h->takeoff_alt,&(p->takeoff_alt)); + param_get(h->takeoff_alt, &(p->takeoff_alt)); + param_get(h->takeoff_gap, &(p->takeoff_gap)); param_get(h->thr_min, &(p->thr_min)); param_get(h->thr_max, &(p->thr_max)); param_get(h->z_p, &(p->z_p)); diff --git a/src/modules/multirotor_pos_control/multirotor_pos_control_params.h b/src/modules/multirotor_pos_control/multirotor_pos_control_params.h index 79bc9b72b..fc658dadb 100644 --- a/src/modules/multirotor_pos_control/multirotor_pos_control_params.h +++ b/src/modules/multirotor_pos_control/multirotor_pos_control_params.h @@ -41,7 +41,8 @@ #include <systemlib/param/param.h> struct multirotor_position_control_params { - float takeoff_alt; + float takeoff_alt; + float takeoff_gap; float thr_min; float thr_max; float z_p; @@ -64,7 +65,8 @@ struct multirotor_position_control_params { }; struct multirotor_position_control_param_handles { - param_t takeoff_alt; + param_t takeoff_alt; + param_t takeoff_gap; param_t thr_min; param_t thr_max; param_t z_p; |