ArduSub: get MAV_STATE_BOOT on reboot
[ardupilot.git] / ArduPlane / config.h
blob08917cbe584869a060d4b7396b7a89e8bfd6003d
1 #pragma once
3 #include "defines.h"
5 // Just so that it's completely clear...
6 #define ENABLED 1
7 #define DISABLED 0
9 // this avoids a very common config error
10 #define ENABLE ENABLED
11 #define DISABLE DISABLED
13 //////////////////////////////////////////////////////////////////////////////
14 //////////////////////////////////////////////////////////////////////////////
15 // HARDWARE CONFIGURATION AND CONNECTIONS
16 //////////////////////////////////////////////////////////////////////////////
17 //////////////////////////////////////////////////////////////////////////////
19 #ifdef CONFIG_APM_HARDWARE
20 #error CONFIG_APM_HARDWARE option is depreated! use CONFIG_HAL_BOARD instead.
21 #endif
23 #ifndef MAV_SYSTEM_ID
24 # define MAV_SYSTEM_ID 1
25 #endif
27 //////////////////////////////////////////////////////////////////////////////
28 //////////////////////////////////////////////////////////////////////////////
29 // RADIO CONFIGURATION
30 //////////////////////////////////////////////////////////////////////////////
31 //////////////////////////////////////////////////////////////////////////////
34 #ifndef FLAP_1_PERCENT
35 # define FLAP_1_PERCENT 0
36 #endif
37 #ifndef FLAP_1_SPEED
38 # define FLAP_1_SPEED 0
39 #endif
40 #ifndef FLAP_2_PERCENT
41 # define FLAP_2_PERCENT 0
42 #endif
43 #ifndef FLAP_2_SPEED
44 # define FLAP_2_SPEED 0
45 #endif
46 //////////////////////////////////////////////////////////////////////////////
47 // FLIGHT_MODE
48 // FLIGHT_MODE_CHANNEL
50 #ifndef FLIGHT_MODE_CHANNEL
51 # define FLIGHT_MODE_CHANNEL 8
52 #endif
53 #if (FLIGHT_MODE_CHANNEL != 5) && (FLIGHT_MODE_CHANNEL != 6) && (FLIGHT_MODE_CHANNEL != 7) && (FLIGHT_MODE_CHANNEL != 8)
54 # error XXX
55 # error XXX You must set FLIGHT_MODE_CHANNEL to 5, 6, 7 or 8
56 # error XXX
57 #endif
59 #if !defined(FLIGHT_MODE_1)
60 # define FLIGHT_MODE_1 Mode::Number::RTL
61 #endif
62 #if !defined(FLIGHT_MODE_2)
63 # define FLIGHT_MODE_2 Mode::Number::RTL
64 #endif
65 #if !defined(FLIGHT_MODE_3)
66 # define FLIGHT_MODE_3 Mode::Number::FLY_BY_WIRE_A
67 #endif
68 #if !defined(FLIGHT_MODE_4)
69 # define FLIGHT_MODE_4 Mode::Number::FLY_BY_WIRE_A
70 #endif
71 #if !defined(FLIGHT_MODE_5)
72 # define FLIGHT_MODE_5 Mode::Number::MANUAL
73 #endif
74 #if !defined(FLIGHT_MODE_6)
75 # define FLIGHT_MODE_6 Mode::Number::MANUAL
76 #endif
79 //////////////////////////////////////////////////////////////////////////////
80 // AUTO_TRIM
82 #ifndef AUTO_TRIM
83 # define AUTO_TRIM DISABLED
84 #endif
87 //////////////////////////////////////////////////////////////////////////////
88 //////////////////////////////////////////////////////////////////////////////
89 // STARTUP BEHAVIOUR
90 //////////////////////////////////////////////////////////////////////////////
91 //////////////////////////////////////////////////////////////////////////////
94 //////////////////////////////////////////////////////////////////////////////
95 // GROUND_START_DELAY
97 #ifndef GROUND_START_DELAY
98 # define GROUND_START_DELAY 0
99 #endif
101 #ifndef DSPOILR_RUD_RATE_DEFAULT
102 #define DSPOILR_RUD_RATE_DEFAULT 100
103 #endif
105 //////////////////////////////////////////////////////////////////////////////
106 //////////////////////////////////////////////////////////////////////////////
107 // FLIGHT AND NAVIGATION CONTROL
108 //////////////////////////////////////////////////////////////////////////////
109 //////////////////////////////////////////////////////////////////////////////
111 //////////////////////////////////////////////////////////////////////////////
112 // AIRSPEED_CRUISE
114 #ifndef AIRSPEED_CRUISE
115 # define AIRSPEED_CRUISE 12 // 12 m/s
116 #endif
120 //////////////////////////////////////////////////////////////////////////////
121 // MIN_GROUNDSPEED
123 #ifndef MIN_GROUNDSPEED
124 # define MIN_GROUNDSPEED 0 // m/s (0 disables)
125 #endif
128 //////////////////////////////////////////////////////////////////////////////
129 // FLY_BY_WIRE_B airspeed control
131 #ifndef AIRSPEED_FBW_MIN
132 # define AIRSPEED_FBW_MIN 9
133 #endif
134 #ifndef AIRSPEED_FBW_MAX
135 # define AIRSPEED_FBW_MAX 22
136 #endif
138 #ifndef CRUISE_ALT_FLOOR
139 # define CRUISE_ALT_FLOOR 0
140 #endif
143 //////////////////////////////////////////////////////////////////////////////
144 // Servo Mapping
146 #ifndef THROTTLE_MIN
147 # define THROTTLE_MIN 0 // percent
148 #endif
149 #ifndef THROTTLE_CRUISE
150 # define THROTTLE_CRUISE 45
151 #endif
152 #ifndef THROTTLE_MAX
153 # define THROTTLE_MAX 100
154 #endif
156 //////////////////////////////////////////////////////////////////////////////
157 // Autopilot control limits
159 #ifndef ROLL_LIMIT_DEG
160 # define ROLL_LIMIT_DEG 45
161 #endif
162 #ifndef PITCH_MAX
163 # define PITCH_MAX 20
164 #endif
165 #ifndef PITCH_MIN
166 # define PITCH_MIN -25
167 #endif
169 #ifndef RUDDER_MIX
170 # define RUDDER_MIX 0.5f
171 #endif
174 //////////////////////////////////////////////////////////////////////////////
175 //////////////////////////////////////////////////////////////////////////////
176 // DEBUGGING
177 //////////////////////////////////////////////////////////////////////////////
178 //////////////////////////////////////////////////////////////////////////////
180 //////////////////////////////////////////////////////////////////////////////
181 // Logging control
184 #define DEFAULT_LOG_BITMASK 0xffff
187 //////////////////////////////////////////////////////////////////////////////
188 // Navigation defaults
190 #ifndef WP_RADIUS_DEFAULT
191 # define WP_RADIUS_DEFAULT 90
192 #endif
194 #ifndef LOITER_RADIUS_DEFAULT
195 # define LOITER_RADIUS_DEFAULT 60
196 #endif
198 #ifndef ALT_HOLD_HOME
199 # define ALT_HOLD_HOME 100
200 #endif
202 //////////////////////////////////////////////////////////////////////////////
203 // Developer Items
206 #ifndef SCALING_SPEED
207 # define SCALING_SPEED 15.0
208 #endif
210 // a digital pin to set high when the geo-fence triggers. Defaults
211 // to -1, which means don't activate a pin
212 #ifndef FENCE_TRIGGERED_PIN
213 # define FENCE_TRIGGERED_PIN -1
214 #endif
216 //////////////////////////////////////////////////////////////////////////////
217 // Parachute release
218 #ifndef PARACHUTE
219 #define PARACHUTE HAL_PARACHUTE_ENABLED
220 #endif
222 #ifndef OFFBOARD_GUIDED
223 #define OFFBOARD_GUIDED 1
224 #endif
226 //////////////////////////////////////////////////////////////////////////////
227 // EKF Failsafe
228 #ifndef FS_EKF_THRESHOLD_DEFAULT
229 # define FS_EKF_THRESHOLD_DEFAULT 0.8f // EKF failsafe's default compass and velocity variance threshold above which the EKF failsafe will be triggered
230 #endif
232 /////////////////////////////////////////////////////////////////////////////
233 // Landing Throttle Control Trigger Threshold
234 #ifndef THR_CTRL_LAND_THRESH
235 #define THR_CTRL_LAND_THRESH 0.7
236 #endif