Added parameter NAV_TAKEOFF_GAP

This commit is contained in:
Anton Babushkin 2013-09-02 23:30:32 +02:00
parent 193a52d813
commit 40e1894872
4 changed files with 9 additions and 4 deletions

View File

@ -46,6 +46,7 @@
#include <systemlib/param/param.h> #include <systemlib/param/param.h>
PARAM_DEFINE_FLOAT(NAV_TAKEOFF_ALT, 5.0f); 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_ROLL, 0.0f);
PARAM_DEFINE_FLOAT(TRIM_PITCH, 0.0f); PARAM_DEFINE_FLOAT(TRIM_PITCH, 0.0f);
PARAM_DEFINE_FLOAT(TRIM_YAW, 0.0f); PARAM_DEFINE_FLOAT(TRIM_YAW, 0.0f);

View File

@ -424,7 +424,7 @@ static int multirotor_pos_control_thread_main(int argc, char *argv[])
if (reset_auto_pos) { if (reset_auto_pos) {
local_pos_sp.x = local_pos.x; local_pos_sp.x = local_pos.x;
local_pos_sp.y = local_pos.y; 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.yaw = att.yaw;
local_pos_sp_valid = true; local_pos_sp_valid = true;
att_sp.yaw_body = att.yaw; att_sp.yaw_body = att.yaw;

View File

@ -60,6 +60,7 @@ PARAM_DEFINE_FLOAT(MPC_TILT_MAX, 0.5f);
int parameters_init(struct multirotor_position_control_param_handles *h) int parameters_init(struct multirotor_position_control_param_handles *h)
{ {
h->takeoff_alt = param_find("NAV_TAKEOFF_ALT"); 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_min = param_find("MPC_THR_MIN");
h->thr_max = param_find("MPC_THR_MAX"); h->thr_max = param_find("MPC_THR_MAX");
h->z_p = param_find("MPC_Z_P"); 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) 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_min, &(p->thr_min));
param_get(h->thr_max, &(p->thr_max)); param_get(h->thr_max, &(p->thr_max));
param_get(h->z_p, &(p->z_p)); param_get(h->z_p, &(p->z_p));

View File

@ -41,7 +41,8 @@
#include <systemlib/param/param.h> #include <systemlib/param/param.h>
struct multirotor_position_control_params { struct multirotor_position_control_params {
float takeoff_alt; float takeoff_alt;
float takeoff_gap;
float thr_min; float thr_min;
float thr_max; float thr_max;
float z_p; float z_p;
@ -64,7 +65,8 @@ struct multirotor_position_control_params {
}; };
struct multirotor_position_control_param_handles { 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_min;
param_t thr_max; param_t thr_max;
param_t z_p; param_t z_p;