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_Compass/AP_Compass_config.h
Views: 1798
1
#pragma once
2
3
#include <AP_HAL/AP_HAL_Boards.h>
4
#include <AP_ExternalAHRS/AP_ExternalAHRS_config.h>
5
#include <AP_MSP/msp.h>
6
#include <AP_AHRS/AP_AHRS_config.h>
7
#include <AP_GPS/AP_GPS_config.h>
8
9
#ifndef AP_COMPASS_ENABLED
10
#define AP_COMPASS_ENABLED 1
11
#endif
12
13
#ifndef AP_COMPASS_DIAGONALS_ENABLED
14
#define AP_COMPASS_DIAGONALS_ENABLED 1
15
#endif
16
17
#ifndef COMPASS_CAL_ENABLED
18
#define COMPASS_CAL_ENABLED AP_COMPASS_ENABLED && AP_AHRS_DCM_ENABLED
19
#endif
20
21
#ifndef AP_COMPASS_CALIBRATION_FIXED_YAW_ENABLED
22
#define AP_COMPASS_CALIBRATION_FIXED_YAW_ENABLED AP_COMPASS_ENABLED && AP_GPS_ENABLED && AP_AHRS_ENABLED
23
#endif
24
25
#define COMPASS_MAX_SCALE_FACTOR 1.5
26
#define COMPASS_MIN_SCALE_FACTOR (1.0/COMPASS_MAX_SCALE_FACTOR)
27
28
// Backend support
29
#ifndef AP_COMPASS_BACKEND_DEFAULT_ENABLED
30
#define AP_COMPASS_BACKEND_DEFAULT_ENABLED AP_COMPASS_ENABLED
31
#endif
32
33
#ifndef AP_COMPASS_EXTERNALAHRS_ENABLED
34
#define AP_COMPASS_EXTERNALAHRS_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_EXTERNAL_AHRS_ENABLED)
35
#endif
36
37
#ifndef AP_COMPASS_MSP_ENABLED
38
#define AP_COMPASS_MSP_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_MSP_SENSORS_ENABLED)
39
#endif
40
41
#ifndef AP_COMPASS_SITL_ENABLED
42
#define AP_COMPASS_SITL_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && AP_SIM_ENABLED)
43
#endif
44
45
#ifndef AP_COMPASS_DRONECAN_ENABLED
46
#define AP_COMPASS_DRONECAN_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_DRONECAN_DRIVERS)
47
#endif
48
49
#ifndef AP_COMPASS_DRONECAN_HIRES_ENABLED
50
#define AP_COMPASS_DRONECAN_HIRES_ENABLED 0
51
#endif
52
53
// i2c-based compasses:
54
#ifndef AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
55
#define AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED AP_COMPASS_BACKEND_DEFAULT_ENABLED
56
#endif
57
58
#ifndef AP_COMPASS_AK09916_ENABLED
59
#define AP_COMPASS_AK09916_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
60
#endif
61
62
#ifndef AP_COMPASS_AK8963_ENABLED
63
#define AP_COMPASS_AK8963_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
64
#endif
65
66
#ifndef AP_COMPASS_BMM150_ENABLED
67
#define AP_COMPASS_BMM150_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
68
#endif
69
70
// this define dictates whether we iterate over the external i2c
71
// busses looking for BMM150. Ordinarily this should be true, but
72
// SkyViper specifies its BMM150 and thus does not need to probe.
73
// This is an interim arrangement until PCNC1 is eliminated as an
74
// auto-detect board.
75
#ifndef AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED
76
#define AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED AP_COMPASS_BMM150_ENABLED
77
#endif
78
79
#ifndef AP_COMPASS_BMM350_ENABLED
80
#define AP_COMPASS_BMM350_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
81
#endif
82
83
#ifndef AP_COMPASS_HMC5843_ENABLED
84
#define AP_COMPASS_HMC5843_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
85
#endif
86
87
#ifndef AP_COMPASS_ICM20948_ENABLED
88
#define AP_COMPASS_ICM20948_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
89
#endif
90
91
#ifndef AP_COMPASS_IIS2MDC_ENABLED
92
#define AP_COMPASS_IIS2MDC_ENABLED 0
93
#endif
94
95
#ifndef AP_COMPASS_IST8308_ENABLED
96
#define AP_COMPASS_IST8308_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
97
#endif
98
99
#ifndef AP_COMPASS_IST8310_ENABLED
100
#define AP_COMPASS_IST8310_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
101
#endif
102
103
#ifndef AP_COMPASS_LIS3MDL_ENABLED
104
#define AP_COMPASS_LIS3MDL_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
105
#endif
106
107
#ifndef AP_COMPASS_LSM303D_ENABLED
108
#define AP_COMPASS_LSM303D_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
109
#endif
110
111
#ifndef AP_COMPASS_LSM9DS1_ENABLED
112
#define AP_COMPASS_LSM9DS1_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
113
#endif
114
115
#ifndef AP_COMPASS_MAG3110_ENABLED
116
#define AP_COMPASS_MAG3110_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
117
#endif
118
119
#ifndef AP_COMPASS_MMC3416_ENABLED
120
#define AP_COMPASS_MMC3416_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
121
#endif
122
123
#ifndef AP_COMPASS_MMC5XX3_ENABLED
124
#define AP_COMPASS_MMC5XX3_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
125
#endif
126
127
#ifndef AP_COMPASS_QMC5883P_ENABLED
128
#define AP_COMPASS_QMC5883P_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED && (BOARD_FLASH_SIZE > 1024)
129
#endif
130
131
#ifndef AP_COMPASS_QMC5883L_ENABLED
132
#define AP_COMPASS_QMC5883L_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
133
#endif
134
135
#ifndef AP_COMPASS_RM3100_ENABLED
136
#define AP_COMPASS_RM3100_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
137
#endif
138
139