forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parameters.h
403 lines (327 loc) · 10.4 KB
/
Parameters.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#pragma once
#include <AP_Common/AP_Common.h>
#include "RC_Channel.h"
#include "AC_Sprayer/AC_Sprayer.h"
#include "AP_Gripper/AP_Gripper.h"
#include "AP_Rally.h"
// Global parameter class.
//
class Parameters {
public:
// The version of the layout as described by the parameter enum.
//
// When changing the parameter enum in an incompatible fashion, this
// value should be incremented by one.
//
// The increment will prevent old parameters from being used incorrectly
// by newer code.
//
static const uint16_t k_format_version = 16;
enum {
// Layout version number, always key zero.
//
k_param_format_version = 0,
k_param_software_type, // unused
k_param_BoardConfig_CAN,
// Misc
//
k_param_log_bitmask_old = 10, // unused
k_param_num_resets_old, // unused
k_param_reset_switch_chan,
k_param_initial_mode,
k_param_scheduler,
k_param_relay,
k_param_BoardConfig,
k_param_pivot_turn_angle_old, // unused
k_param_rc_13_old, // unused
k_param_rc_14_old, // unused
// IO pins
k_param_rssi_pin = 20, // unused, replaced by rssi_ library parameters
k_param_battery_volt_pin,
k_param_battery_curr_pin,
// braking
k_param_braking_percent_old = 30, // unused
k_param_braking_speederr_old, // unused
// misc2
k_param_log_bitmask = 40,
k_param_gps,
k_param_serial0_baud, // deprecated, can be deleted
k_param_serial1_baud, // deprecated, can be deleted
k_param_serial2_baud, // deprecated, can be deleted
// 97: RSSI
k_param_rssi = 97,
k_param_rpm_sensor, // rpm sensor 98
// 100: Arming parameters
k_param_arming = 100,
// 110: Telemetry control
//
k_param_gcs0 = 110, // stream rates for uartA
k_param_gcs1, // stream rates for uartC
k_param_sysid_this_mav,
k_param_sysid_my_gcs,
k_param_serial0_baud_old, // unused
k_param_serial1_baud_old, // unused
k_param_telem_delay,
k_param_skip_gyro_cal, // unused
k_param_gcs2, // stream rates for uartD
k_param_serial2_baud_old, // unused
k_param_serial2_protocol, // deprecated, can be deleted
k_param_serial_manager, // serial manager library
k_param_cli_enabled_old, // unused
k_param_gcs3,
k_param_gcs_pid_mask,
//
// 130: Sensor parameters
//
k_param_compass_enabled_deprecated = 130,
k_param_steering_learn, // unused
k_param_NavEKF, // deprecated - remove
k_param_mission, // mission library
k_param_NavEKF2_old, // deprecated - remove
k_param_NavEKF2,
k_param_g2, // 2nd block of parameters
k_param_NavEKF3,
// 140: battery controls
k_param_battery_monitoring = 140, // deprecated, can be deleted
k_param_volt_div_ratio, // deprecated, can be deleted
k_param_curr_amp_per_volt, // deprecated, can be deleted
k_param_input_voltage, // deprecated, can be deleted
k_param_pack_capacity, // deprecated, can be deleted
k_param_battery,
//
// 150: Navigation parameters
//
k_param_crosstrack_gain = 150, // unused
k_param_crosstrack_entry_angle, // unused
k_param_speed_cruise,
k_param_speed_turn_gain, // unused
k_param_speed_turn_dist, // unused
k_param_ch7_option, // unused
k_param_auto_trigger_pin,
k_param_auto_kickstart,
k_param_turn_circle, // unused
k_param_turn_max_g,
//
// 160: Radio settings
//
k_param_rc_1_old = 160, // unused
k_param_rc_2_old, // unused
k_param_rc_3_old, // unused
k_param_rc_4_old, // unused
k_param_rc_5_old, // unused
k_param_rc_6_old, // unused
k_param_rc_7_old, // unused
k_param_rc_8_old, // unused
// throttle control
k_param_throttle_min_old = 170, // unused
k_param_throttle_max_old, // unused
k_param_throttle_cruise,
k_param_throttle_slewrate_old, // unused
k_param_throttle_reduction, // unused
k_param_pilot_steer_type,
k_param_skid_steer_out_old, // unused
// failsafe control
k_param_fs_action = 180,
k_param_fs_timeout,
k_param_fs_throttle_enabled,
k_param_fs_throttle_value,
k_param_fs_gcs_enabled,
k_param_fs_crash_check,
k_param_fs_ekf_action,
k_param_fs_ekf_thresh, // 187
// obstacle control
k_param_sonar_enabled = 190, // deprecated, can be removed
k_param_sonar_old, // unused
k_param_rangefinder_trigger_cm, // unused
k_param_rangefinder_turn_angle, // unused
k_param_rangefinder_turn_time, // unused
k_param_sonar2_old, // unused
k_param_rangefinder_debounce, // unused
k_param_rangefinder, // rangefinder object
//
// 210: driving modes
//
k_param_mode_channel = 210,
k_param_mode1,
k_param_mode2,
k_param_mode3,
k_param_mode4,
k_param_mode5,
k_param_mode6,
k_param_aux_channel_old,
//
// 220: Waypoint data
//
k_param_command_total = 220, // unused
k_param_command_index, // unused
k_param_waypoint_radius_old, // unused
k_param_waypoint_overshoot_old, // unused
//
// camera control
//
k_param_camera,
k_param_camera_mount,
k_param_camera_mount2, // unused
//
// 230: PID Controllers
k_param_pidNavSteer = 230,
k_param_pidServoSteer, // unused
k_param_pidSpeedThrottle_old, // unused
// high RC channels
k_param_rc_9_old = 235, // unused
k_param_rc_10_old, // unused
k_param_rc_11_old, // unused
k_param_rc_12_old, // unusedS
// other objects
k_param_sitl = 240,
k_param_ahrs,
k_param_ins,
k_param_compass,
k_param_rcmap,
k_param_L1_controller,
k_param_steerController_old, // unused
k_param_barometer,
k_param_notify,
k_param_button,
k_param_osd,
k_param_logger = 253, // Logging Group
// 254,255: reserved
};
AP_Int16 format_version;
// Misc
//
AP_Int32 log_bitmask;
AP_Int8 reset_switch_chan;
AP_Int8 initial_mode;
// Telemetry control
//
AP_Int16 sysid_this_mav;
AP_Int16 sysid_my_gcs;
AP_Int8 telem_delay;
// navigation parameters
//
AP_Float speed_cruise;
AP_Int8 ch7_option;
AP_Int8 auto_trigger_pin;
AP_Float auto_kickstart;
AP_Float turn_max_g;
AP_Int16 gcs_pid_mask;
// Throttle
//
AP_Int8 throttle_cruise;
AP_Int8 pilot_steer_type;
// failsafe control
AP_Int8 fs_action;
AP_Float fs_timeout;
AP_Int8 fs_throttle_enabled;
AP_Int16 fs_throttle_value;
AP_Int8 fs_gcs_enabled;
AP_Int8 fs_crash_check;
AP_Int8 fs_ekf_action;
AP_Float fs_ekf_thresh;
// driving modes
//
AP_Int8 mode_channel;
AP_Int8 mode1;
AP_Int8 mode2;
AP_Int8 mode3;
AP_Int8 mode4;
AP_Int8 mode5;
AP_Int8 mode6;
Parameters() {}
};
/*
2nd block of parameters, to avoid going past 256 top level keys
*/
class ParametersG2 {
public:
ParametersG2(void);
// var_info for holding Parameter information
static const struct AP_Param::GroupInfo var_info[];
#if STATS_ENABLED == ENABLED
// vehicle statistics
AP_Stats stats;
#endif
// whether to enforce acceptance of packets only from sysid_my_gcs
AP_Int8 sysid_enforce;
// RC input channels
RC_Channels_Rover rc_channels;
// control over servo output ranges
SRV_Channels servo_channels;
#if ADVANCED_FAILSAFE == ENABLED
// advanced failsafe library
AP_AdvancedFailsafe_Rover afs;
#endif
AP_Beacon beacon;
// Visual Odometry camera
AP_VisualOdom visual_odom;
// Motor library
AP_MotorsUGV motors;
// wheel encoders
AP_WheelEncoder wheel_encoder;
AP_WheelRateControl wheel_rate_control;
// steering and throttle controller
AR_AttitudeControl attitude_control;
// turn radius of vehicle (only used in steering mode)
AP_Float turn_radius;
// acro mode turn rate maximum
AP_Float acro_turn_rate;
// Safe RTL library
AP_SmartRTL smart_rtl;
// default speed for rtl
AP_Float rtl_speed;
// frame class for vehicle
AP_Int8 frame_class;
// fence library
AC_Fence fence;
// proximity library
AP_Proximity proximity;
// avoidance library
AC_Avoid avoid;
// pitch angle at 100% throttle
AP_Float bal_pitch_max;
// pitch/roll angle for crash check
AP_Int8 crash_angle;
// follow mode library
AP_Follow follow;
// frame type for vehicle (used for vectored motor vehicles and custom motor configs)
AP_Int8 frame_type;
// loiter type
AP_Int8 loit_type;
AP_Float loit_radius;
// Sprayer
AC_Sprayer sprayer;
#if GRIPPER_ENABLED
AP_Gripper gripper;
#endif
// Rally point library
AP_Rally_Rover rally;
// Simple mode types
AP_Int8 simple_type;
// windvane
AP_WindVane windvane;
// Airspeed
AP_Airspeed airspeed;
// mission behave
AP_Int8 mis_done_behave;
// balance both pitch trim
AP_Float bal_pitch_trim;
// stick mixing for auto modes
AP_Int8 stick_mixing;
#ifdef ENABLE_SCRIPTING
AP_Scripting scripting;
#endif // ENABLE_SCRIPTING
// waypoint navigation
AR_WPNav wp_nav;
// Sailboat functions
Sailboat sailboat;
// object avoidance path planning
AP_OAPathPlanner oa;
// maximum speed for vehicle
AP_Float speed_max;
// gain for speed of correction in loiter
AP_Float loiter_speed_gain;
// FS options
AP_Int32 fs_options;
};
extern const AP_Param::Info var_info[];