2 * This file is part of Betaflight.
4 * Betaflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Betaflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Betaflight. If not, see <http://www.gnu.org/licenses/>.
20 #include "common/axis.h"
24 typedef struct gpsRescue_s
{
25 uint16_t angle
; //degrees
26 uint16_t initialAltitudeM
; //meters
27 uint16_t descentDistanceM
; //meters
28 uint16_t rescueGroundspeed
; //centimeters per second
29 uint16_t throttleP
, throttleI
, throttleD
;
33 uint16_t throttleHover
;
34 uint16_t velP
, velI
, velD
;
36 uint16_t minRescueDth
; //meters
38 uint8_t allowArmingWithoutFix
;
40 uint16_t targetLandingAltitudeM
; //meters
41 uint16_t targetLandingDistanceM
; //meters
45 uint16_t rescueAltitudeBufferM
; //meters
48 PG_DECLARE(gpsRescueConfig_t
, gpsRescueConfig
);
50 extern int32_t gpsRescueAngle
[ANGLE_INDEX_COUNT
]; //NOTE: ANGLES ARE IN CENTIDEGREES
52 void updateGPSRescueState(void);
53 void rescueNewGpsData(void);
55 float gpsRescueGetYawRate(void);
56 float gpsRescueGetThrottle(void);
57 bool gpsRescueIsConfigured(void);
58 bool gpsRescueIsAvailable(void);
59 bool gpsRescueIsDisabled(void);
60 bool gpsRescueDisableMag(void);