forked from Archive/PX4-Autopilot
Added parameter NAV_TAKEOFF_GAP
This commit is contained in:
parent
193a52d813
commit
40e1894872
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
struct multirotor_position_control_params {
|
||||
float takeoff_alt;
|
||||
float takeoff_gap;
|
||||
float thr_min;
|
||||
float thr_max;
|
||||
float z_p;
|
||||
|
@ -65,6 +66,7 @@ struct multirotor_position_control_params {
|
|||
|
||||
struct multirotor_position_control_param_handles {
|
||||
param_t takeoff_alt;
|
||||
param_t takeoff_gap;
|
||||
param_t thr_min;
|
||||
param_t thr_max;
|
||||
param_t z_p;
|
||||
|
|
Loading…
Reference in New Issue