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