CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_GPS/AP_GPS_config.h
Views: 1798
1
#pragma once
2
3
#include <AP_HAL/AP_HAL_Boards.h>
4
#include <GCS_MAVLink/GCS_config.h>
5
6
#ifndef AP_GPS_ENABLED
7
#define AP_GPS_ENABLED 1
8
#endif
9
10
#if AP_GPS_ENABLED
11
/**
12
maximum number of GPS instances available on this platform. If more
13
than 1 then redundant sensors may be available
14
*/
15
#ifndef GPS_MAX_RECEIVERS
16
#define GPS_MAX_RECEIVERS 2 // maximum number of physical GPS sensors allowed - does not include virtual GPS created by blending receiver data
17
#endif
18
19
#if !defined(GPS_MAX_INSTANCES)
20
#if GPS_MAX_RECEIVERS > 1
21
#define GPS_MAX_INSTANCES (GPS_MAX_RECEIVERS + 1) // maximum number of GPS instances including the 'virtual' GPS created by blending receiver data
22
#else
23
#define GPS_MAX_INSTANCES 1
24
#endif // GPS_MAX_RECEIVERS > 1
25
#endif // GPS_MAX_INSTANCES
26
27
#if GPS_MAX_RECEIVERS <= 1 && GPS_MAX_INSTANCES > 1
28
#error "GPS_MAX_INSTANCES should be 1 for GPS_MAX_RECEIVERS <= 1"
29
#endif
30
#endif
31
32
#ifndef AP_GPS_BACKEND_DEFAULT_ENABLED
33
#define AP_GPS_BACKEND_DEFAULT_ENABLED AP_GPS_ENABLED
34
#endif
35
36
#if !defined(AP_GPS_BLENDED_ENABLED) && defined(GPS_MAX_INSTANCES)
37
#define AP_GPS_BLENDED_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED && GPS_MAX_INSTANCES > GPS_MAX_RECEIVERS
38
#endif
39
40
#ifndef AP_GPS_BLENDED_ENABLED
41
#define AP_GPS_BLENDED_ENABLED 0
42
#endif
43
44
#if AP_GPS_BLENDED_ENABLED
45
#define GPS_BLENDED_INSTANCE GPS_MAX_RECEIVERS // the virtual blended GPS is always the highest instance (2)
46
#endif
47
48
#ifndef AP_GPS_DRONECAN_ENABLED
49
#define AP_GPS_DRONECAN_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS
50
#endif
51
52
#ifndef AP_GPS_ERB_ENABLED
53
#define AP_GPS_ERB_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
54
#endif
55
56
#ifndef AP_GPS_GSOF_ENABLED
57
#define AP_GPS_GSOF_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
58
#endif
59
60
#ifndef AP_GPS_MAV_ENABLED
61
#define AP_GPS_MAV_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED && HAL_GCS_ENABLED
62
#endif
63
64
#ifndef HAL_MSP_GPS_ENABLED
65
#define HAL_MSP_GPS_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED && HAL_MSP_SENSORS_ENABLED
66
#endif
67
68
#ifndef AP_GPS_NMEA_ENABLED
69
#define AP_GPS_NMEA_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
70
#endif
71
72
#ifndef AP_GPS_NMEA_UNICORE_ENABLED
73
#define AP_GPS_NMEA_UNICORE_ENABLED AP_GPS_NMEA_ENABLED
74
#endif
75
76
#ifndef AP_GPS_NOVA_ENABLED
77
#define AP_GPS_NOVA_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
78
#endif
79
80
#ifndef AP_GPS_SBF_ENABLED
81
#define AP_GPS_SBF_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
82
#endif
83
84
#ifndef AP_GPS_SBP_ENABLED
85
#define AP_GPS_SBP_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
86
#endif
87
88
#ifndef AP_GPS_SBP2_ENABLED
89
#define AP_GPS_SBP2_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
90
#endif
91
92
#ifndef AP_GPS_SIRF_ENABLED
93
#define AP_GPS_SIRF_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
94
#endif
95
96
#ifndef AP_GPS_UBLOX_ENABLED
97
#define AP_GPS_UBLOX_ENABLED AP_GPS_BACKEND_DEFAULT_ENABLED
98
#endif
99
100
#ifndef AP_GPS_RTCM_DECODE_ENABLED
101
#define AP_GPS_RTCM_DECODE_ENABLED BOARD_FLASH_SIZE > 1024
102
#endif
103
104
#ifndef HAL_GPS_COM_PORT_DEFAULT
105
#define HAL_GPS_COM_PORT_DEFAULT 1
106
#endif
107
108
109
#ifndef AP_GPS_GPS_RAW_INT_SENDING_ENABLED
110
#define AP_GPS_GPS_RAW_INT_SENDING_ENABLED HAL_GCS_ENABLED && AP_GPS_ENABLED
111
#endif
112
113
#ifndef AP_GPS_GPS2_RAW_SENDING_ENABLED
114
#define AP_GPS_GPS2_RAW_SENDING_ENABLED HAL_GCS_ENABLED && AP_GPS_ENABLED && GPS_MAX_RECEIVERS > 1
115
#endif
116
117
#ifndef AP_GPS_GPS_RTK_SENDING_ENABLED
118
#define AP_GPS_GPS_RTK_SENDING_ENABLED HAL_GCS_ENABLED && AP_GPS_ENABLED && (AP_GPS_SBF_ENABLED || AP_GPS_ERB_ENABLED)
119
#endif
120
121
#ifndef AP_GPS_GPS2_RTK_SENDING_ENABLED
122
#define AP_GPS_GPS2_RTK_SENDING_ENABLED HAL_GCS_ENABLED && AP_GPS_ENABLED && GPS_MAX_RECEIVERS > 1 && (AP_GPS_SBF_ENABLED || AP_GPS_ERB_ENABLED)
123
#endif
124
125