NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
navigation.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight 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.
8  *
9  * Ninjaflight 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.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #include "../config/navigation.h"
21 
22 // navigation mode
23 typedef enum {
28 
29 // FIXME ap_mode is badly named, it's a value that is compared to rcCommand, not a flag at it's name implies.
30 extern int16_t GPS_angle[ANGLE_INDEX_COUNT]; // it's the angles that must be applied for GPS correction
31 
32 extern int32_t GPS_home[2];
33 extern int32_t GPS_hold[2];
34 
35 extern uint16_t GPS_distanceToHome; // distance to home point in meters
36 extern int16_t GPS_directionToHome; // direction to home or hol point in degrees
37 
38 extern navigationMode_e navi_mode; // Navigation mode
39 
40 void navigationInit(struct pid_config *pidProfile);
41 void GPS_reset_home_position(void);
42 void GPS_reset_nav(void);
43 void GPS_set_next_wp(int32_t* lat, int32_t* lon);
44 void gpsUsePIDs(struct pid_config *pidProfile);
46 void updateGpsWaypointsAndMode(void);
47 
48 void onGpsNewData(void);
void gpsUsePIDs(struct pid_config *pidProfile)
void GPS_set_next_wp(int32_t *lat, int32_t *lon)
int32_t GPS_hold[2]
void updateGpsWaypointsAndMode(void)
Definition: navigation.h:25
Definition: anglerate.h:66
void GPS_reset_nav(void)
navigationMode_e
Definition: navigation.h:23
void onGpsNewData(void)
int16_t GPS_directionToHome
uint16_t GPS_distanceToHome
void navigationInit(struct pid_config *pidProfile)
void updateGpsStateForHomeAndHoldMode(void)
Definition: navigation.h:26
Definition: navigation.h:24
navigationMode_e navi_mode
int32_t GPS_home[2]
Definition: axis.h:40
int16_t GPS_angle[ANGLE_INDEX_COUNT]
void GPS_reset_home_position(void)