From 7f9483ad3289c8cedd26e8dfd2743e6566d574f8 Mon Sep 17 00:00:00 2001 From: dewagter Date: Wed, 29 Oct 2014 19:24:29 +0100 Subject: [PATCH 1/2] [nav_airspeed] tune navigation airspeeds for diffent phases of the flightplan --- conf/airframes/examples/microjet.xml | 1 + conf/modules/tune_airspeed.xml | 27 ++++++++++++++ sw/airborne/modules/nav/nav_airspeed.c | 51 ++++++++++++++++++++++++++ sw/airborne/modules/nav/nav_airspeed.h | 40 ++++++++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 conf/modules/tune_airspeed.xml create mode 100644 sw/airborne/modules/nav/nav_airspeed.c create mode 100644 sw/airborne/modules/nav/nav_airspeed.h diff --git a/conf/airframes/examples/microjet.xml b/conf/airframes/examples/microjet.xml index 9daf3ec61eb..0029ca80f99 100644 --- a/conf/airframes/examples/microjet.xml +++ b/conf/airframes/examples/microjet.xml @@ -204,6 +204,7 @@ + diff --git a/conf/modules/tune_airspeed.xml b/conf/modules/tune_airspeed.xml new file mode 100644 index 00000000000..988a0e19958 --- /dev/null +++ b/conf/modules/tune_airspeed.xml @@ -0,0 +1,27 @@ + + + + + NAV AIRSPEED. + Navigation Airspeeds to be called from the flightplan. + + + + + + + + + + + + + +
+ +
+ + + +
+ diff --git a/sw/airborne/modules/nav/nav_airspeed.c b/sw/airborne/modules/nav/nav_airspeed.c new file mode 100644 index 00000000000..0c5ce8f069c --- /dev/null +++ b/sw/airborne/modules/nav/nav_airspeed.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014 OpenUAS + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#include "nav_airspeed.h" +#include "generated/airframe.h" + +#ifndef NOMINAL_AIRSPEED +#error Please define NOMINAL_AIRSPEED in airframe file +#endif + +#ifndef TRACKING_AIRSPEED +#define TRACKING_AIRSPEED NOMINAL_AIRSPEED +#endif + +#ifndef GLIDE_AIRSPEED +#define GLIDE_AIRSPEED NOMINAL_AIRSPEED +#endif + +#ifndef TAKEOFF_PITCH_ANGLE +#define TAKEOFF_PITCH_ANGLE 0 +#endif + +#ifndef FLARE_PITCH_ANGLE +#define FLARE_PITCH_ANGLE 0 +#endif + +float set_airspeed_nominal = NOMINAL_AIRSPEED; +float set_airspeed_tracking = TRACKING_AIRSPEED; +float set_airspeed_glide = GLIDE_AIRSPEED; +float set_takeoff_pitch = TAKEOFF_PITCH_ANGLE; +float set_flare_pitch = FLARE_PITCH_ANGLE; + diff --git a/sw/airborne/modules/nav/nav_airspeed.h b/sw/airborne/modules/nav/nav_airspeed.h new file mode 100644 index 00000000000..a9a5092a01e --- /dev/null +++ b/sw/airborne/modules/nav/nav_airspeed.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2014 OpenUAS + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +/** \file nav_airspeed.h + * + * NAV Tunable standard airspeed settings to be called from the flight plan + */ + +#ifndef NAV_AIRSPEED_H +#define NAV_AIRSPEED_H + +#include "std.h" +#include "generated/airframe.h" + +extern float set_airspeed_nominal; +extern float set_airspeed_tracking; +extern float set_airspeed_glide; +extern float set_takeoff_pitch; +extern float set_flare_pitch; + +#endif From 6f9b3d95013a057a875a41b393327d1d2d53970e Mon Sep 17 00:00:00 2001 From: dewagter Date: Tue, 16 Dec 2014 21:52:19 +0100 Subject: [PATCH 2/2] [nav_airspeed] Descriptions --- conf/modules/tune_airspeed.xml | 22 +++++++++++++++------- sw/airborne/modules/nav/nav_airspeed.c | 19 ++++++++----------- sw/airborne/modules/nav/nav_airspeed.h | 11 ++++------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/conf/modules/tune_airspeed.xml b/conf/modules/tune_airspeed.xml index 988a0e19958..f4bfe2e0d57 100644 --- a/conf/modules/tune_airspeed.xml +++ b/conf/modules/tune_airspeed.xml @@ -4,16 +4,24 @@ NAV AIRSPEED. Navigation Airspeeds to be called from the flightplan. + The included settings allow tuning of your different airspeeds + In your flightplans you call the airspeeds with + set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_nominal_setting + set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_tracking_setting + set var=v_ctl_auto_airspeed_setpoint value=nav_airspeed_landing_setting + attitude pitch=DegOfRad(nav_takeoff_pitch_setting) ... - + + + + - - - - - - + + + + + diff --git a/sw/airborne/modules/nav/nav_airspeed.c b/sw/airborne/modules/nav/nav_airspeed.c index 0c5ce8f069c..e032f39f539 100644 --- a/sw/airborne/modules/nav/nav_airspeed.c +++ b/sw/airborne/modules/nav/nav_airspeed.c @@ -28,24 +28,21 @@ #endif #ifndef TRACKING_AIRSPEED -#define TRACKING_AIRSPEED NOMINAL_AIRSPEED +#define TRACKING_AIRSPEED (1.25f * NOMINAL_AIRSPEED) #endif -#ifndef GLIDE_AIRSPEED -#define GLIDE_AIRSPEED NOMINAL_AIRSPEED +#ifndef LANDING_AIRSPEED +#define LANDING_AIRSPEED (0.8f * NOMINAL_AIRSPEED) #endif #ifndef TAKEOFF_PITCH_ANGLE #define TAKEOFF_PITCH_ANGLE 0 #endif -#ifndef FLARE_PITCH_ANGLE -#define FLARE_PITCH_ANGLE 0 -#endif -float set_airspeed_nominal = NOMINAL_AIRSPEED; -float set_airspeed_tracking = TRACKING_AIRSPEED; -float set_airspeed_glide = GLIDE_AIRSPEED; -float set_takeoff_pitch = TAKEOFF_PITCH_ANGLE; -float set_flare_pitch = FLARE_PITCH_ANGLE; +float nav_airspeed_nominal_setting = NOMINAL_AIRSPEED; +float nav_airspeed_tracking_setting = TRACKING_AIRSPEED; +float nav_airspeed_landing_setting = LANDING_AIRSPEED; + +float nav_takeoff_pitch_setting = TAKEOFF_PITCH_ANGLE; diff --git a/sw/airborne/modules/nav/nav_airspeed.h b/sw/airborne/modules/nav/nav_airspeed.h index a9a5092a01e..f1523533d86 100644 --- a/sw/airborne/modules/nav/nav_airspeed.h +++ b/sw/airborne/modules/nav/nav_airspeed.h @@ -29,12 +29,9 @@ #define NAV_AIRSPEED_H #include "std.h" -#include "generated/airframe.h" - -extern float set_airspeed_nominal; -extern float set_airspeed_tracking; -extern float set_airspeed_glide; -extern float set_takeoff_pitch; -extern float set_flare_pitch; +extern float nav_airspeed_nominal_setting; +extern float nav_airspeed_tracking_setting; +extern float nav_airspeed_landing_setting; +extern float nav_takeoff_pitch_setting; #endif