From b17c0bcad940a43d028dcc2c9bd11b644bae61bd Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Wed, 2 Sep 2015 09:06:52 +0200 Subject: [PATCH] [navigaiton] Rotorcraft navigtation parameters belong in the airframe file and should be tunable backport of #1315 --- conf/airframes/BR/ladybird_kit_bart.xml | 5 +++++ conf/airframes/HooperFly/racerpex_hexa_lisa_mx_20.xml | 5 +++++ conf/airframes/examples/bebop.xml | 5 +++++ conf/flight_plans/rotorcraft_basic.xml | 4 ++-- conf/flight_plans/rotorcraft_basic_superbitrf.xml | 2 +- .../rotorcraft_basic_superbitrf_from_hand.xml | 4 ++-- conf/flight_plans/rotorcraft_cam.xml | 4 ++-- conf/flight_plans/rotorcraft_krooz.xml | 4 ++-- conf/flight_plans/rotorcraft_optitrack.xml | 4 ++-- conf/flight_plans/rotorcraft_survey.xml | 4 ++-- conf/flight_plans/rotorcraft_vision.xml | 2 +- conf/settings/control/rotorcraft_guidance.xml | 2 ++ sw/airborne/firmwares/rotorcraft/navigation.c | 11 +++++++++++ sw/airborne/firmwares/rotorcraft/navigation.h | 1 + 14 files changed, 43 insertions(+), 14 deletions(-) diff --git a/conf/airframes/BR/ladybird_kit_bart.xml b/conf/airframes/BR/ladybird_kit_bart.xml index 0021fbdb811..d2ccdb9c498 100644 --- a/conf/airframes/BR/ladybird_kit_bart.xml +++ b/conf/airframes/BR/ladybird_kit_bart.xml @@ -206,6 +206,11 @@ +
+ + +
+
diff --git a/conf/airframes/HooperFly/racerpex_hexa_lisa_mx_20.xml b/conf/airframes/HooperFly/racerpex_hexa_lisa_mx_20.xml index 4c371cf86ea..7919f25fe17 100644 --- a/conf/airframes/HooperFly/racerpex_hexa_lisa_mx_20.xml +++ b/conf/airframes/HooperFly/racerpex_hexa_lisa_mx_20.xml @@ -213,6 +213,11 @@
+
+ + +
+
diff --git a/conf/airframes/examples/bebop.xml b/conf/airframes/examples/bebop.xml index 433ee960f49..6b99e455632 100644 --- a/conf/airframes/examples/bebop.xml +++ b/conf/airframes/examples/bebop.xml @@ -196,6 +196,11 @@
+
+ + +
+
diff --git a/conf/flight_plans/rotorcraft_basic.xml b/conf/flight_plans/rotorcraft_basic.xml index 05dfafbf73a..6adc56ef56d 100644 --- a/conf/flight_plans/rotorcraft_basic.xml +++ b/conf/flight_plans/rotorcraft_basic.xml @@ -36,7 +36,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_basic_superbitrf.xml b/conf/flight_plans/rotorcraft_basic_superbitrf.xml index a73feb3014b..11d79a26e20 100644 --- a/conf/flight_plans/rotorcraft_basic_superbitrf.xml +++ b/conf/flight_plans/rotorcraft_basic_superbitrf.xml @@ -104,7 +104,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml b/conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml index eeda8714b3d..955fa0756fc 100644 --- a/conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml +++ b/conf/flight_plans/rotorcraft_basic_superbitrf_from_hand.xml @@ -82,7 +82,7 @@ The goal of this flightplan is to have a safe, simple no-brainer flightplan for - + @@ -118,7 +118,7 @@ The goal of this flightplan is to have a safe, simple no-brainer flightplan for - + diff --git a/conf/flight_plans/rotorcraft_cam.xml b/conf/flight_plans/rotorcraft_cam.xml index 15982849e57..8ce2e08d334 100644 --- a/conf/flight_plans/rotorcraft_cam.xml +++ b/conf/flight_plans/rotorcraft_cam.xml @@ -35,7 +35,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_krooz.xml b/conf/flight_plans/rotorcraft_krooz.xml index 0ce5f2a18ef..785e957ce87 100644 --- a/conf/flight_plans/rotorcraft_krooz.xml +++ b/conf/flight_plans/rotorcraft_krooz.xml @@ -46,7 +46,7 @@ - + @@ -94,7 +94,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_optitrack.xml b/conf/flight_plans/rotorcraft_optitrack.xml index 6271a2671c6..c1bd8b6c88c 100644 --- a/conf/flight_plans/rotorcraft_optitrack.xml +++ b/conf/flight_plans/rotorcraft_optitrack.xml @@ -50,7 +50,7 @@ - + @@ -85,7 +85,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_survey.xml b/conf/flight_plans/rotorcraft_survey.xml index 28d3a9f4b16..56ef18712d9 100644 --- a/conf/flight_plans/rotorcraft_survey.xml +++ b/conf/flight_plans/rotorcraft_survey.xml @@ -40,7 +40,7 @@ - + @@ -95,7 +95,7 @@ - + diff --git a/conf/flight_plans/rotorcraft_vision.xml b/conf/flight_plans/rotorcraft_vision.xml index 69fe7a703c0..ec3f79da76b 100644 --- a/conf/flight_plans/rotorcraft_vision.xml +++ b/conf/flight_plans/rotorcraft_vision.xml @@ -27,7 +27,7 @@ - + diff --git a/conf/settings/control/rotorcraft_guidance.xml b/conf/settings/control/rotorcraft_guidance.xml index 6d816011835..162301c73f4 100644 --- a/conf/settings/control/rotorcraft_guidance.xml +++ b/conf/settings/control/rotorcraft_guidance.xml @@ -32,6 +32,8 @@ + + diff --git a/sw/airborne/firmwares/rotorcraft/navigation.c b/sw/airborne/firmwares/rotorcraft/navigation.c index e407c233b4b..3b6874dceec 100644 --- a/sw/airborne/firmwares/rotorcraft/navigation.c +++ b/sw/airborne/firmwares/rotorcraft/navigation.c @@ -81,12 +81,21 @@ bool_t nav_survey_active; int32_t nav_roll, nav_pitch; int32_t nav_heading; float nav_radius; +float nav_climb_vspeed, nav_descend_vspeed; /** default nav_circle_radius in meters */ #ifndef DEFAULT_CIRCLE_RADIUS #define DEFAULT_CIRCLE_RADIUS 5. #endif +#ifndef NAV_CLIMB_VSPEED +#define NAV_CLIMB_VSPEED 0.5 +#endif + +#ifndef NAV_DESCEND_VSPEED +#define NAV_DESCEND_VSPEED -0.8 +#endif + uint8_t vertical_mode; uint32_t nav_throttle; int32_t nav_climb, nav_altitude, nav_flight_altitude; @@ -160,6 +169,8 @@ void nav_init(void) nav_pitch = 0; nav_heading = 0; nav_radius = DEFAULT_CIRCLE_RADIUS; + nav_climb_vspeed = NAV_CLIMB_VSPEED; + nav_descend_vspeed = NAV_DESCEND_VSPEED; nav_throttle = 0; nav_climb = 0; nav_leg_progress = 0; diff --git a/sw/airborne/firmwares/rotorcraft/navigation.h b/sw/airborne/firmwares/rotorcraft/navigation.h index b3da5d9066f..fe5d6c6d745 100644 --- a/sw/airborne/firmwares/rotorcraft/navigation.h +++ b/sw/airborne/firmwares/rotorcraft/navigation.h @@ -55,6 +55,7 @@ extern int32_t nav_circle_radius, nav_circle_qdr, nav_circle_radians; extern int32_t nav_roll, nav_pitch; ///< with #INT32_ANGLE_FRAC extern int32_t nav_heading; ///< with #INT32_ANGLE_FRAC extern float nav_radius; +extern float nav_climb_vspeed, nav_descend_vspeed; extern int32_t nav_leg_progress; extern uint32_t nav_leg_length;