Line data Source code
1 : #include "Copter.h"
2 :
3 : #include <AP_Beacon/AP_Beacon.h>
4 : #include <AP_Gripper/AP_Gripper.h>
5 : #include <AP_InertialSensor/AP_InertialSensor_rate_config.h>
6 :
7 : /*
8 : This program is free software: you can redistribute it and/or modify
9 : it under the terms of the GNU General Public License as published by
10 : the Free Software Foundation, either version 3 of the License, or
11 : (at your option) any later version.
12 :
13 : This program is distributed in the hope that it will be useful,
14 : but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 : GNU General Public License for more details.
17 :
18 : You should have received a copy of the GNU General Public License
19 : along with this program. If not, see <http://www.gnu.org/licenses/>.
20 : */
21 :
22 : /*
23 : * ArduCopter parameter definitions
24 : *
25 : */
26 :
27 : #if FRAME_CONFIG == HELI_FRAME
28 : // 6 here is AP_Motors::MOTOR_FRAME_HELI
29 : #define DEFAULT_FRAME_CLASS 6
30 : #else
31 : #define DEFAULT_FRAME_CLASS 0
32 : #endif
33 :
34 : const AP_Param::Info Copter::var_info[] = {
35 : // @Param: FORMAT_VERSION
36 : // @DisplayName: Eeprom format version number
37 : // @Description: This value is incremented when changes are made to the eeprom format
38 : // @User: Advanced
39 : GSCALAR(format_version, "FORMAT_VERSION", 0),
40 :
41 : // SYSID_THISMAV was here
42 :
43 : // SYSID_MYGCS was here
44 :
45 : // @Param: PILOT_THR_FILT
46 : // @DisplayName: Throttle filter cutoff
47 : // @Description: Throttle filter cutoff (Hz) - active whenever altitude control is inactive - 0 to disable
48 : // @User: Advanced
49 : // @Units: Hz
50 : // @Range: 0 10
51 : // @Increment: 0.5
52 : GSCALAR(throttle_filt, "PILOT_THR_FILT", 0),
53 :
54 : // @Param: PILOT_THR_BHV
55 : // @DisplayName: Throttle stick behavior
56 : // @Description: Bitmask containing various throttle stick options. TX with sprung throttle can set PILOT_THR_BHV to "1" so motor feedback when landed starts from mid-stick instead of bottom of stick.
57 : // @User: Standard
58 : // @Bitmask: 0:Feedback from mid stick,1:High throttle cancels landing,2:Disarm on land detection
59 : GSCALAR(throttle_behavior, "PILOT_THR_BHV", 0),
60 :
61 : // AP_SerialManager was here
62 :
63 : // @Param: GCS_PID_MASK
64 : // @DisplayName: GCS PID tuning mask
65 : // @Description: bitmask of PIDs to send MAVLink PID_TUNING messages for
66 : // @User: Advanced
67 : // @Bitmask: 0:Roll,1:Pitch,2:Yaw,3:AccelZ
68 : GSCALAR(gcs_pid_mask, "GCS_PID_MASK", 0),
69 :
70 : #if MODE_RTL_ENABLED
71 : // @Param: RTL_CONE_SLOPE
72 : // @DisplayName: RTL cone slope
73 : // @Description: Defines a cone above home which determines maximum climb
74 : // @Range: 0 10.0
75 : // @Increment: 0.1
76 : // @Values: 0:Disabled,1:Shallow (45deg),3:Steep (72deg)
77 : // @User: Standard
78 : GSCALAR(rtl_cone_slope, "RTL_CONE_SLOPE", RTL_CONE_SLOPE_DEFAULT),
79 :
80 : // @Param: RTL_LOIT_TIME
81 : // @DisplayName: RTL loiter time
82 : // @Description: Time (in milliseconds) to loiter above home before beginning final descent
83 : // @Units: ms
84 : // @Range: 0 60000
85 : // @Increment: 1000
86 : // @User: Standard
87 : GSCALAR(rtl_loiter_time, "RTL_LOIT_TIME", RTL_LOITER_TIME),
88 :
89 : // @Param: RTL_ALT_TYPE
90 : // @DisplayName: RTL mode altitude type
91 : // @Description: RTL altitude type. Set to 1 for Terrain following during RTL and then set WP_RFND_USE=1 to use rangefinder or WP_RFND_USE=0 to use Terrain database
92 : // @Values: 0:Relative to Home, 1:Terrain
93 : // @User: Standard
94 : GSCALAR(rtl_alt_type, "RTL_ALT_TYPE", 0),
95 : #endif
96 :
97 : // @Param: FS_GCS_ENABLE
98 : // @DisplayName: Ground Station Failsafe Enable
99 : // @Description: Controls whether failsafe will be invoked (and what action to take) when connection with Ground station is lost for at least 5 seconds. See FS_OPTIONS param for additional actions, or for cases allowing Mission continuation, when GCS failsafe is enabled.
100 : // @Values: 0:Disabled/NoAction,1:RTL,2:RTL or Continue with Mission in Auto Mode (Removed in 4.0+-see FS_OPTIONS),3:SmartRTL or RTL,4:SmartRTL or Land,5:Land,6:Auto DO_LAND_START/DO_RETURN_PATH_START or RTL,7:Brake or Land
101 : // @User: Standard
102 : GSCALAR(failsafe_gcs, "FS_GCS_ENABLE", static_cast<float>(FS_GCS_Action::DISABLED)),
103 :
104 : // @Param: GPS_HDOP_GOOD
105 : // @DisplayName: GPS Hdop Good
106 : // @Description: GPS Hdop value at or below this value represent a good position. Used for pre-arm checks
107 : // @Range: 100 900
108 : // @User: Advanced
109 : GSCALAR(gps_hdop_good, "GPS_HDOP_GOOD", GPS_HDOP_GOOD_DEFAULT),
110 :
111 : // @Param: SUPER_SIMPLE
112 : // @DisplayName: Super Simple Mode
113 : // @Description: Bitmask to enable Super Simple mode for some flight modes. Setting this to Disabled(0) will disable Super Simple Mode. The bitmask is for flight mode switch positions
114 : // @Bitmask: 0:SwitchPos1, 1:SwitchPos2, 2:SwitchPos3, 3:SwitchPos4, 4:SwitchPos5, 5:SwitchPos6
115 : // @User: Standard
116 : GSCALAR(super_simple, "SUPER_SIMPLE", 0),
117 :
118 : // @Param: WP_YAW_BEHAVIOR
119 : // @DisplayName: Yaw behaviour during missions
120 : // @Description: Determines how the autopilot controls the yaw during missions and RTL
121 : // @Values: 0:Never change yaw, 1:Face next waypoint, 2:Face next waypoint except RTL, 3:Face along GPS course
122 : // @User: Standard
123 : GSCALAR(wp_yaw_behavior, "WP_YAW_BEHAVIOR", static_cast<float>(WP_YAW_BEHAVIOR_DEFAULT)),
124 :
125 : // @Param: FS_THR_ENABLE
126 : // @DisplayName: Throttle Failsafe Enable
127 : // @Description: The throttle failsafe allows you to configure a software failsafe activated by a setting on the throttle input channel
128 : // @Values: 0:Disabled,1:Enabled always RTL,2:Enabled Continue with Mission in Auto Mode (Removed in 4.0+),3:Enabled always Land,4:Enabled always SmartRTL or RTL,5:Enabled always SmartRTL or Land,6:Enabled Auto DO_LAND_START/DO_RETURN_PATH_START or RTL,7:Enabled always Brake or Land
129 : // @User: Standard
130 : GSCALAR(failsafe_throttle, "FS_THR_ENABLE", static_cast<float>(FS_THR_Action::ALWAYS_RTL)),
131 :
132 : // @Param: FS_THR_VALUE
133 : // @DisplayName: Throttle Failsafe Value
134 : // @Description: The PWM level in microseconds on channel 3 below which throttle failsafe triggers
135 : // @Range: 910 1100
136 : // @Units: PWM
137 : // @Increment: 1
138 : // @User: Standard
139 : GSCALAR(failsafe_throttle_value, "FS_THR_VALUE", FS_THR_VALUE_DEFAULT),
140 :
141 : // @Param: THR_DZ
142 : // @DisplayName: Throttle deadzone
143 : // @Description: The deadzone above and below mid throttle in PWM microseconds. Used in AltHold, Loiter, PosHold flight modes
144 : // @User: Standard
145 : // @Range: 0 300
146 : // @Units: PWM
147 : // @Increment: 1
148 : GSCALAR(throttle_deadzone, "THR_DZ", THR_DZ_DEFAULT),
149 :
150 : // @Param: FLTMODE1
151 : // @DisplayName: Flight Mode 1
152 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is <= 1230
153 : // @Values: 0:Stabilize,1:Acro,2:AltHold,3:Auto,4:Guided,5:Loiter,6:RTL,7:Circle,9:Land,11:Drift,13:Sport,14:Flip,15:AutoTune,16:PosHold,17:Brake,18:Throw,19:Avoid_ADSB,20:Guided_NoGPS,21:Smart_RTL,22:FlowHold,23:Follow,24:ZigZag,25:SystemID,26:Heli_Autorotate,27:Auto RTL,28:Turtle
154 : // @User: Standard
155 : GARRAY(flight_modes, 0, "FLTMODE1", (uint8_t)FLIGHT_MODE_1),
156 :
157 : // @Param: FLTMODE2
158 : // @CopyFieldsFrom: FLTMODE1
159 : // @DisplayName: Flight Mode 2
160 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is >1230, <= 1360
161 : GARRAY(flight_modes, 1, "FLTMODE2", (uint8_t)FLIGHT_MODE_2),
162 :
163 : // @Param: FLTMODE3
164 : // @CopyFieldsFrom: FLTMODE1
165 : // @DisplayName: Flight Mode 3
166 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is >1360, <= 1490
167 : GARRAY(flight_modes, 2, "FLTMODE3", (uint8_t)FLIGHT_MODE_3),
168 :
169 : // @Param: FLTMODE4
170 : // @CopyFieldsFrom: FLTMODE1
171 : // @DisplayName: Flight Mode 4
172 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is >1490, <= 1620
173 : GARRAY(flight_modes, 3, "FLTMODE4", (uint8_t)FLIGHT_MODE_4),
174 :
175 : // @Param: FLTMODE5
176 : // @CopyFieldsFrom: FLTMODE1
177 : // @DisplayName: Flight Mode 5
178 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is >1620, <= 1749
179 : GARRAY(flight_modes, 4, "FLTMODE5", (uint8_t)FLIGHT_MODE_5),
180 :
181 : // @Param: FLTMODE6
182 : // @CopyFieldsFrom: FLTMODE1
183 : // @DisplayName: Flight Mode 6
184 : // @Description: Flight mode when pwm of Flightmode channel(FLTMODE_CH) is >=1750
185 : GARRAY(flight_modes, 5, "FLTMODE6", (uint8_t)FLIGHT_MODE_6),
186 :
187 : // @Param: FLTMODE_CH
188 : // @DisplayName: Flightmode channel
189 : // @Description: RC Channel to use for flight mode control
190 : // @Values: 0:Disabled,5:Channel5,6:Channel6,7:Channel7,8:Channel8,9:Channel9,10:Channel 10,11:Channel 11,12:Channel 12,13:Channel 13,14:Channel 14,15:Channel 15
191 : // @User: Advanced
192 : GSCALAR(flight_mode_chan, "FLTMODE_CH", CH_MODE_DEFAULT),
193 :
194 : // @Param: INITIAL_MODE
195 : // @DisplayName: Initial flight mode
196 : // @Description: This selects the mode to start in on boot. This is useful for when you want to start in AUTO mode on boot without a receiver.
197 : // @Values: 0:Stabilize,1:Acro,2:AltHold,3:Auto,4:Guided,5:Loiter,6:RTL,7:Circle,9:Land,11:Drift,13:Sport,14:Flip,15:AutoTune,16:PosHold,17:Brake,18:Throw,19:Avoid_ADSB,20:Guided_NoGPS,21:Smart_RTL,22:FlowHold,23:Follow,24:ZigZag,25:SystemID,26:Heli_Autorotate
198 : // @User: Advanced
199 : GSCALAR(initial_mode, "INITIAL_MODE", (uint8_t)Mode::Number::STABILIZE),
200 :
201 : // @Param: SIMPLE
202 : // @DisplayName: Simple mode bitmask
203 : // @Description: Bitmask which holds which flight modes use simple heading mode (eg bit 0 = 1 means Flight Mode 0 uses simple mode). The bitmask is for flightmode switch positions.
204 : // @Bitmask: 0:SwitchPos1, 1:SwitchPos2, 2:SwitchPos3, 3:SwitchPos4, 4:SwitchPos5, 5:SwitchPos6
205 : // @User: Advanced
206 : GSCALAR(simple_modes, "SIMPLE", 0),
207 :
208 : // @Param: LOG_BITMASK
209 : // @DisplayName: Log bitmask
210 : // @Description: Bitmap of what on-board log types to enable. This value is made up of the sum of each of the log types you want to be saved. It is usually best just to enable all basiclog types by setting this to 65535. Note that if you want to reduce log sizes you should consider using LOG_FILE_RATEMAX instead of disabling logging items with this parameter.
211 : // @Bitmask: 0:Fast Attitude,1:Medium Attitude,2:GPS,3:System Performance,4:Control Tuning,5:Navigation Tuning,6:RC input,7:IMU,8:Mission Commands,9:Battery Monitor,10:RC output,11:Optical Flow,12:PID,13:Compass,15:Camera,17:Motors,18:Fast IMU,19:Raw IMU,20:Video Stabilization,21:Fast harmonic notch logging
212 : // @User: Standard
213 : GSCALAR(log_bitmask, "LOG_BITMASK", DEFAULT_LOG_BITMASK),
214 :
215 : // @Param: ESC_CALIBRATION
216 : // @DisplayName: ESC Calibration
217 : // @Description: Controls whether ArduCopter will enter ESC calibration on the next restart. Do not adjust this parameter manually.
218 : // @User: Advanced
219 : // @Values: 0:Normal Start-up, 1:Start-up in ESC Calibration mode if throttle high, 2:Start-up in ESC Calibration mode regardless of throttle, 3:Start-up and automatically calibrate ESCs, 9:Disabled
220 : GSCALAR(esc_calibrate, "ESC_CALIBRATION", 0),
221 :
222 : #if AP_RC_TRANSMITTER_TUNING_ENABLED
223 : // @Param: TUNE
224 : // @DisplayName: Tuning Parameter
225 : // @Description: Selects parameter (normally a PID gain) that is being tuned with an RC transmitter's knob. The RC input channel used is assigned by setting RCx_OPTION to 219.
226 : // @User: Standard
227 : // @Values: 0:None,1:Stab Roll/Pitch kP,4:Rate Roll/Pitch kP,5:Rate Roll/Pitch kI,21:Rate Roll/Pitch kD,3:Stab Yaw kP,6:Rate Yaw kP,26:Rate Yaw kD,56:Rate Yaw Filter,55:Motor Yaw Headroom,14:AltHold kP,7:Throttle Rate kP,34:Throttle Accel kP,35:Throttle Accel kI,36:Throttle Accel kD,12:Loiter Pos kP,22:Velocity XY kP,28:Velocity XY kI,10:WP Speed (4.6 and earlier),25:Acro Roll/Pitch deg/s,40:Acro Yaw deg/s,45:RC Feel,38:Declination,39:Circle Rate,46:Rate Pitch kP,47:Rate Pitch kI,48:Rate Pitch kD,49:Rate Roll kP,50:Rate Roll kI,51:Rate Roll kD,52:Rate Pitch FF,53:Rate Roll FF,54:Rate Yaw FF,58:SysID Magnitude,59:PSC Angle Max,60:Loiter Speed,61:WP Speed (m/s)
228 : GSCALAR(rc_tuning_param, "TUNE", 0),
229 : #endif // AP_RC_TRANSMITTER_TUNING_ENABLED
230 :
231 : // @Param: FRAME_TYPE
232 : // @DisplayName: Frame Type (+, X, V, etc)
233 : // @Description: Controls motor mixing for multicopters. Not used for Tri or Traditional Helicopters.
234 : // @Values: 0:Plus, 1:X, 2:V, 3:H, 4:V-Tail, 5:A-Tail, 10:Y6B, 11:Y6F, 12:BetaFlightX, 13:DJIX, 14:ClockwiseX, 15: I, 18: BetaFlightXReversed, 19:Y4
235 : // @User: Standard
236 : // @RebootRequired: True
237 : GSCALAR(frame_type, "FRAME_TYPE", HAL_FRAME_TYPE_DEFAULT),
238 :
239 : // @Group: ARMING_
240 : // @Path: ../libraries/AP_Arming/AP_Arming.cpp
241 : GOBJECT(arming, "ARMING_", AP_Arming_Copter),
242 :
243 : // @Param: DISARM_DELAY
244 : // @DisplayName: Disarm delay
245 : // @Description: Delay before automatic disarm in seconds after landing touchdown detection. A value of zero disables auto disarm. If Emergency Motor stop active, delay time is half this value.
246 : // @Units: s
247 : // @Range: 0 127
248 : // @User: Advanced
249 : GSCALAR(disarm_delay, "DISARM_DELAY", AUTO_DISARMING_DELAY),
250 :
251 : #if MODE_POSHOLD_ENABLED
252 : // @Param: PHLD_BRK_RATE
253 : // @DisplayName: PosHold braking rate
254 : // @Description: PosHold flight mode's rotation rate during braking in deg/sec
255 : // @Units: deg/s
256 : // @Range: 4 12
257 : // @User: Advanced
258 : GSCALAR(poshold_brake_rate_degs, "PHLD_BRK_RATE", POSHOLD_BRAKE_RATE_DEFAULT),
259 : #endif
260 :
261 : // @Param: LAND_REPOSITION
262 : // @DisplayName: Land repositioning
263 : // @Description: Enables user input during LAND mode, the landing phase of RTL, and auto mode landings.
264 : // @Values: 0:No repositioning, 1:Repositioning
265 : // @User: Advanced
266 : GSCALAR(land_repositioning, "LAND_REPOSITION", LAND_REPOSITION_DEFAULT),
267 :
268 : // @Param: FS_EKF_ACTION
269 : // @DisplayName: EKF Failsafe Action
270 : // @Description: Controls the action that will be taken when an EKF failsafe is invoked
271 : // @Values: 0:Report only, 1:Switch to Land mode if current mode requires position, 2:Switch to AltHold mode if current mode requires position, 3:Switch to Land mode from all modes
272 : // @User: Advanced
273 : GSCALAR(fs_ekf_action, "FS_EKF_ACTION", static_cast<float>(FS_EKF_ACTION_DEFAULT)),
274 :
275 : // @Param: FS_EKF_THRESH
276 : // @DisplayName: EKF failsafe variance threshold
277 : // @Description: Allows setting the maximum acceptable compass, velocity, position and height variances. Used in arming check and EKF failsafe.
278 : // @Values: 0:Disabled, 0.6:Strict, 0.8:Default, 1.0:Relaxed
279 : // @Range: 0.0 1.0
280 : // @User: Advanced
281 : GSCALAR(fs_ekf_thresh, "FS_EKF_THRESH", FS_EKF_THRESHOLD_DEFAULT),
282 :
283 : // @Param: FS_CRASH_CHECK
284 : // @DisplayName: Crash check enable
285 : // @Description: This enables automatic crash checking. When enabled the motors will disarm if a crash is detected.
286 : // @Values: 0:Disabled, 1:Enabled
287 : // @User: Advanced
288 : GSCALAR(fs_crash_check, "FS_CRASH_CHECK", 1),
289 :
290 : // @Param: RC_SPEED
291 : // @DisplayName: ESC Update Speed
292 : // @Description: This is the speed in Hertz that your ESCs will receive updates
293 : // @Units: Hz
294 : // @Range: 50 490
295 : // @Increment: 1
296 : // @User: Advanced
297 : GSCALAR(rc_speed, "RC_SPEED", RC_FAST_SPEED),
298 :
299 : #if MODE_ACRO_ENABLED || MODE_SPORT_ENABLED
300 : // @Param: ACRO_BAL_ROLL
301 : // @DisplayName: Acro Balance Roll
302 : // @Description: rate at which roll angle returns to level in acro and sport mode. A higher value causes the vehicle to return to level faster. For helicopter sets the decay rate of the virtual flybar in the roll axis. A higher value causes faster decay of desired to actual attitude.
303 : // @Range: 0 3
304 : // @Increment: 0.1
305 : // @User: Advanced
306 : GSCALAR(acro_balance_roll, "ACRO_BAL_ROLL", ACRO_BALANCE_ROLL),
307 :
308 : // @Param: ACRO_BAL_PITCH
309 : // @DisplayName: Acro Balance Pitch
310 : // @Description: rate at which pitch angle returns to level in acro and sport mode. A higher value causes the vehicle to return to level faster. For helicopter sets the decay rate of the virtual flybar in the pitch axis. A higher value causes faster decay of desired to actual attitude.
311 : // @Range: 0 3
312 : // @Increment: 0.1
313 : // @User: Advanced
314 : GSCALAR(acro_balance_pitch, "ACRO_BAL_PITCH", ACRO_BALANCE_PITCH),
315 : #endif
316 :
317 : // ACRO_RP_EXPO moved to Command Model class
318 :
319 : #if MODE_ACRO_ENABLED
320 : // @Param: ACRO_TRAINER
321 : // @DisplayName: Acro Trainer
322 : // @Description: Type of trainer used in acro mode
323 : // @Values: 0:Disabled,1:Leveling,2:Leveling and Limited
324 : // @User: Advanced
325 : GSCALAR(acro_trainer, "ACRO_TRAINER", (uint8_t)ModeAcro::Trainer::LIMITED),
326 : #endif
327 :
328 : // variables not in the g class which contain EEPROM saved variables
329 :
330 : #if AP_CAMERA_ENABLED
331 : // @Group: CAM
332 : // @Path: ../libraries/AP_Camera/AP_Camera.cpp
333 : GOBJECT(camera, "CAM", AP_Camera),
334 : #endif
335 :
336 : #if AP_RELAY_ENABLED
337 : // @Group: RELAY
338 : // @Path: ../libraries/AP_Relay/AP_Relay.cpp
339 : GOBJECT(relay, "RELAY", AP_Relay),
340 : #endif
341 :
342 : #if HAL_PARACHUTE_ENABLED
343 : // @Group: CHUTE_
344 : // @Path: ../libraries/AP_Parachute/AP_Parachute.cpp
345 : GOBJECT(parachute, "CHUTE_", AP_Parachute),
346 : #endif
347 :
348 : #if AP_LANDINGGEAR_ENABLED
349 : // @Group: LGR_
350 : // @Path: ../libraries/AP_LandingGear/AP_LandingGear.cpp
351 : GOBJECT(landinggear, "LGR_", AP_LandingGear),
352 : #endif
353 :
354 : #if FRAME_CONFIG == HELI_FRAME
355 : // @Group: IM_
356 : // @Path: ../libraries/AC_InputManager/AC_InputManager_Heli.cpp
357 : GOBJECT(input_manager, "IM_", AC_InputManager_Heli),
358 : #endif
359 :
360 : // @Group: COMPASS_
361 : // @Path: ../libraries/AP_Compass/AP_Compass.cpp
362 : GOBJECT(compass, "COMPASS_", Compass),
363 :
364 : // @Group: INS
365 : // @Path: ../libraries/AP_InertialSensor/AP_InertialSensor.cpp
366 : GOBJECT(ins, "INS", AP_InertialSensor),
367 :
368 : // @Group: WP_
369 : // @Path: ../libraries/AC_WPNav/AC_WPNav.cpp
370 : GOBJECTPTR(wp_nav, "WP_", AC_WPNav),
371 :
372 : // @Group: LOIT_
373 : // @Path: ../libraries/AC_WPNav/AC_Loiter.cpp
374 : GOBJECTPTR(loiter_nav, "LOIT_", AC_Loiter),
375 :
376 : #if MODE_CIRCLE_ENABLED
377 : // @Group: CIRCLE_
378 : // @Path: ../libraries/AC_WPNav/AC_Circle.cpp
379 : GOBJECTPTR(circle_nav, "CIRCLE_", AC_Circle),
380 : #endif
381 :
382 : // @Group: ATC_
383 : // @Path: ../libraries/AC_AttitudeControl/AC_AttitudeControl.cpp,../libraries/AC_AttitudeControl/AC_AttitudeControl_Multi.cpp,../libraries/AC_AttitudeControl/AC_AttitudeControl_Heli.cpp
384 : GOBJECTVARPTR(attitude_control, "ATC_", &copter.attitude_control_var_info),
385 :
386 : // @Group: PSC
387 : // @Path: ../libraries/AC_AttitudeControl/AC_PosControl.cpp
388 : GOBJECTPTR(pos_control, "PSC", AC_PosControl),
389 :
390 : // SR0 through SR6 was here
391 :
392 : // @Group: AHRS_
393 : // @Path: ../libraries/AP_AHRS/AP_AHRS.cpp
394 : GOBJECT(ahrs, "AHRS_", AP_AHRS),
395 :
396 : #if HAL_MOUNT_ENABLED
397 : // @Group: MNT
398 : // @Path: ../libraries/AP_Mount/AP_Mount.cpp
399 : GOBJECT(camera_mount, "MNT", AP_Mount),
400 : #endif
401 :
402 : // @Group: BATT
403 : // @Path: ../libraries/AP_BattMonitor/AP_BattMonitor.cpp
404 : GOBJECT(battery, "BATT", AP_BattMonitor),
405 :
406 : // @Group: BRD_
407 : // @Path: ../libraries/AP_BoardConfig/AP_BoardConfig.cpp
408 : GOBJECT(BoardConfig, "BRD_", AP_BoardConfig),
409 :
410 : #if HAL_MAX_CAN_PROTOCOL_DRIVERS
411 : // @Group: CAN_
412 : // @Path: ../libraries/AP_CANManager/AP_CANManager.cpp
413 : GOBJECT(can_mgr, "CAN_", AP_CANManager),
414 : #endif
415 :
416 : #if HAL_SPRAYER_ENABLED
417 : // @Group: SPRAY_
418 : // @Path: ../libraries/AC_Sprayer/AC_Sprayer.cpp
419 : GOBJECT(sprayer, "SPRAY_", AC_Sprayer),
420 : #endif
421 :
422 : #if AP_SIM_ENABLED
423 : // @Group: SIM_
424 : // @Path: ../libraries/SITL/SITL.cpp
425 : GOBJECT(sitl, "SIM_", SITL::SIM),
426 : #endif
427 :
428 : // @Group: BARO
429 : // @Path: ../libraries/AP_Baro/AP_Baro.cpp
430 : GOBJECT(barometer, "BARO", AP_Baro),
431 :
432 : // GPS driver
433 : // @Group: GPS
434 : // @Path: ../libraries/AP_GPS/AP_GPS.cpp
435 : GOBJECT(gps, "GPS", AP_GPS),
436 :
437 : // @Group: SCHED_
438 : // @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
439 : GOBJECT(scheduler, "SCHED_", AP_Scheduler),
440 :
441 : // @Group: AVOID_
442 : // @Path: ../libraries/AC_Avoidance/AC_Avoid.cpp
443 : #if AP_AVOIDANCE_ENABLED
444 : GOBJECT(avoid, "AVOID_", AC_Avoid),
445 : #endif
446 :
447 : #if HAL_RALLY_ENABLED
448 : // @Group: RALLY_
449 : // @Path: AP_Rally.cpp,../libraries/AP_Rally/AP_Rally.cpp
450 : GOBJECT(rally, "RALLY_", AP_Rally_Copter),
451 : #endif
452 :
453 : #if FRAME_CONFIG == HELI_FRAME
454 : // @Group: H_
455 : // @Path: ../libraries/AP_Motors/AP_MotorsHeli_Single.cpp,../libraries/AP_Motors/AP_MotorsHeli_Dual.cpp,../libraries/AP_Motors/AP_MotorsHeli.cpp
456 : GOBJECTVARPTR(motors, "H_", &copter.motors_var_info),
457 : #else
458 : // @Group: MOT_
459 : // @Path: ../libraries/AP_Motors/AP_MotorsMulticopter.cpp
460 : GOBJECTVARPTR(motors, "MOT_", &copter.motors_var_info),
461 : #endif
462 :
463 : // @Group: RCMAP_
464 : // @Path: ../libraries/AP_RCMapper/AP_RCMapper.cpp
465 : GOBJECT(rcmap, "RCMAP_", RCMapper),
466 :
467 : #if HAL_NAVEKF2_AVAILABLE
468 : // @Group: EK2_
469 : // @Path: ../libraries/AP_NavEKF2/AP_NavEKF2.cpp
470 : GOBJECTN(ahrs.ekf2.EKF2, NavEKF2, "EK2_", NavEKF2),
471 : #endif
472 :
473 : #if HAL_NAVEKF3_AVAILABLE
474 : // @Group: EK3_
475 : // @Path: ../libraries/AP_NavEKF3/AP_NavEKF3.cpp
476 : GOBJECTN(ahrs.ekf3.EKF3, NavEKF3, "EK3_", NavEKF3),
477 : #endif
478 :
479 : #if MODE_AUTO_ENABLED
480 : // @Group: MIS_
481 : // @Path: ../libraries/AP_Mission/AP_Mission.cpp
482 : GOBJECTN(mode_auto.mission, mission, "MIS_", AP_Mission),
483 : #endif
484 :
485 : #if AP_RSSI_ENABLED
486 : // @Group: RSSI_
487 : // @Path: ../libraries/AP_RSSI/AP_RSSI.cpp
488 : GOBJECT(rssi, "RSSI_", AP_RSSI),
489 : #endif
490 :
491 : #if AP_RANGEFINDER_ENABLED
492 : // @Group: RNGFND
493 : // @Path: ../libraries/AP_RangeFinder/AP_RangeFinder.cpp
494 : GOBJECT(rangefinder, "RNGFND", RangeFinder),
495 : #endif
496 :
497 : #if AP_TERRAIN_AVAILABLE
498 : // @Group: TERRAIN_
499 : // @Path: ../libraries/AP_Terrain/AP_Terrain.cpp
500 : GOBJECT(terrain, "TERRAIN_", AP_Terrain),
501 : #endif
502 :
503 : #if AP_OPTICALFLOW_ENABLED
504 : // @Group: FLOW
505 : // @Path: ../libraries/AP_OpticalFlow/AP_OpticalFlow.cpp
506 : GOBJECT(optflow, "FLOW", AP_OpticalFlow),
507 : #endif
508 :
509 : #if AC_PRECLAND_ENABLED
510 : // @Group: PLND_
511 : // @Path: ../libraries/AC_PrecLand/AC_PrecLand.cpp
512 : GOBJECT(precland, "PLND_", AC_PrecLand),
513 : #endif
514 :
515 : #if HAL_ADSB_ENABLED
516 : // @Group: ADSB_
517 : // @Path: ../libraries/AP_ADSB/AP_ADSB.cpp
518 : GOBJECT(adsb, "ADSB_", AP_ADSB),
519 : #endif // HAL_ADSB_ENABLED
520 :
521 : #if AP_ADSB_AVOIDANCE_ENABLED
522 : // @Group: AVD_
523 : // @Path: ../libraries/AP_Avoidance/AP_Avoidance.cpp
524 : GOBJECT(avoidance_adsb, "AVD_", AP_Avoidance_Copter),
525 : #endif // AP_ADSB_AVOIDANCE_ENABLED
526 :
527 : // @Group: NTF_
528 : // @Path: ../libraries/AP_Notify/AP_Notify.cpp
529 : GOBJECT(notify, "NTF_", AP_Notify),
530 :
531 : #if MODE_THROW_ENABLED
532 : // @Param: THROW_MOT_START
533 : // @DisplayName: Start motors before throwing is detected
534 : // @Description: Used by Throw mode. Controls whether motors will run at the speed set by MOT_SPIN_MIN or will be stopped when armed and waiting for the throw.
535 : // @Values: 0:Stopped,1:Running
536 : // @User: Standard
537 : GSCALAR(throw_motor_start, "THROW_MOT_START", (float)ModeThrow::PreThrowMotorState::STOPPED),
538 :
539 : // @Param: THROW_ALT_MIN
540 : // @DisplayName: Throw mode minimum altitude
541 : // @Description: Minimum altitude above which Throw mode will detect a throw or a drop - 0 to disable the check
542 : // @Units: m
543 : // @User: Advanced
544 : GSCALAR(throw_altitude_min, "THROW_ALT_MIN", 0),
545 :
546 : // @Param: THROW_ALT_MAX
547 : // @DisplayName: Throw mode maximum altitude
548 : // @Description: Maximum altitude under which Throw mode will detect a throw or a drop - 0 to disable the check
549 : // @Units: m
550 : // @User: Advanced
551 : GSCALAR(throw_altitude_max, "THROW_ALT_MAX", 0),
552 :
553 : // @Param: THROW_ALT_DCSND
554 : // @DisplayName: Throw mode target altitude to descend
555 : // @Description: Target altitude to descend during a drop, (must be positive). This allows for rapidly clearing surrounding obstacles.
556 : // @Units: m
557 : // @User: Advanced
558 : GSCALAR(throw_altitude_descend, "THROW_ALT_DCSND", 1.0),
559 :
560 : // @Param: THROW_ALT_ACSND
561 : // @DisplayName: Throw mode target altitude to ascsend
562 : // @Description: Target altitude to ascend during a throw upwards (must be positive). This allows for rapidly clearing surrounding obstacles.
563 : // @Units: m
564 : // @User: Advanced
565 : GSCALAR(throw_altitude_ascend, "THROW_ALT_ACSND", 3.0),
566 : #endif
567 :
568 : #if OSD_ENABLED || OSD_PARAM_ENABLED
569 : // @Group: OSD
570 : // @Path: ../libraries/AP_OSD/AP_OSD.cpp
571 : GOBJECT(osd, "OSD", AP_OSD),
572 : #endif
573 :
574 : #if AC_CUSTOMCONTROL_MULTI_ENABLED
575 : // @Group: CC
576 : // @Path: ../libraries/AC_CustomControl/AC_CustomControl.cpp
577 : GOBJECT(custom_control, "CC", AC_CustomControl),
578 : #endif
579 :
580 : // @Group:
581 : // @Path: Parameters.cpp
582 : GOBJECT(g2, "", ParametersG2),
583 :
584 : // @Group:
585 : // @Path: ../libraries/AP_Vehicle/AP_Vehicle.cpp
586 : PARAM_VEHICLE_INFO,
587 :
588 : #if HAL_GCS_ENABLED
589 : // @Group: MAV
590 : // @Path: ../libraries/GCS_MAVLink/GCS.cpp
591 : GOBJECT(_gcs, "MAV", GCS),
592 : #endif
593 :
594 : AP_VAREND
595 : };
596 :
597 : /*
598 : 2nd group of parameters
599 : */
600 : const AP_Param::GroupInfo ParametersG2::var_info[] = {
601 :
602 : // @Param: WP_NAVALT_MIN
603 : // @DisplayName: Waypoint navigation altitude minimum
604 : // @Description: Altitude in meters above which navigation will begin during auto takeoff
605 : // @Units: m
606 : // @Range: 0 5
607 : // @User: Standard
608 : AP_GROUPINFO("WP_NAVALT_MIN", 1, ParametersG2, wp_navalt_min_m, 0),
609 :
610 : #if HAL_BUTTON_ENABLED
611 : // @Group: BTN_
612 : // @Path: ../libraries/AP_Button/AP_Button.cpp
613 : AP_SUBGROUPPTR(button_ptr, "BTN_", 2, ParametersG2, AP_Button),
614 : #endif
615 :
616 : #if MODE_THROW_ENABLED
617 : // @Param: THROW_NEXTMODE
618 : // @DisplayName: Throw mode's follow up mode
619 : // @Description: Vehicle will switch to this mode after the throw is successfully completed. Default is to stay in throw mode (18)
620 : // @Values: 3:Auto,4:Guided,5:LOITER,6:RTL,9:Land,17:Brake,18:Throw
621 : // @User: Standard
622 : AP_GROUPINFO("THROW_NEXTMODE", 3, ParametersG2, throw_nextmode, 18),
623 :
624 : // @Param: THROW_TYPE
625 : // @DisplayName: Type of Type
626 : // @Description: Used by Throw mode. Specifies whether Copter is thrown upward or dropped.
627 : // @Values: 0:Upward Throw,1:Drop
628 : // @User: Standard
629 : AP_GROUPINFO("THROW_TYPE", 4, ParametersG2, throw_type, (float)ModeThrow::ThrowType::Upward),
630 : #endif
631 :
632 : // 5 was GND_EFFECT_COMP, folded into AP_GroundEffect GNDEFF_ALT (<0 disables)
633 :
634 : #if AP_COPTER_ADVANCED_FAILSAFE_ENABLED
635 : // @Group: AFS_
636 : // @Path: ../libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp
637 : AP_SUBGROUPINFO(afs, "AFS_", 6, ParametersG2, AP_AdvancedFailsafe),
638 : #endif
639 :
640 : // @Param: DEV_OPTIONS
641 : // @DisplayName: Development options
642 : // @Description: Bitmask of developer options. The meanings of the bit fields in this parameter may vary at any time. Developers should check the source code for current meaning
643 : // @Bitmask: 0:ADSBMavlinkProcessing,1:DevOptionVFR_HUDRelativeAlt
644 : // @User: Advanced
645 : AP_GROUPINFO("DEV_OPTIONS", 7, ParametersG2, dev_options, 0),
646 :
647 : // 14 was AP_Beacon
648 :
649 : #if HAL_PROXIMITY_ENABLED
650 : // @Group: PRX
651 : // @Path: ../libraries/AP_Proximity/AP_Proximity.cpp
652 : AP_SUBGROUPINFO(proximity, "PRX", 8, ParametersG2, AP_Proximity),
653 : #endif
654 :
655 : // ACRO_Y_EXPO (9) moved to Command Model Class
656 :
657 : #if MODE_ACRO_ENABLED
658 : // @Param: ACRO_THR_MID
659 : // @DisplayName: Acro Thr Mid
660 : // @Description: Acro Throttle Mid
661 : // @Range: 0 1
662 : // @User: Advanced
663 : AP_GROUPINFO("ACRO_THR_MID", 10, ParametersG2, acro_thr_mid, ACRO_THR_MID_DEFAULT),
664 : #endif
665 :
666 : // 11 was SYSID_ENFORCE
667 :
668 : // 12 was AP_Stats
669 :
670 : // 13 was AP_Gripper
671 :
672 : // @Param: FRAME_CLASS
673 : // @DisplayName: Frame Class
674 : // @Description: Controls major frame class for multicopter component
675 : // @Values: 0:Undefined, 1:Quad, 2:Hexa, 3:Octa, 4:OctaQuad, 5:Y6, 6:Heli, 7:Tri, 8:SingleCopter, 9:CoaxCopter, 10:BiCopter, 11:Heli_Dual, 12:DodecaHexa, 13:HeliQuad, 14:Deca, 15:Scripting Matrix, 16:6DoF Scripting, 17:Dynamic Scripting Matrix
676 : // @User: Standard
677 : // @RebootRequired: True
678 : AP_GROUPINFO("FRAME_CLASS", 15, ParametersG2, frame_class, DEFAULT_FRAME_CLASS),
679 :
680 : // @Group: SERVO
681 : // @Path: ../libraries/SRV_Channel/SRV_Channels.cpp
682 : AP_SUBGROUPINFO(servo_channels, "SERVO", 16, ParametersG2, SRV_Channels),
683 :
684 : // @Group: RC
685 : // @Path: ../libraries/RC_Channel/RC_Channels_VarInfo.h
686 : AP_SUBGROUPINFO(rc_channels, "RC", 17, ParametersG2, RC_Channels_Copter),
687 :
688 : // 18 was used by AP_VisualOdom
689 :
690 : #if AP_TEMPCALIBRATION_ENABLED
691 : // @Group: TCAL
692 : // @Path: ../libraries/AP_TempCalibration/AP_TempCalibration.cpp
693 : AP_SUBGROUPINFO(temp_calibration, "TCAL", 19, ParametersG2, AP_TempCalibration),
694 : #endif
695 :
696 : #if TOY_MODE_ENABLED
697 : // @Group: TMODE
698 : // @Path: toy_mode.cpp
699 : AP_SUBGROUPINFO(toy_mode, "TMODE", 20, ParametersG2, ToyMode),
700 : #endif
701 :
702 : #if MODE_SMARTRTL_ENABLED
703 : // @Group: SRTL_
704 : // @Path: ../libraries/AP_SmartRTL/AP_SmartRTL.cpp
705 : AP_SUBGROUPINFO(smart_rtl, "SRTL_", 21, ParametersG2, AP_SmartRTL),
706 : #endif
707 :
708 : #if AP_WINCH_ENABLED
709 : // 22 was AP_WheelEncoder
710 :
711 : // @Group: WINCH
712 : // @Path: ../libraries/AP_Winch/AP_Winch.cpp
713 : AP_SUBGROUPINFO(winch, "WINCH", 23, ParametersG2, AP_Winch),
714 : #endif
715 :
716 : // 24 was PILOT_SPD_DN
717 :
718 : // 25 was LAND_ALT_LOW
719 :
720 : #if MODE_FLOWHOLD_ENABLED
721 : // @Group: FHLD
722 : // @Path: mode_flowhold.cpp
723 : AP_SUBGROUPPTR(mode_flowhold_ptr, "FHLD", 26, ParametersG2, ModeFlowHold),
724 : #endif
725 :
726 : #if MODE_FOLLOW_ENABLED
727 : // @Group: FOLL
728 : // @Path: ../libraries/AP_Follow/AP_Follow.cpp
729 : AP_SUBGROUPINFO(follow, "FOLL", 27, ParametersG2, AP_Follow),
730 : #endif
731 :
732 : #if USER_PARAMS_ENABLED
733 : AP_SUBGROUPINFO(user_parameters, "USR", 28, ParametersG2, UserParameters),
734 : #endif
735 :
736 : #if AUTOTUNE_ENABLED
737 : // @Group: AUTOTUNE_
738 : // @Path: ../libraries/AC_AutoTune/AC_AutoTune_Multi.cpp,../libraries/AC_AutoTune/AC_AutoTune_Heli.cpp
739 : AP_SUBGROUPPTR(autotune_ptr, "AUTOTUNE_", 29, ParametersG2, AutoTune),
740 : #endif
741 :
742 : // 30 was AP_Scripting
743 :
744 : #if AP_RC_TRANSMITTER_TUNING_ENABLED
745 : // @Param: TUNE_MIN
746 : // @DisplayName: Tuning minimum
747 : // @Description: Transmitter Tuning minum value. The parameter being tuned will have its value set to this minimum value when the tuning knob is at its lowest position
748 : // @User: Standard
749 : AP_GROUPINFO("TUNE_MIN", 31, ParametersG2, rc_tuning_min, 0),
750 :
751 : // @Param: TUNE_MAX
752 : // @DisplayName: Tuning maximum
753 : // @Description: Transmitter Tuning maximum value. The parameter being tuned will have its value set to this maximum value when the tuning knob is at its highest position
754 : // @User: Standard
755 : AP_GROUPINFO("TUNE_MAX", 32, ParametersG2, rc_tuning_max, 0),
756 : #endif // AP_RC_TRANSMITTER_TUNING_ENABLED
757 :
758 : #if AP_OAPATHPLANNER_ENABLED
759 : // @Group: OA_
760 : // @Path: ../libraries/AC_Avoidance/AP_OAPathPlanner.cpp
761 : AP_SUBGROUPINFO(oa, "OA_", 33, ParametersG2, AP_OAPathPlanner),
762 : #endif
763 :
764 : #if MODE_SYSTEMID_ENABLED
765 : // @Group: SID
766 : // @Path: mode_systemid.cpp
767 : AP_SUBGROUPPTR(mode_systemid_ptr, "SID", 34, ParametersG2, ModeSystemId),
768 : #endif
769 :
770 : // @Param: FS_VIBE_ENABLE
771 : // @DisplayName: Vibration Failsafe enable
772 : // @Description: This enables the vibration failsafe which will use modified altitude estimation and control during high vibrations
773 : // @Values: 0:Disabled, 1:Enabled
774 : // @User: Standard
775 : AP_GROUPINFO("FS_VIBE_ENABLE", 35, ParametersG2, fs_vibe_enabled, 1),
776 :
777 : // @Param: FS_OPTIONS
778 : // @DisplayName: Failsafe options bitmask
779 : // @Description: Bitmask of additional options for battery, radio, & GCS failsafes. 0 disables all options.
780 : // @Bitmask: 0:Continue if in Auto on RC failsafe, 1:Continue if in Auto on GCS failsafe, 2:Continue if in Guided on RC failsafe, 3:Continue if landing on any failsafe, 4:Continue if in pilot controlled modes on GCS failsafe, 5:Release Gripper
781 : // @User: Advanced
782 : AP_GROUPINFO("FS_OPTIONS", 36, ParametersG2, fs_options, (float)Copter::FailsafeOption::GCS_CONTINUE_IF_PILOT_CONTROL),
783 :
784 : #if MODE_AUTOROTATE_ENABLED
785 : // @Group: AROT_
786 : // @Path: ../libraries/AC_Autorotation/AC_Autorotation.cpp
787 : AP_SUBGROUPINFO(arot, "AROT_", 37, ParametersG2, AC_Autorotation),
788 : #endif
789 :
790 : #if MODE_ZIGZAG_ENABLED
791 : // @Group: ZIGZ_
792 : // @Path: mode_zigzag.cpp
793 : AP_SUBGROUPPTR(mode_zigzag_ptr, "ZIGZ_", 38, ParametersG2, ModeZigZag),
794 : #endif
795 :
796 : #if MODE_ACRO_ENABLED
797 : // @Param: ACRO_OPTIONS
798 : // @DisplayName: Acro mode options
799 : // @Description: A range of options that can be applied to change acro mode behaviour. Air-mode enables ATC_THR_MIX_MAN at all times (air-mode has no effect on helicopters). Rate Loop Only disables the use of angle stabilization and uses angular rate stabilization only.
800 : // @Bitmask: 0:Air-mode,1:Rate Loop Only
801 : // @User: Advanced
802 : AP_GROUPINFO("ACRO_OPTIONS", 39, ParametersG2, acro_options, 0),
803 : #endif
804 :
805 : #if MODE_AUTO_ENABLED
806 : // @Param: AUTO_OPTIONS
807 : // @DisplayName: Auto mode options
808 : // @Description: A range of options that can be applied to change auto mode behaviour. Allow Arming allows the copter to be armed in Auto. Allow Takeoff Without Raising Throttle allows takeoff without the pilot having to raise the throttle. Ignore pilot yaw overrides the pilot's yaw stick being used while in auto.
809 : // @Bitmask: 0:Allow Arming,1:Allow Takeoff Without Raising Throttle,2:Ignore pilot yaw,7:Allow weathervaning
810 : // @User: Advanced
811 : AP_GROUPINFO("AUTO_OPTIONS", 40, ParametersG2, auto_options, 0),
812 : #endif
813 :
814 : #if MODE_GUIDED_ENABLED
815 : // @Param: GUID_OPTIONS
816 : // @DisplayName: Guided mode options
817 : // @Description: Options that can be applied to change guided mode behaviour
818 : // @Bitmask: 0:Allow Arming from Transmitter,2:Ignore pilot yaw,3:SetAttitudeTarget interprets Thrust As Thrust,4:Do not stabilize PositionXY,5:Do not stabilize VelocityXY,6:Waypoint navigation used for position targets,7:Allow weathervaning
819 : // @User: Advanced
820 : AP_GROUPINFO("GUID_OPTIONS", 41, ParametersG2, guided_options, 0),
821 : #endif
822 :
823 : // @Param: FS_GCS_TIMEOUT
824 : // @DisplayName: GCS failsafe timeout
825 : // @Description: Timeout before triggering the GCS failsafe
826 : // @Units: s
827 : // @Range: 2 120
828 : // @Increment: 1
829 : // @User: Standard
830 : AP_GROUPINFO("FS_GCS_TIMEOUT", 42, ParametersG2, fs_gcs_timeout, 5),
831 :
832 : #if MODE_RTL_ENABLED
833 : // @Param: RTL_OPTIONS
834 : // @DisplayName: RTL mode options
835 : // @Description: Options that can be applied to change RTL mode behaviour
836 : // @Bitmask: 2:Ignore pilot yaw
837 : // @User: Advanced
838 : AP_GROUPINFO("RTL_OPTIONS", 43, ParametersG2, rtl_options, 0),
839 : #endif
840 :
841 : // @Param: FLIGHT_OPTIONS
842 : // @DisplayName: Flight mode options
843 : // @Description: Flight mode specific options
844 : // @Bitmask: 0:Disable thrust loss check, 1:Disable yaw imbalance warning, 2:Release gripper on thrust loss
845 : // @User: Advanced
846 : AP_GROUPINFO("FLIGHT_OPTIONS", 44, ParametersG2, flight_options, 0),
847 :
848 : #if AP_RANGEFINDER_ENABLED
849 : // @Param: RNGFND_FILT
850 : // @DisplayName: Rangefinder filter
851 : // @Description: Rangefinder filter to smooth distance. Set to zero to disable filtering
852 : // @Units: Hz
853 : // @Range: 0 5
854 : // @Increment: 0.05
855 : // @User: Standard
856 : // @RebootRequired: True
857 : AP_GROUPINFO("RNGFND_FILT", 45, ParametersG2, rangefinder_filt, RANGEFINDER_FILT_DEFAULT),
858 : #endif
859 :
860 : #if MODE_GUIDED_ENABLED
861 : // @Param: GUID_TIMEOUT
862 : // @DisplayName: Guided mode timeout
863 : // @Description: Guided mode timeout after which vehicle will stop or return to level if no updates are received from caller. Only applicable during any combination of velocity, acceleration, angle control, and/or angular rate control
864 : // @Units: s
865 : // @Range: 0.1 5
866 : // @User: Advanced
867 : AP_GROUPINFO("GUID_TIMEOUT", 46, ParametersG2, guided_timeout, 3.0),
868 : #endif
869 :
870 : // ACRO_PR_RATE (47), ACRO_Y_RATE (48), PILOT_Y_RATE (49) and PILOT_Y_EXPO (50) moved to command model class
871 :
872 : #if AP_RANGEFINDER_ENABLED
873 : // @Param: SURFTRAK_MODE
874 : // @DisplayName: Surface Tracking Mode
875 : // @Description: set which surface to track in surface tracking
876 : // @Values: 0:Do not track, 1:Ground, 2:Ceiling
877 : // @User: Advanced
878 : // @RebootRequired: True
879 : AP_GROUPINFO("SURFTRAK_MODE", 51, ParametersG2, surftrak_mode, (uint8_t)Copter::SurfaceTracking::Surface::GROUND),
880 : #endif
881 :
882 : // @Param: FS_DR_ENABLE
883 : // @DisplayName: DeadReckon Failsafe Action
884 : // @Description: Failsafe action taken immediately as deadreckoning starts. Deadreckoning starts when EKF loses position and velocity source and relies only on wind estimates
885 : // @Values: 0:Disabled/NoAction,1:Land, 2:RTL, 3:SmartRTL or RTL, 4:SmartRTL or Land, 6:Auto DO_LAND_START/DO_RETURN_PATH_START or RTL
886 : // @User: Standard
887 : AP_GROUPINFO("FS_DR_ENABLE", 52, ParametersG2, failsafe_dr_enable, (uint8_t)Copter::FailsafeAction::RTL),
888 :
889 : // @Param: FS_DR_TIMEOUT
890 : // @DisplayName: DeadReckon Failsafe Timeout
891 : // @Description: DeadReckoning is available for this many seconds after losing position and/or velocity source. After this timeout elapses the EKF failsafe will trigger in modes requiring a position estimate
892 : // @Range: 0 120
893 : // @User: Standard
894 : AP_GROUPINFO("FS_DR_TIMEOUT", 53, ParametersG2, failsafe_dr_timeout, 30),
895 :
896 : #if MODE_ACRO_ENABLED || MODE_SPORT_ENABLED
897 : // @Param: ACRO_RP_RATE
898 : // @DisplayName: Acro Roll and Pitch Rate
899 : // @Description: Acro mode maximum roll and pitch rate. Higher values mean faster rate of rotation
900 : // @Units: deg/s
901 : // @Range: 1 1080
902 : // @User: Standard
903 :
904 : // @Param: ACRO_RP_EXPO
905 : // @DisplayName: Acro Roll/Pitch Expo
906 : // @Description: Acro roll/pitch Expo to allow faster rotation when stick at edges
907 : // @Values: 0:Disabled,0.1:Very Low,0.2:Low,0.3:Medium,0.4:High,0.5:Very High
908 : // @Range: -0.5 0.95
909 : // @User: Advanced
910 :
911 : // @Param: ACRO_RP_RATE_TC
912 : // @DisplayName: Acro roll/pitch rate control input time constant
913 : // @Description: Acro roll and pitch rate control input time constant. Low numbers lead to sharper response, higher numbers to softer response
914 : // @Units: s
915 : // @Range: 0 1
916 : // @Increment: 0.01
917 : // @Values: 0.5:Very Soft, 0.2:Soft, 0.15:Medium, 0.1:Crisp, 0.05:Very Crisp
918 : // @User: Standard
919 : AP_SUBGROUPINFO(command_model_acro_rp, "ACRO_RP_", 54, ParametersG2, AC_CommandModel),
920 : #endif
921 :
922 : #if MODE_ACRO_ENABLED || MODE_DRIFT_ENABLED
923 : // @Param: ACRO_Y_RATE
924 : // @DisplayName: Acro Yaw Rate
925 : // @Description: Acro mode maximum yaw rate. Higher value means faster rate of rotation
926 : // @Units: deg/s
927 : // @Range: 1 360
928 : // @User: Standard
929 :
930 : // @Param: ACRO_Y_EXPO
931 : // @DisplayName: Acro Yaw Expo
932 : // @Description: Acro yaw expo to allow faster rotation when stick at edges
933 : // @Values: 0:Disabled,0.1:Very Low,0.2:Low,0.3:Medium,0.4:High,0.5:Very High
934 : // @Range: -1.0 0.95
935 : // @User: Advanced
936 :
937 : // @Param: ACRO_Y_RATE_TC
938 : // @DisplayName: Acro yaw rate control input time constant
939 : // @Description: Acro yaw rate control input time constant. Low numbers lead to sharper response, higher numbers to softer response
940 : // @Units: s
941 : // @Range: 0 1
942 : // @Increment: 0.01
943 : // @Values: 0.5:Very Soft, 0.2:Soft, 0.15:Medium, 0.1:Crisp, 0.05:Very Crisp
944 : // @User: Standard
945 : AP_SUBGROUPINFO(command_model_acro_y, "ACRO_Y_", 55, ParametersG2, AC_CommandModel),
946 : #endif
947 :
948 : // @Param: PILOT_Y_RATE
949 : // @DisplayName: Pilot controlled yaw rate
950 : // @Description: Pilot controlled yaw rate max. Used in all pilot controlled modes except Acro
951 : // @Units: deg/s
952 : // @Range: 1 360
953 : // @User: Standard
954 :
955 : // @Param: PILOT_Y_EXPO
956 : // @DisplayName: Pilot controlled yaw expo
957 : // @Description: Pilot controlled yaw expo to allow faster rotation when stick at edges
958 : // @Values: 0:Disabled,0.1:Very Low,0.2:Low,0.3:Medium,0.4:High,0.5:Very High
959 : // @Range: -0.5 1.0
960 : // @User: Advanced
961 :
962 : // @Param: PILOT_Y_RATE_TC
963 : // @DisplayName: Pilot yaw rate control input time constant
964 : // @Description: Pilot yaw rate control input time constant. Low numbers lead to sharper response, higher numbers to softer response
965 : // @Units: s
966 : // @Range: 0 1
967 : // @Increment: 0.01
968 : // @Values: 0.5:Very Soft, 0.2:Soft, 0.15:Medium, 0.1:Crisp, 0.05:Very Crisp
969 : // @User: Standard
970 : AP_SUBGROUPINFO(command_model_pilot_y, "PILOT_Y_", 56, ParametersG2, AC_CommandModel),
971 :
972 : // @Param: TKOFF_SLEW_TIME
973 : // @DisplayName: Slew time of throttle during take-off
974 : // @Description: Time to slew the throttle from minimum to maximum while checking for a successful takeoff.
975 : // @Units: s
976 : // @Range: 0.25 5.0
977 : // @User: Standard
978 : AP_GROUPINFO("TKOFF_SLEW_TIME", 57, ParametersG2, takeoff_throttle_slew_time, 2.0),
979 :
980 : #if HAL_WITH_ESC_TELEM && FRAME_CONFIG != HELI_FRAME
981 : // @Param: TKOFF_RPM_MIN
982 : // @DisplayName: Takeoff Check RPM minimum
983 : // @Description: Takeoff is not permitted until motors report at least this RPM. Set to zero to disable check
984 : // @Range: 0 10000
985 : // @User: Standard
986 : AP_GROUPINFO("TKOFF_RPM_MIN", 58, ParametersG2, takeoff_rpm_min, 0),
987 : #endif
988 :
989 : #if WEATHERVANE_ENABLED
990 : // @Group: WVANE_
991 : // @Path: ../libraries/AC_AttitudeControl/AC_WeatherVane.cpp
992 : AP_SUBGROUPINFO(weathervane, "WVANE_", 59, ParametersG2, AC_WeatherVane),
993 : #endif
994 :
995 : // ID 60 is reserved for the SHIP_OPS
996 :
997 : // extend to a new group
998 : AP_SUBGROUPEXTENSION("", 61, ParametersG2, var_info2),
999 :
1000 : // ID 62 is reserved for the SHOW_... parameters from the Skybrush fork at
1001 : // https://github.com/skybrush-io/ardupilot
1002 :
1003 : AP_GROUPEND
1004 : };
1005 :
1006 : /*
1007 : extension to g2 parameters
1008 : */
1009 : const AP_Param::GroupInfo ParametersG2::var_info2[] = {
1010 :
1011 : #if AC_PAYLOAD_PLACE_ENABLED
1012 : // @Param: PLDP_THRESH
1013 : // @DisplayName: Payload Place thrust ratio threshold
1014 : // @Description: Ratio of vertical thrust during decent below which payload touchdown will trigger.
1015 : // @Range: 0.5 0.9
1016 : // @User: Standard
1017 : AP_GROUPINFO("PLDP_THRESH", 1, ParametersG2, pldp_thrust_placed_fraction, 0.9),
1018 :
1019 : // @Param: PLDP_RNG_MAX
1020 : // @DisplayName: Payload Place maximum range finder altitude
1021 : // @Description: Maximum range finder altitude in m to trigger payload touchdown, set to zero to disable.
1022 : // @Units: m
1023 : // @Range: 0 100
1024 : // @User: Standard
1025 : AP_GROUPINFO("PLDP_RNG_MAX", 2, ParametersG2, pldp_range_finder_maximum_m, 0.0),
1026 :
1027 : // @Param: PLDP_DELAY
1028 : // @DisplayName: Payload Place climb delay
1029 : // @Description: Delay after release, in seconds, before aircraft starts to climb back to starting altitude.
1030 : // @Units: s
1031 : // @Range: 0 120
1032 : // @User: Standard
1033 : AP_GROUPINFO("PLDP_DELAY", 3, ParametersG2, pldp_delay_s, 0.0),
1034 :
1035 : // @Param: PLDP_SPEED_DN
1036 : // @DisplayName: Payload Place decent speed
1037 : // @Description: The maximum vertical decent velocity in m/s. If 0 LAND_SPD_MS value is used.
1038 : // @Units: m/s
1039 : // @Range: 0 5
1040 : // @User: Standard
1041 : AP_GROUPINFO("PLDP_SPEED_DN", 4, ParametersG2, pldp_descent_speed_ms, 0.0),
1042 : #endif // AC_PAYLOAD_PLACE_ENABLED
1043 :
1044 : // @Param: SURFTRAK_TC
1045 : // @DisplayName: Surface Tracking Filter Time Constant
1046 : // @Description: Time to achieve 63.2% of the surface altitude measurement change. If 0 filtering is disabled
1047 : // @Units: s
1048 : // @Range: 0 5
1049 : // @User: Advanced
1050 : AP_GROUPINFO("SURFTRAK_TC", 5, ParametersG2, surftrak_tc, 1.0),
1051 :
1052 : // @Param: TKOFF_THR_MAX
1053 : // @DisplayName: Takeoff maximum throttle during take-off ramp up
1054 : // @Description: Takeoff maximum throttle allowed before controllers assume the aircraft is airborne during the takeoff process.
1055 : // @Range: 0.0 0.9
1056 : // @User: Advanced
1057 : AP_GROUPINFO("TKOFF_THR_MAX", 6, ParametersG2, takeoff_throttle_max, 0.9),
1058 :
1059 : #if HAL_WITH_ESC_TELEM && FRAME_CONFIG != HELI_FRAME
1060 : // @Param: TKOFF_RPM_MAX
1061 : // @DisplayName: Takeoff Check RPM maximum
1062 : // @Description: Takeoff is not permitted until motors report no more than this RPM. Set to zero to disable check
1063 : // @Range: 0 10000
1064 : // @User: Standard
1065 : AP_GROUPINFO("TKOFF_RPM_MAX", 7, ParametersG2, takeoff_rpm_max, 0),
1066 : #endif
1067 :
1068 : #if AP_GROUNDEFFECT_ENABLED
1069 : // @Group: GNDEFF_
1070 : // @Path: ../libraries/AP_GroundEffect/AP_GroundEffect.cpp
1071 : AP_SUBGROUPINFO(ground_effect, "GNDEFF_", 24, ParametersG2, AP_GroundEffect),
1072 : #endif
1073 :
1074 : // @Param: FS_EKF_FILT
1075 : // @DisplayName: EKF Failsafe filter cutoff
1076 : // @Description: EKF Failsafe filter cutoff frequency. EKF variances are filtered using this value to avoid spurious failsafes from transient high variances. A higher value means the failsafe is more likely to trigger.
1077 : // @Range: 0 10
1078 : // @Units: Hz
1079 : // @User: Advanced
1080 : AP_GROUPINFO("FS_EKF_FILT", 8, ParametersG2, fs_ekf_filt_hz, FS_EKF_FILT_DEFAULT),
1081 :
1082 : #if AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED
1083 : // @Param: FSTRATE_ENABLE
1084 : // @DisplayName: Enable the fast Rate thread
1085 : // @Description: Enable the fast Rate thread. In the default case the fast rate divisor, which controls the update frequency of the thread, is dynamically scaled from FSTRATE_DIV to avoid overrun in the gyro sample buffer and main loop slow-downs. Other values can be selected to fix the divisor to FSTRATE_DIV on arming or always.
1086 : // @User: Advanced
1087 : // @Values: 0:Disabled,1:Enabled-Dynamic,2:Enabled-FixedWhenArmed,3:Enabled-Fixed
1088 : AP_GROUPINFO("FSTRATE_ENABLE", 9, ParametersG2, att_enable, 0),
1089 :
1090 : // @Param: FSTRATE_DIV
1091 : // @DisplayName: Fast rate thread divisor
1092 : // @Description: Fast rate thread divisor used to control the maximum fast rate update rate. The actual rate is the gyro rate in Hz divided by this value. This value is scaled depending on the configuration of FSTRATE_ENABLE.
1093 : // @User: Advanced
1094 : // @Range: 1 10
1095 : AP_GROUPINFO("FSTRATE_DIV", 10, ParametersG2, att_decimation, 1),
1096 : #endif
1097 :
1098 : #if AP_RC_TRANSMITTER_TUNING_ENABLED
1099 : // @Param: TUNE2_MIN
1100 : // @DisplayName: Tuning minimum
1101 : // @Description: Minimum value that the parameter currently being tuned with the transmitter's TRANSMITTER_TUNING2 knob will be set to
1102 : // @User: Standard
1103 : AP_GROUPINFO("TUNE2_MIN", 11, ParametersG2, rc_tuning2_min, 0),
1104 :
1105 : // @Param: TUNE2_MAX
1106 : // @DisplayName: Tuning maximum
1107 : // @Description: Maximum value that the parameter currently being tuned with the transmitter's TRANSMITTER2_TUNING knob will be set to
1108 : // @User: Standard
1109 : AP_GROUPINFO("TUNE2_MAX", 12, ParametersG2, rc_tuning2_max, 0),
1110 :
1111 : // @Param: TUNE2
1112 : // @CopyFieldsFrom: TUNE
1113 : // @DisplayName: Tuning Parameter for TRANSMITTER_TUNE2
1114 : // @Description: Selects parameter (normally a PID gain) that is being tuned with an RC transmitter's knob. The RC input channel used is assigned by setting RCx_OPTION to 220.
1115 : AP_GROUPINFO("TUNE2", 13, ParametersG2, rc_tuning2_param, 0),
1116 : #endif // AP_RC_TRANSMITTER_TUNING_ENABLED
1117 :
1118 : #if MODE_RTL_ENABLED
1119 : // @Group: RTL_
1120 : // @Path: mode_rtl.cpp
1121 : AP_SUBGROUPPTR(mode_rtl_ptr, "RTL_", 14, ParametersG2, ModeRTL),
1122 : #endif
1123 :
1124 : // @Group: LAND_
1125 : // @Path: mode_land.cpp
1126 : AP_SUBGROUPPTR(mode_land_ptr, "LAND_", 15, ParametersG2, ModeLand),
1127 :
1128 : #if MODE_POSHOLD_ENABLED
1129 : // @Group: PHLD_
1130 : // @Path: mode_poshold.cpp
1131 : AP_SUBGROUPPTR(mode_poshold_ptr, "PHLD_", 16, ParametersG2, ModePosHold),
1132 : #endif
1133 :
1134 : // @Param: PILOT_ACC_Z
1135 : // @DisplayName: Pilot vertical acceleration
1136 : // @Description: The vertical acceleration used when pilot is controlling the altitude
1137 : // @Units: m/s/s
1138 : // @Range: 0.5 5
1139 : // @Increment: 0.1
1140 : // @User: Standard
1141 : AP_GROUPINFO("PILOT_ACC_Z", 17, ParametersG2, pilot_accel_d_mss, PILOT_ACC_Z_DEFAULT),
1142 :
1143 : // @Param: PILOT_SPD_UP
1144 : // @DisplayName: Pilot maximum vertical speed ascending
1145 : // @Description: The maximum vertical ascending velocity the pilot may request in m/s
1146 : // @Units: m/s
1147 : // @Range: 0.5 5
1148 : // @Increment: 0.1
1149 : // @User: Standard
1150 : AP_GROUPINFO("PILOT_SPD_UP", 18, ParametersG2, pilot_speed_up_ms, PILOT_SPD_UP_DEFAULT),
1151 :
1152 : // @Param: PILOT_SPD_DN
1153 : // @DisplayName: Pilot maximum vertical speed descending
1154 : // @Description: The maximum vertical descending velocity the pilot may request in m/s. If 0 PILOT_SPD_UP value is used.
1155 : // @Units: m/s
1156 : // @Range: 0 5
1157 : // @Increment: 0.1
1158 : // @User: Standard
1159 : AP_GROUPINFO("PILOT_SPD_DN", 19, ParametersG2, pilot_speed_dn_ms, 0),
1160 :
1161 : // @Param: PILOT_TKO_ALT_M
1162 : // @DisplayName: Pilot takeoff altitude
1163 : // @Description: Altitude that altitude control modes will climb to when a takeoff is triggered with the throttle stick.
1164 : // @User: Standard
1165 : // @Units: m
1166 : // @Range: 0.0 10.0
1167 : // @Increment: 0.1
1168 : AP_GROUPINFO("PILOT_TKO_ALT_M", 20, ParametersG2, pilot_takeoff_alt_m, PILOT_TKO_ALT_M_DEFAULT),
1169 :
1170 : #if AP_RANGEFINDER_ENABLED
1171 : // @Param: SURFTRAK_GLDST
1172 : // @DisplayName: Surface Tracking Glitch threshold
1173 : // @Description: When a rangefinder reading differs from the previous by more than this, it will be considered a glitch and will not be used. A value of zero disables this check.
1174 : // @Units: m
1175 : // @Range: 0 100
1176 : // @User: Advanced
1177 : // @RebootRequired: True
1178 : AP_GROUPINFO("SURFTRAK_GLDST", 21, ParametersG2, surf_dist_parameters.glitch_alt, AP_SURFACEDISTANCE_GLITCH_ALT_M_DEFAULT),
1179 :
1180 : // @Param: SURFTRAK_GLSAM
1181 : // @DisplayName: Surface Tracking glitched sample count
1182 : // @Description: When this many consecutive samples are considered a glitch, we give up and accept the new reading. A value of zero disables this behaviour and glitched values are never accepted.
1183 : // @Range: 0 10
1184 : // @User: Advanced
1185 : // @RebootRequired: True
1186 : AP_GROUPINFO("SURFTRAK_GLSAM", 22, ParametersG2, surf_dist_parameters.glitch_num_samples, AP_SURFACEDISTANCE_GLITCH_NUM_SAMPLES_DEFAULT),
1187 : #endif
1188 :
1189 : #if MODE_FLIP_ENABLED
1190 : // @Group: FLIP_
1191 : // @Path: mode_flip.cpp
1192 : AP_SUBGROUPPTR(mode_flip_ptr, "FLIP_", 23, ParametersG2, ModeFlip),
1193 : #endif
1194 :
1195 : // ID 62 is reserved for the AP_SUBGROUPEXTENSION
1196 :
1197 : AP_GROUPEND
1198 : };
1199 :
1200 : /*
1201 : constructor for g2 object
1202 : */
1203 1001 : ParametersG2::ParametersG2(void) :
1204 1001 : unused_integer{17}
1205 : #if HAL_BUTTON_ENABLED
1206 1001 : ,button_ptr(&copter.button)
1207 : #endif
1208 : #if AP_TEMPCALIBRATION_ENABLED
1209 1001 : , temp_calibration()
1210 : #endif
1211 : #if HAL_PROXIMITY_ENABLED
1212 1001 : , proximity()
1213 : #endif
1214 : #if AP_COPTER_ADVANCED_FAILSAFE_ENABLED
1215 : ,afs()
1216 : #endif
1217 : #if MODE_SMARTRTL_ENABLED
1218 1001 : ,smart_rtl()
1219 : #endif
1220 : #if USER_PARAMS_ENABLED
1221 : ,user_parameters()
1222 : #endif
1223 : #if MODE_FLOWHOLD_ENABLED
1224 1001 : ,mode_flowhold_ptr(&copter.mode_flowhold)
1225 : #endif
1226 : #if MODE_FOLLOW_ENABLED
1227 1001 : ,follow()
1228 : #endif
1229 : #if AUTOTUNE_ENABLED
1230 1001 : ,autotune_ptr(&copter.mode_autotune.autotune)
1231 : #endif
1232 : #if MODE_SYSTEMID_ENABLED
1233 1001 : ,mode_systemid_ptr(&copter.mode_systemid)
1234 : #endif
1235 : #if MODE_AUTOROTATE_ENABLED
1236 83 : ,arot(copter.motors, copter.attitude_control)
1237 : #endif
1238 : #if MODE_ZIGZAG_ENABLED
1239 1001 : ,mode_zigzag_ptr(&copter.mode_zigzag)
1240 : #endif
1241 : #if MODE_ACRO_ENABLED || MODE_SPORT_ENABLED
1242 1001 : ,command_model_acro_rp(ACRO_RP_RATE_DEFAULT, ACRO_RP_EXPO_DEFAULT, 0.0f)
1243 : #endif
1244 :
1245 : #if MODE_ACRO_ENABLED || MODE_DRIFT_ENABLED
1246 1001 : ,command_model_acro_y(ACRO_Y_RATE_DEFAULT, ACRO_Y_EXPO_DEFAULT, 0.0f)
1247 : #endif
1248 :
1249 1001 : ,command_model_pilot_y(PILOT_Y_RATE_DEFAULT, PILOT_Y_EXPO_DEFAULT, 0.0f)
1250 :
1251 : #if WEATHERVANE_ENABLED
1252 1001 : ,weathervane()
1253 : #endif
1254 : #if MODE_RTL_ENABLED
1255 1001 : ,mode_rtl_ptr(&copter.mode_rtl)
1256 : #endif
1257 1001 : ,mode_land_ptr(&copter.mode_land)
1258 : #if MODE_POSHOLD_ENABLED
1259 1001 : ,mode_poshold_ptr(&copter.mode_poshold)
1260 : #endif
1261 :
1262 : #if MODE_FLIP_ENABLED
1263 6006 : ,mode_flip_ptr(&copter.mode_flip)
1264 : #endif
1265 :
1266 : {
1267 1001 : AP_Param::setup_object_defaults(this, var_info);
1268 1001 : AP_Param::setup_object_defaults(this, var_info2);
1269 1001 : }
1270 :
1271 1001 : void Copter::load_parameters(void)
1272 : {
1273 1001 : AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version);
1274 :
1275 : // PARAMETER_CONVERSION - Added: Jul-2025 for ArduPilot-4.7
1276 : #if AP_RPM_ENABLED
1277 1001 : AP_Param::convert_class(g.k_param_rpm_sensor_old, &rpm_sensor, rpm_sensor.var_info, 0, true, true);
1278 : #endif
1279 :
1280 : static const AP_Param::G2ObjectConversion g2_conversions[] {
1281 : #if AP_STATS_ENABLED
1282 : // PARAMETER_CONVERSION - Added: Jan-2024 for Copter-4.6
1283 1001 : { &stats, stats.var_info, 12 },
1284 : #endif
1285 : #if AP_SCRIPTING_ENABLED
1286 : // PARAMETER_CONVERSION - Added: Jan-2024 for Copter-4.6
1287 1001 : { &scripting, scripting.var_info, 30 },
1288 : #endif
1289 : #if AP_GRIPPER_ENABLED
1290 : // PARAMETER_CONVERSION - Added: Feb-2024 for Copter-4.6
1291 1001 : { &gripper, gripper.var_info, 13 },
1292 : #endif
1293 : #if AP_BEACON_ENABLED
1294 : // PARAMETER_CONVERSION - Added: Jun-2026 for Copter-4.8
1295 1001 : { &beacon, beacon.var_info, 14 },
1296 : #endif // AP_BEACON_ENABLED
1297 1001 : };
1298 :
1299 1001 : AP_Param::convert_g2_objects(&g2, g2_conversions, ARRAY_SIZE(g2_conversions));
1300 :
1301 : // PARAMETER_CONVERSION - Added: Feb-2024 for Copter-4.6
1302 : #if HAL_LOGGING_ENABLED
1303 1001 : AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, true);
1304 : #endif
1305 :
1306 : static const AP_Param::TopLevelObjectConversion toplevel_conversions[] {
1307 : #if AP_SERIALMANAGER_ENABLED
1308 : // PARAMETER_CONVERSION - Added: Feb-2024 for Copter-4.6
1309 1001 : { &serial_manager, serial_manager.var_info, Parameters::k_param_serial_manager_old },
1310 : #endif
1311 1001 : };
1312 :
1313 1001 : AP_Param::convert_toplevel_objects(toplevel_conversions, ARRAY_SIZE(toplevel_conversions));
1314 :
1315 : #if HAL_GCS_ENABLED
1316 : // Move parameters into new MAV_ parameter namespace
1317 : // PARAMETER_CONVERSION - Added: Mar-2025 for ArduPilot-4.7
1318 : {
1319 1001 : const AP_Param::ConversionInfo gcs_conversion_info[] {
1320 : { Parameters::k_param_sysid_this_mav_old, 0, AP_PARAM_INT16, "MAV_SYSID" },
1321 : { Parameters::k_param_sysid_my_gcs_old, 0, AP_PARAM_INT16, "MAV_GCS_SYSID" },
1322 : { Parameters::k_param_g2, 11, AP_PARAM_INT8, "MAV_OPTIONS" },
1323 : { Parameters::k_param_telem_delay_old, 0, AP_PARAM_INT8, "MAV_TELEM_DELAY" },
1324 : };
1325 1001 : AP_Param::convert_old_parameters(&gcs_conversion_info[0], ARRAY_SIZE(gcs_conversion_info));
1326 : }
1327 : #endif // HAL_GCS_ENABLED
1328 :
1329 : #if MODE_RTL_ENABLED
1330 : // convert RTL parameters
1331 1001 : copter.mode_rtl.convert_params();
1332 : #endif
1333 :
1334 : // convert LAND parameters
1335 1001 : copter.mode_land.convert_params();
1336 :
1337 : #if MODE_POSHOLD_ENABLED
1338 : // convert PosHold parameters
1339 1001 : copter.mode_poshold.convert_params();
1340 : #endif
1341 :
1342 : #if AP_AVOIDANCE_ENABLED
1343 : // convert AC_Avoid parameters
1344 1001 : copter.avoid.convert_params();
1345 : #endif
1346 :
1347 : // convert PILOT vertical speed and acceleration parameters
1348 : // PARAMETER_CONVERSION - Added: Feb-2026 for ArduPilot-4.7
1349 : {
1350 : static const AP_Param::ConversionInfo pilot_conversion_info[] = {
1351 : { Parameters::k_param_pilot_speed_up_cms, 0, AP_PARAM_INT16, "PILOT_SPD_UP" }, // PILOT_SPEED_UP moved to PILOT_SPD_UP
1352 : { Parameters::k_param_pilot_accel_d_cmss, 0, AP_PARAM_INT16, "PILOT_ACC_Z" }, // PILOT_ACCEL_Z moved to PILOT_ACC_Z
1353 : { Parameters::k_param_pilot_takeoff_alt_cm, 0, AP_PARAM_FLOAT, "PILOT_TKO_ALT_M" }, // PILOT_TKOFF_ALT moved to PILOT_TKO_ALT_M
1354 : { Parameters::k_param_g2, 24, AP_PARAM_INT16, "PILOT_SPD_DN" }, // PILOT_SPEED_DN moved to PILOT_SPD_DN
1355 : };
1356 1001 : AP_Param::convert_old_parameters_scaled(pilot_conversion_info, ARRAY_SIZE(pilot_conversion_info), 0.01, 0);
1357 : }
1358 :
1359 : #if AP_GROUNDEFFECT_ENABLED
1360 : // a stored GND_EFFECT_COMP=0 becomes GNDEFF_ALT=-1; the enabled default needs no migration
1361 : // PARAMETER_CONVERSION - Added: Aug-2026 for Copter-4.8
1362 : {
1363 1001 : AP_Int8 old_gndeff;
1364 1001 : const AP_Param::ConversionInfo info = {
1365 : Parameters::k_param_g2, 5, AP_PARAM_INT8, nullptr
1366 : };
1367 1001 : if (AP_Param::find_old_parameter(&info, &old_gndeff) && old_gndeff.get() == 0) {
1368 : enum ap_var_type ptype;
1369 0 : AP_Param *p = AP_Param::find("GNDEFF_ALT", &ptype);
1370 0 : if (p != nullptr && ptype == AP_PARAM_FLOAT && !p->configured()) {
1371 0 : ((AP_Float *)p)->set_and_save(-1.0f);
1372 : }
1373 : }
1374 : }
1375 : #endif // AP_GROUNDEFFECT_ENABLED
1376 :
1377 : // setup AP_Param frame type flags
1378 1001 : AP_Param::set_frame_type_flags(AP_PARAM_FRAME_COPTER);
1379 1001 : }
|