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/ArduSub/config.h
Views: 1798
1
#pragma once
2
3
#include "defines.h"
4
5
//////////////////////////////////////////////////////////////////////////////
6
//////////////////////////////////////////////////////////////////////////////
7
// HARDWARE CONFIGURATION AND CONNECTIONS
8
//////////////////////////////////////////////////////////////////////////////
9
//////////////////////////////////////////////////////////////////////////////
10
11
#ifndef CONFIG_HAL_BOARD
12
#error CONFIG_HAL_BOARD must be defined to build ArduSub
13
#endif
14
15
// run at 400Hz on all systems
16
# define MAIN_LOOP_RATE 400
17
18
#ifndef SURFACE_DEPTH_DEFAULT
19
# define SURFACE_DEPTH_DEFAULT -10.0f // pressure sensor reading 10cm depth means craft is considered surfaced
20
#endif
21
22
//////////////////////////////////////////////////////////////////////////////
23
// PWM control
24
// default RC speed in Hz
25
#ifndef RC_SPEED_DEFAULT
26
# define RC_SPEED_DEFAULT 200
27
#endif
28
29
//////////////////////////////////////////////////////////////////////////////
30
// Circle Nav parameters
31
//
32
33
#ifndef CIRCLE_NAV_ENABLED
34
# define CIRCLE_NAV_ENABLED 1
35
#endif
36
37
//////////////////////////////////////////////////////////////////////////////
38
// RCMAP
39
//
40
41
#ifndef RCMAP_ENABLED
42
# define RCMAP_ENABLED 0
43
#endif
44
45
//////////////////////////////////////////////////////////////////////////////
46
// Rangefinder
47
//
48
49
#ifndef RANGEFINDER_HEALTH_MAX
50
# define RANGEFINDER_HEALTH_MAX 3 // number of good reads that indicates a healthy rangefinder
51
#endif
52
53
#ifndef RANGEFINDER_TIMEOUT_MS
54
# define RANGEFINDER_TIMEOUT_MS 1000 // desired rangefinder alt will reset to current rangefinder alt after this many milliseconds without a good rangefinder alt
55
#endif
56
57
#ifndef RANGEFINDER_WPNAV_FILT_HZ
58
# define RANGEFINDER_WPNAV_FILT_HZ 0.25f // filter frequency for rangefinder altitude provided to waypoint navigation class
59
#endif
60
61
#ifndef RANGEFINDER_TILT_CORRECTION // by disable tilt correction for use of range finder data by EKF
62
# define RANGEFINDER_TILT_CORRECTION 0
63
#endif
64
65
#ifndef RANGEFINDER_SIGNAL_MIN_DEFAULT
66
# define RANGEFINDER_SIGNAL_MIN_DEFAULT 90 // rangefinder readings with signal quality below this value are ignored
67
#endif
68
69
#ifndef SURFTRAK_DEPTH_DEFAULT
70
# define SURFTRAK_DEPTH_DEFAULT -50.0f // surftrak will try to keep the sub below this depth
71
#endif
72
73
// Avoidance (relies on Proximity and Fence)
74
#ifndef AVOIDANCE_ENABLED
75
# define AVOIDANCE_ENABLED 0
76
#endif
77
78
#if AVOIDANCE_ENABLED // Avoidance Library relies on Fence
79
# define FENCE_ENABLED 1
80
#endif
81
82
#ifndef MAV_SYSTEM_ID
83
# define MAV_SYSTEM_ID 1
84
#endif
85
86
#ifndef EKF_ORIGIN_MAX_DIST_M
87
# define EKF_ORIGIN_MAX_DIST_M 50000 // EKF origin and waypoints (including home) must be within 50km
88
#endif
89
90
//////////////////////////////////////////////////////////////////////////////
91
// Nav-Guided - allows external nav computer to control vehicle
92
#ifndef NAV_GUIDED
93
# define NAV_GUIDED 1
94
#endif
95
96
//////////////////////////////////////////////////////////////////////////////
97
// Flight mode definitions
98
//
99
100
// Acro Mode
101
#ifndef ACRO_RP_P
102
# define ACRO_RP_P 4.5f
103
#endif
104
105
#ifndef ACRO_YAW_P
106
# define ACRO_YAW_P 3.375f
107
#endif
108
109
#ifndef ACRO_LEVEL_MAX_ANGLE
110
# define ACRO_LEVEL_MAX_ANGLE 3000
111
#endif
112
113
#ifndef ACRO_BALANCE_ROLL
114
#define ACRO_BALANCE_ROLL 1.0f
115
#endif
116
117
#ifndef ACRO_BALANCE_PITCH
118
#define ACRO_BALANCE_PITCH 1.0f
119
#endif
120
121
#ifndef ACRO_EXPO_DEFAULT
122
#define ACRO_EXPO_DEFAULT 0.3f
123
#endif
124
125
// AUTO Mode
126
#ifndef WP_YAW_BEHAVIOR_DEFAULT
127
# define WP_YAW_BEHAVIOR_DEFAULT WP_YAW_BEHAVIOR_CORRECT_XTRACK
128
#endif
129
130
#ifndef AUTO_YAW_SLEW_RATE
131
# define AUTO_YAW_SLEW_RATE 60 // degrees/sec
132
#endif
133
134
#ifndef YAW_LOOK_AHEAD_MIN_SPEED
135
# define YAW_LOOK_AHEAD_MIN_SPEED 100 // minimum ground speed in cm/s required before vehicle is aimed at ground course
136
#endif
137
138
//////////////////////////////////////////////////////////////////////////////
139
// Stabilize Rate Control
140
//
141
#ifndef ROLL_PITCH_INPUT_MAX
142
# define ROLL_PITCH_INPUT_MAX 4500 // roll, pitch input range
143
#endif
144
#ifndef DEFAULT_ANGLE_MAX
145
# define DEFAULT_ANGLE_MAX 4500 // ANGLE_MAX parameters default value
146
#endif
147
148
//////////////////////////////////////////////////////////////////////////////
149
// Loiter position control gains
150
//
151
#ifndef POS_XY_P
152
# define POS_XY_P 1.0f
153
#endif
154
155
//////////////////////////////////////////////////////////////////////////////
156
// PosHold parameter defaults
157
//
158
#ifndef POSHOLD_ENABLED
159
# define POSHOLD_ENABLED 1 // PosHold flight mode enabled by default
160
#endif
161
162
//////////////////////////////////////////////////////////////////////////////
163
// Throttle control gains
164
//
165
166
#ifndef THR_DZ_DEFAULT
167
# define THR_DZ_DEFAULT 100 // the deadzone above and below mid throttle while in althold or loiter
168
#endif
169
170
// default maximum vertical velocity and acceleration the pilot may request
171
#ifndef PILOT_VELZ_MAX
172
# define PILOT_VELZ_MAX 500 // maximum vertical velocity in cm/s
173
#endif
174
#ifndef PILOT_ACCEL_Z_DEFAULT
175
# define PILOT_ACCEL_Z_DEFAULT 100 // vertical acceleration in cm/s/s while altitude is under pilot control
176
#endif
177
178
#ifndef AUTO_DISARMING_DELAY
179
# define AUTO_DISARMING_DELAY 0
180
#endif
181
182
//////////////////////////////////////////////////////////////////////////////
183
// Logging control
184
//
185
186
// Default logging bitmask
187
#ifndef DEFAULT_LOG_BITMASK
188
# define DEFAULT_LOG_BITMASK \
189
MASK_LOG_ATTITUDE_MED | \
190
MASK_LOG_GPS | \
191
MASK_LOG_PM | \
192
MASK_LOG_CTUN | \
193
MASK_LOG_NTUN | \
194
MASK_LOG_RCIN | \
195
MASK_LOG_IMU | \
196
MASK_LOG_CMD | \
197
MASK_LOG_CURRENT | \
198
MASK_LOG_RCOUT | \
199
MASK_LOG_OPTFLOW | \
200
MASK_LOG_COMPASS | \
201
MASK_LOG_CAMERA | \
202
MASK_LOG_MOTBATT
203
#endif
204
205