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/Rover/Parameters.h
Views: 1798
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, // rpm sensor 98
75
76
// 100: Arming parameters
77
k_param_arming = 100,
78
79
// 110: Telemetry control
80
//
81
k_param_gcs0 = 110, // stream rates for SERIAL0
82
k_param_gcs1, // stream rates for SERIAL1
83
k_param_sysid_this_mav,
84
k_param_sysid_my_gcs,
85
k_param_serial0_baud_old, // unused
86
k_param_serial1_baud_old, // unused
87
k_param_telem_delay,
88
k_param_skip_gyro_cal, // unused
89
k_param_gcs2, // stream rates for SERIAL2
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,
95
k_param_gcs_pid_mask,
96
k_param_gcs4,
97
k_param_gcs5,
98
k_param_gcs6,
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
};
234
235
AP_Int16 format_version;
236
237
// Misc
238
//
239
AP_Int32 log_bitmask;
240
AP_Int8 reset_switch_chan;
241
AP_Int8 initial_mode;
242
243
// Telemetry control
244
//
245
AP_Int16 sysid_this_mav;
246
AP_Int16 sysid_my_gcs;
247
AP_Int8 telem_delay;
248
249
// navigation parameters
250
//
251
AP_Float speed_cruise;
252
AP_Int8 ch7_option;
253
AP_Int8 auto_trigger_pin;
254
AP_Float auto_kickstart;
255
AP_Int16 gcs_pid_mask;
256
257
// Throttle
258
//
259
AP_Int8 throttle_cruise;
260
AP_Enum<PilotSteerType> pilot_steer_type;
261
262
// failsafe control
263
AP_Int8 fs_action;
264
AP_Float fs_timeout;
265
AP_Int8 fs_throttle_enabled;
266
AP_Int16 fs_throttle_value;
267
AP_Int8 fs_gcs_enabled;
268
AP_Int8 fs_crash_check;
269
AP_Int8 fs_ekf_action;
270
AP_Float fs_ekf_thresh;
271
272
// driving modes
273
//
274
AP_Int8 mode_channel;
275
AP_Int8 mode1;
276
AP_Int8 mode2;
277
AP_Int8 mode3;
278
AP_Int8 mode4;
279
AP_Int8 mode5;
280
AP_Int8 mode6;
281
282
Parameters() {}
283
};
284
285
/*
286
2nd block of parameters, to avoid going past 256 top level keys
287
*/
288
class ParametersG2 {
289
public:
290
ParametersG2(void);
291
292
// var_info for holding Parameter information
293
static const struct AP_Param::GroupInfo var_info[];
294
295
// whether to enforce acceptance of packets only from sysid_my_gcs
296
AP_Int8 sysid_enforce;
297
298
// RC input channels
299
RC_Channels_Rover rc_channels;
300
301
// control over servo output ranges
302
SRV_Channels servo_channels;
303
304
#if AP_ROVER_ADVANCED_FAILSAFE_ENABLED
305
// advanced failsafe library
306
AP_AdvancedFailsafe_Rover afs;
307
#endif
308
309
#if AP_BEACON_ENABLED
310
AP_Beacon beacon;
311
#endif
312
313
// wheel encoders
314
AP_WheelEncoder wheel_encoder;
315
AP_WheelRateControl wheel_rate_control;
316
317
// Motor library
318
AP_MotorsUGV motors;
319
320
// steering and throttle controller
321
AR_AttitudeControl attitude_control;
322
323
// turn radius of vehicle (only used in steering mode)
324
AP_Float turn_radius;
325
326
// acro mode turn rate maximum
327
AP_Float acro_turn_rate;
328
329
// Safe RTL library
330
AP_SmartRTL smart_rtl;
331
332
// default speed for rtl
333
AP_Float rtl_speed;
334
335
// frame class for vehicle
336
AP_Int8 frame_class;
337
338
#if HAL_PROXIMITY_ENABLED
339
// proximity library
340
AP_Proximity proximity;
341
#endif
342
343
#if MODE_DOCK_ENABLED
344
// we need a pointer to the mode for the G2 table
345
class ModeDock *mode_dock_ptr;
346
#endif
347
348
#if AP_AVOIDANCE_ENABLED
349
// avoidance library
350
AC_Avoid avoid;
351
#endif
352
353
// pitch angle at 100% throttle
354
AP_Float bal_pitch_max;
355
356
// pitch/roll angle for crash check
357
AP_Int8 crash_angle;
358
359
#if AP_FOLLOW_ENABLED
360
// follow mode library
361
AP_Follow follow;
362
#endif
363
364
// frame type for vehicle (used for vectored motor vehicles and custom motor configs)
365
AP_Int8 frame_type;
366
367
// loiter type
368
AP_Int8 loit_type;
369
AP_Float loit_radius;
370
371
#if HAL_SPRAYER_ENABLED
372
// Sprayer
373
AC_Sprayer sprayer;
374
#endif
375
376
#if HAL_RALLY_ENABLED
377
// Rally point library
378
AP_Rally_Rover rally;
379
#endif
380
381
// Simple mode types
382
AP_Int8 simple_type;
383
384
// windvane
385
AP_WindVane windvane;
386
387
#if AP_MISSION_ENABLED
388
// mission behave
389
AP_Enum<ModeAuto::DoneBehaviour> mis_done_behave;
390
#endif
391
392
// balance both pitch trim
393
AP_Float bal_pitch_trim;
394
395
// stick mixing for auto modes
396
AP_Int8 stick_mixing;
397
398
// waypoint navigation
399
AR_WPNav_OA wp_nav;
400
401
// Sailboat functions
402
Sailboat sailboat;
403
404
#if AP_OAPATHPLANNER_ENABLED
405
// object avoidance path planning
406
AP_OAPathPlanner oa;
407
#endif
408
409
// maximum speed for vehicle
410
AP_Float speed_max;
411
412
// gain for speed of correction in loiter
413
AP_Float loiter_speed_gain;
414
415
// FS options
416
AP_Int32 fs_options;
417
418
#if HAL_TORQEEDO_ENABLED
419
// torqeedo motor driver
420
AP_Torqeedo torqeedo;
421
#endif
422
423
// position controller
424
AR_PosControl pos_control;
425
426
// guided options bitmask
427
AP_Int32 guided_options;
428
429
// manual mode options
430
AP_Int32 manual_options;
431
432
// manual mode steering expo
433
AP_Float manual_steering_expo;
434
435
// FS GCS timeout trigger time
436
AP_Float fs_gcs_timeout;
437
438
class ModeCircle mode_circle;
439
};
440
441
extern const AP_Param::Info var_info[];
442
443