Copter: zigzag uses desired xy instead of actual
[ardupilot.git] / ArduPlane / config.h
blob52a54c467339da374b376fdf9319330c97c2a516
1 #pragma once
3 #include "defines.h"
5 //////////////////////////////////////////////////////////////////////////////
6 //////////////////////////////////////////////////////////////////////////////
7 // HARDWARE CONFIGURATION AND CONNECTIONS
8 //////////////////////////////////////////////////////////////////////////////
9 //////////////////////////////////////////////////////////////////////////////
11 #ifdef CONFIG_APM_HARDWARE
12 #error CONFIG_APM_HARDWARE option is depreated! use CONFIG_HAL_BOARD instead.
13 #endif
15 #ifndef MAV_SYSTEM_ID
16 # define MAV_SYSTEM_ID 1
17 #endif
19 //////////////////////////////////////////////////////////////////////////////
20 //////////////////////////////////////////////////////////////////////////////
21 // RADIO CONFIGURATION
22 //////////////////////////////////////////////////////////////////////////////
23 //////////////////////////////////////////////////////////////////////////////
26 #ifndef FLAP_1_PERCENT
27 # define FLAP_1_PERCENT 0
28 #endif
29 #ifndef FLAP_1_SPEED
30 # define FLAP_1_SPEED 0
31 #endif
32 #ifndef FLAP_2_PERCENT
33 # define FLAP_2_PERCENT 0
34 #endif
35 #ifndef FLAP_2_SPEED
36 # define FLAP_2_SPEED 0
37 #endif
38 //////////////////////////////////////////////////////////////////////////////
39 // FLIGHT_MODE
40 // FLIGHT_MODE_CHANNEL
42 #ifndef FLIGHT_MODE_CHANNEL
43 # define FLIGHT_MODE_CHANNEL 8
44 #endif
45 #if (FLIGHT_MODE_CHANNEL != 5) && (FLIGHT_MODE_CHANNEL != 6) && (FLIGHT_MODE_CHANNEL != 7) && (FLIGHT_MODE_CHANNEL != 8)
46 # error XXX
47 # error XXX You must set FLIGHT_MODE_CHANNEL to 5, 6, 7 or 8
48 # error XXX
49 #endif
51 #if !defined(FLIGHT_MODE_1)
52 # define FLIGHT_MODE_1 Mode::Number::RTL
53 #endif
54 #if !defined(FLIGHT_MODE_2)
55 # define FLIGHT_MODE_2 Mode::Number::RTL
56 #endif
57 #if !defined(FLIGHT_MODE_3)
58 # define FLIGHT_MODE_3 Mode::Number::FLY_BY_WIRE_A
59 #endif
60 #if !defined(FLIGHT_MODE_4)
61 # define FLIGHT_MODE_4 Mode::Number::FLY_BY_WIRE_A
62 #endif
63 #if !defined(FLIGHT_MODE_5)
64 # define FLIGHT_MODE_5 Mode::Number::MANUAL
65 #endif
66 #if !defined(FLIGHT_MODE_6)
67 # define FLIGHT_MODE_6 Mode::Number::MANUAL
68 #endif
71 //////////////////////////////////////////////////////////////////////////////
72 // AUTO_TRIM
74 #ifndef AUTO_TRIM
75 # define AUTO_TRIM DISABLED
76 #endif
79 //////////////////////////////////////////////////////////////////////////////
80 //////////////////////////////////////////////////////////////////////////////
81 // STARTUP BEHAVIOUR
82 //////////////////////////////////////////////////////////////////////////////
83 //////////////////////////////////////////////////////////////////////////////
86 //////////////////////////////////////////////////////////////////////////////
87 // GROUND_START_DELAY
89 #ifndef GROUND_START_DELAY
90 # define GROUND_START_DELAY 0
91 #endif
93 #ifndef DSPOILR_RUD_RATE_DEFAULT
94 #define DSPOILR_RUD_RATE_DEFAULT 100
95 #endif
97 //////////////////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////////////////
99 // FLIGHT AND NAVIGATION CONTROL
100 //////////////////////////////////////////////////////////////////////////////
101 //////////////////////////////////////////////////////////////////////////////
103 //////////////////////////////////////////////////////////////////////////////
104 // AIRSPEED_CRUISE
106 #ifndef AIRSPEED_CRUISE
107 # define AIRSPEED_CRUISE 12 // 12 m/s
108 #endif
112 //////////////////////////////////////////////////////////////////////////////
113 // MIN_GROUNDSPEED
115 #ifndef MIN_GROUNDSPEED
116 # define MIN_GROUNDSPEED 0 // m/s (0 disables)
117 #endif
120 //////////////////////////////////////////////////////////////////////////////
121 // FLY_BY_WIRE_B airspeed control
123 #ifndef AIRSPEED_FBW_MIN
124 # define AIRSPEED_FBW_MIN 9
125 #endif
126 #ifndef AIRSPEED_FBW_MAX
127 # define AIRSPEED_FBW_MAX 22
128 #endif
130 #ifndef CRUISE_ALT_FLOOR
131 # define CRUISE_ALT_FLOOR 0
132 #endif
135 //////////////////////////////////////////////////////////////////////////////
136 // Servo Mapping
138 #ifndef THROTTLE_MIN
139 # define THROTTLE_MIN 0 // percent
140 #endif
141 #ifndef THROTTLE_CRUISE
142 # define THROTTLE_CRUISE 45
143 #endif
144 #ifndef THROTTLE_MAX
145 # define THROTTLE_MAX 100
146 #endif
148 //////////////////////////////////////////////////////////////////////////////
149 // Autopilot control limits
151 #ifndef ROLL_LIMIT_DEG
152 # define ROLL_LIMIT_DEG 45
153 #endif
154 #ifndef PITCH_MAX
155 # define PITCH_MAX 20
156 #endif
157 #ifndef PITCH_MIN
158 # define PITCH_MIN -25
159 #endif
161 #ifndef RUDDER_MIX
162 # define RUDDER_MIX 0.5f
163 #endif
166 //////////////////////////////////////////////////////////////////////////////
167 //////////////////////////////////////////////////////////////////////////////
168 // DEBUGGING
169 //////////////////////////////////////////////////////////////////////////////
170 //////////////////////////////////////////////////////////////////////////////
172 //////////////////////////////////////////////////////////////////////////////
173 // Logging control
176 #define DEFAULT_LOG_BITMASK 0xffff
179 //////////////////////////////////////////////////////////////////////////////
180 // Navigation defaults
182 #ifndef WP_RADIUS_DEFAULT
183 # define WP_RADIUS_DEFAULT 90
184 #endif
186 #ifndef LOITER_RADIUS_DEFAULT
187 # define LOITER_RADIUS_DEFAULT 60
188 #endif
190 #ifndef ALT_HOLD_HOME
191 # define ALT_HOLD_HOME 100
192 #endif
194 //////////////////////////////////////////////////////////////////////////////
195 // Developer Items
198 #ifndef SCALING_SPEED
199 # define SCALING_SPEED 15.0
200 #endif
202 // a digital pin to set high when the geo-fence triggers. Defaults
203 // to -1, which means don't activate a pin
204 #ifndef FENCE_TRIGGERED_PIN
205 # define FENCE_TRIGGERED_PIN -1
206 #endif
208 #ifndef AP_PLANE_OFFBOARD_GUIDED_SLEW_ENABLED
209 #define AP_PLANE_OFFBOARD_GUIDED_SLEW_ENABLED 1
210 #endif
212 //////////////////////////////////////////////////////////////////////////////
213 // EKF Failsafe
214 #ifndef FS_EKF_THRESHOLD_DEFAULT
215 # define FS_EKF_THRESHOLD_DEFAULT 0.8f // EKF failsafe's default compass and velocity variance threshold above which the EKF failsafe will be triggered
216 #endif
218 /////////////////////////////////////////////////////////////////////////////
219 // Landing Throttle Control Trigger Threshold
220 #ifndef THR_CTRL_LAND_THRESH
221 #define THR_CTRL_LAND_THRESH 0.7
222 #endif