Merge pull request #11297 from SteveCEvans/baro_state
[betaflight.git] / src / main / flight / gps_rescue.h
blobb1b575bac9a4b3ce17fd1f1ccad5617324b8cacf
1 /*
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/>.
18 #pragma once
20 #include "common/axis.h"
22 #include "pg/pg.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;
30 uint16_t yawP;
31 uint16_t throttleMin;
32 uint16_t throttleMax;
33 uint16_t throttleHover;
34 uint16_t velP, velI, velD;
35 uint8_t minSats;
36 uint16_t minRescueDth; //meters
37 uint8_t sanityChecks;
38 uint8_t allowArmingWithoutFix;
39 uint8_t useMag;
40 uint16_t targetLandingAltitudeM; //meters
41 uint16_t targetLandingDistanceM; //meters
42 uint8_t altitudeMode;
43 uint16_t ascendRate;
44 uint16_t descendRate;
45 uint16_t rescueAltitudeBufferM; //meters
46 } gpsRescueConfig_t;
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);