2 * This file is part of Cleanflight.
4 * Cleanflight 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 * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>.
27 // FIXME ap_mode is badly named, it's a value that is compared to rcCommand, not a flag at it's name implies.
29 typedef struct gpsProfile_s
{
30 uint16_t gps_wp_radius
; // if we are within this distance to a waypoint then we consider it reached (distance is in cm)
31 uint8_t gps_lpf
; // Low pass filter cut frequency for derivative calculation (default 20Hz)
32 uint8_t nav_slew_rate
; // Adds a rate control to nav output, will smoothen out nav angle spikes
33 uint8_t nav_controls_heading
; // copter faces toward the navigation point, maghold must be enabled for it
34 uint16_t nav_speed_min
; // cm/sec
35 uint16_t nav_speed_max
; // cm/sec
36 uint16_t ap_mode
; // Temporarily Disables GPS_HOLD_MODE to be able to make it possible to adjust the Hold-position when moving the sticks, creating a deadspan for GPS
39 extern int16_t GPS_angle
[ANGLE_INDEX_COUNT
]; // it's the angles that must be applied for GPS correction
41 extern int32_t GPS_home
[2];
42 extern int32_t GPS_hold
[2];
44 extern uint16_t GPS_distanceToHome
; // distance to home point in meters
45 extern int16_t GPS_directionToHome
; // direction to home or hol point in degrees
47 extern navigationMode_e nav_mode
; // Navigation mode
49 void GPS_reset_home_position(void);
50 void GPS_reset_nav(void);
51 void GPS_set_next_wp(int32_t* lat
, int32_t* lon
);
52 void gpsUseProfile(gpsProfile_t
*gpsProfileToUse
);
53 void gpsUsePIDs(pidProfile_t
*pidProfile
);
54 void updateGpsStateForHomeAndHoldMode(void);
55 void updateGpsWaypointsAndMode(void);
57 void onGpsNewData(void);