2016-02-17 21:26:00 -04:00
|
|
|
#pragma once
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2023-01-03 21:39:14 -04:00
|
|
|
#define AP_PARAM_VEHICLE_NAME plane
|
|
|
|
|
2015-08-11 03:28:40 -03:00
|
|
|
#include <AP_Common/AP_Common.h>
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// Global parameter class.
|
|
|
|
//
|
|
|
|
class Parameters {
|
|
|
|
public:
|
2012-06-14 22:54:13 -03:00
|
|
|
|
|
|
|
/*
|
2012-08-21 23:19:51 -03:00
|
|
|
* The value of k_format_version determines whether the existing
|
|
|
|
* eeprom data is considered valid. You should only change this
|
|
|
|
* value under the following circumstances:
|
|
|
|
*
|
|
|
|
* 1) the meaning of an existing eeprom parameter changes
|
|
|
|
*
|
|
|
|
* 2) the value of an existing k_param_* enum value changes
|
|
|
|
*
|
|
|
|
* Adding a new parameter should _not_ require a change to
|
|
|
|
* k_format_version except under special circumstances. If you
|
|
|
|
* change it anyway then all ArduPlane users will need to reload all
|
|
|
|
* their parameters. We want that to be an extremely rare
|
|
|
|
* thing. Please do not just change it "just in case".
|
|
|
|
*
|
|
|
|
* To determine if a k_param_* value has changed, use the rules of
|
|
|
|
* C++ enums to work out the value of the neighboring enum
|
|
|
|
* values. If you don't know the C++ enum rules then please ask for
|
|
|
|
* help.
|
|
|
|
*/
|
2012-06-14 22:54:13 -03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// STOP!!! DO NOT CHANGE THIS VALUE UNTIL YOU FULLY UNDERSTAND THE
|
|
|
|
// COMMENTS ABOVE. IF UNSURE, ASK ANOTHER DEVELOPER!!!
|
2012-06-13 16:28:13 -03:00
|
|
|
static const uint16_t k_format_version = 13;
|
2012-06-14 22:54:13 -03:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
enum {
|
|
|
|
// Layout version number, always key zero.
|
|
|
|
//
|
|
|
|
k_param_format_version = 0,
|
2018-06-01 22:21:50 -03:00
|
|
|
k_param_software_type, // unused;
|
2023-06-19 19:24:36 -03:00
|
|
|
k_param_num_resets, // unused
|
2016-05-24 23:42:02 -03:00
|
|
|
k_param_NavEKF2,
|
2016-07-21 21:28:17 -03:00
|
|
|
k_param_g2,
|
2016-08-12 18:28:21 -03:00
|
|
|
k_param_avoidance_adsb,
|
2016-11-23 05:31:53 -04:00
|
|
|
k_param_landing,
|
2016-08-14 06:46:24 -03:00
|
|
|
k_param_NavEKF3,
|
2020-05-31 08:49:22 -03:00
|
|
|
k_param_can_mgr,
|
2018-06-23 04:35:28 -03:00
|
|
|
k_param_osd,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// Misc
|
|
|
|
//
|
2021-09-21 18:19:19 -03:00
|
|
|
k_param_auto_trim = 10, // unused
|
2014-01-13 21:52:22 -04:00
|
|
|
k_param_log_bitmask_old, // unused
|
2024-01-19 19:58:32 -04:00
|
|
|
k_param_pitch_trim,
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_mix_mode,
|
2017-07-01 08:14:46 -03:00
|
|
|
k_param_reverse_elevons, // unused
|
|
|
|
k_param_reverse_ch1_elevon, // unused
|
|
|
|
k_param_reverse_ch2_elevon, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_flap_1_percent,
|
|
|
|
k_param_flap_1_speed,
|
|
|
|
k_param_flap_2_percent,
|
|
|
|
k_param_flap_2_speed,
|
2021-03-14 20:42:57 -03:00
|
|
|
k_param_reset_switch_chan, // unused - moved to RC option
|
2013-04-29 01:19:53 -03:00
|
|
|
k_param_manual_level, // unused
|
2016-11-23 05:33:41 -04:00
|
|
|
k_param_land_pitch_cd, // unused - moved to AP_Landing
|
2012-11-07 02:20:22 -04:00
|
|
|
k_param_ins_old, // *** Deprecated, remove with next eeprom number change
|
2012-08-08 19:53:29 -03:00
|
|
|
k_param_stick_mixing,
|
2021-03-12 17:50:37 -04:00
|
|
|
k_param_reset_mission_chan, // unused - moved to RC option
|
2016-11-23 05:33:41 -04:00
|
|
|
k_param_land_flare_alt, // unused - moved to AP_Landing
|
|
|
|
k_param_land_flare_sec, // unused - moved to AP_Landing
|
2013-04-11 21:25:46 -03:00
|
|
|
k_param_crosstrack_min_distance, // unused
|
2013-04-12 07:27:56 -03:00
|
|
|
k_param_rudder_steer, // unused
|
2012-09-09 06:36:35 -03:00
|
|
|
k_param_throttle_nudge,
|
2012-09-19 03:22:53 -03:00
|
|
|
k_param_alt_offset,
|
2012-11-07 02:20:22 -04:00
|
|
|
k_param_ins, // libraries/AP_InertialSensor variables
|
2013-02-09 07:40:16 -04:00
|
|
|
k_param_takeoff_throttle_min_speed,
|
2013-03-08 23:41:04 -04:00
|
|
|
k_param_takeoff_throttle_min_accel,
|
2013-04-12 07:27:56 -03:00
|
|
|
k_param_takeoff_heading_hold, // unused
|
|
|
|
k_param_level_roll_limit,
|
2021-06-09 08:31:35 -03:00
|
|
|
k_param_hil_servos_unused, // unused
|
2017-07-06 01:14:00 -03:00
|
|
|
k_param_vtail_output, // unused
|
2021-09-04 12:49:58 -03:00
|
|
|
k_param_nav_controller, // unused
|
2017-07-06 01:14:00 -03:00
|
|
|
k_param_elevon_output, // unused
|
2021-09-04 13:08:24 -03:00
|
|
|
k_param_att_controller, // unused
|
2013-05-25 05:27:57 -03:00
|
|
|
k_param_mixing_gain,
|
2013-06-04 00:34:58 -03:00
|
|
|
k_param_scheduler,
|
2013-06-24 09:40:10 -03:00
|
|
|
k_param_relay,
|
2013-06-26 05:36:53 -03:00
|
|
|
k_param_takeoff_throttle_delay,
|
2019-05-04 06:56:07 -03:00
|
|
|
k_param_mode_takeoff, // was skip_gyro_cal
|
2021-09-09 20:19:49 -03:00
|
|
|
k_param_auto_fbw_steer, // unused
|
2013-09-13 04:43:00 -03:00
|
|
|
k_param_waypoint_max_radius,
|
2013-10-03 09:01:43 -03:00
|
|
|
k_param_ground_steer_alt,
|
|
|
|
k_param_ground_steer_dps,
|
2014-04-18 16:19:13 -03:00
|
|
|
k_param_rally_limit_km_old, //unused anymore -- just holding this index
|
2021-06-09 08:31:35 -03:00
|
|
|
k_param_hil_err_limit_unused, // unused
|
2014-06-27 00:05:14 -03:00
|
|
|
k_param_sonar_old, // unused
|
2014-01-13 21:52:22 -04:00
|
|
|
k_param_log_bitmask,
|
2014-01-19 21:58:49 -04:00
|
|
|
k_param_BoardConfig,
|
2015-08-28 03:01:32 -03:00
|
|
|
k_param_rssi_range, // unused, replaced by rssi_ library parameters
|
2019-12-13 19:25:01 -04:00
|
|
|
k_param_flapin_channel_old, // unused, moved to RC_OPTION
|
2017-06-10 19:44:47 -03:00
|
|
|
k_param_flaperon_output, // unused
|
2014-03-28 16:52:48 -03:00
|
|
|
k_param_gps,
|
2014-04-13 09:12:27 -03:00
|
|
|
k_param_autotune_level,
|
2014-04-18 16:19:13 -03:00
|
|
|
k_param_rally,
|
2015-01-23 09:45:24 -04:00
|
|
|
k_param_serial0_baud, // deprecated
|
|
|
|
k_param_serial1_baud, // deprecated
|
|
|
|
k_param_serial2_baud, // deprecated
|
2014-05-21 07:21:19 -03:00
|
|
|
k_param_takeoff_tdrag_elevator,
|
|
|
|
k_param_takeoff_tdrag_speed1,
|
|
|
|
k_param_takeoff_rotate_speed,
|
|
|
|
k_param_takeoff_throttle_slewrate,
|
2014-05-24 09:19:50 -03:00
|
|
|
k_param_takeoff_throttle_max,
|
2014-08-26 08:18:24 -03:00
|
|
|
k_param_rangefinder,
|
2014-07-21 19:24:00 -03:00
|
|
|
k_param_terrain,
|
2014-07-24 04:54:58 -03:00
|
|
|
k_param_terrain_follow,
|
2014-08-05 22:46:40 -03:00
|
|
|
k_param_stab_pitch_down_cd_old, // deprecated
|
2015-04-12 23:20:01 -03:00
|
|
|
k_param_glide_slope_min,
|
2014-08-05 22:46:40 -03:00
|
|
|
k_param_stab_pitch_down,
|
2014-08-06 20:31:03 -03:00
|
|
|
k_param_terrain_lookahead,
|
2021-03-12 17:55:31 -04:00
|
|
|
k_param_fbwa_tdrag_chan, // unused - moved to RC option
|
2014-08-26 08:18:24 -03:00
|
|
|
k_param_rangefinder_landing,
|
2016-11-23 06:00:29 -04:00
|
|
|
k_param_land_flap_percent, // unused - moved to AP_Landing
|
2014-08-29 07:10:44 -03:00
|
|
|
k_param_takeoff_flap_percent,
|
2014-08-29 07:30:41 -03:00
|
|
|
k_param_flap_slewrate,
|
2014-10-17 16:06:53 -03:00
|
|
|
k_param_rtl_autoland,
|
2014-11-06 02:27:26 -04:00
|
|
|
k_param_override_channel,
|
2014-11-12 23:06:00 -04:00
|
|
|
k_param_stall_prevention,
|
2014-11-02 02:26:05 -04:00
|
|
|
k_param_optflow,
|
2017-08-11 01:31:18 -03:00
|
|
|
k_param_cli_enabled_old, // unused - CLI removed
|
2017-08-26 07:16:09 -03:00
|
|
|
k_param_trim_rc_at_start, // unused
|
2021-06-09 08:31:35 -03:00
|
|
|
k_param_hil_mode_unused, // unused
|
2016-11-23 06:00:29 -04:00
|
|
|
k_param_land_disarm_delay, // unused - moved to AP_Landing
|
2015-04-12 23:20:01 -03:00
|
|
|
k_param_glide_slope_threshold,
|
2015-04-15 22:16:30 -03:00
|
|
|
k_param_rudder_only,
|
2015-05-15 01:24:39 -03:00
|
|
|
k_param_gcs3, // 93
|
2015-05-22 19:57:00 -03:00
|
|
|
k_param_gcs_pid_mask,
|
2015-06-03 16:22:24 -03:00
|
|
|
k_param_crash_detection_enable,
|
2016-11-23 06:00:29 -04:00
|
|
|
k_param_land_abort_throttle_enable, // unused - moved to AP_Landing
|
2015-08-28 03:01:32 -03:00
|
|
|
k_param_rssi = 97,
|
2015-09-24 07:58:18 -03:00
|
|
|
k_param_rpm_sensor,
|
2015-06-18 07:45:33 -03:00
|
|
|
k_param_parachute,
|
2013-11-27 22:19:34 -04:00
|
|
|
k_param_arming = 100,
|
2021-03-12 17:53:55 -04:00
|
|
|
k_param_parachute_channel, // unused - moved to RC option
|
2015-12-30 20:15:57 -04:00
|
|
|
k_param_crash_accel_threshold,
|
2021-08-29 13:52:24 -03:00
|
|
|
k_param_override_safety, // unused
|
2016-11-23 06:00:29 -04:00
|
|
|
k_param_land_throttle_slewrate, // 104 unused - moved to AP_Landing
|
2013-11-27 22:19:34 -04:00
|
|
|
|
2013-12-30 18:33:02 -04:00
|
|
|
// 105: Extra parameters
|
|
|
|
k_param_fence_retalt = 105,
|
2014-02-13 18:49:42 -04:00
|
|
|
k_param_fence_autoenable,
|
2014-02-20 13:10:57 -04:00
|
|
|
k_param_fence_ret_rally,
|
2016-04-01 02:17:07 -03:00
|
|
|
k_param_q_attitude_control,
|
2016-03-09 18:22:53 -04:00
|
|
|
k_param_takeoff_pitch_limit_reduction_sec,
|
2013-12-30 18:33:02 -04:00
|
|
|
|
2012-08-21 23:19:51 -03:00
|
|
|
// 110: Telemetry control
|
|
|
|
//
|
2023-12-11 12:56:09 -04:00
|
|
|
k_param_gcs0 = 110, // stream rates for SERIAL0
|
|
|
|
k_param_gcs1, // stream rates for SERIAL1
|
2012-08-21 23:19:51 -03:00
|
|
|
k_param_sysid_this_mav,
|
|
|
|
k_param_sysid_my_gcs,
|
2014-05-20 23:40:02 -03:00
|
|
|
k_param_serial1_baud_old, // deprecated
|
2012-08-29 19:59:39 -03:00
|
|
|
k_param_telem_delay,
|
2014-05-20 23:40:02 -03:00
|
|
|
k_param_serial0_baud_old, // deprecated
|
2023-12-11 12:56:09 -04:00
|
|
|
k_param_gcs2, // stream rates for SERIAL2
|
2014-05-20 23:40:02 -03:00
|
|
|
k_param_serial2_baud_old, // deprecated
|
2015-01-23 09:45:24 -04:00
|
|
|
k_param_serial2_protocol, // deprecated
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// 120: Fly-by-wire control
|
|
|
|
//
|
2016-08-07 21:48:36 -03:00
|
|
|
k_param_airspeed_min = 120,
|
|
|
|
k_param_airspeed_max,
|
2024-01-18 21:36:20 -04:00
|
|
|
k_param_cruise_alt_floor,
|
2012-08-17 02:04:53 -03:00
|
|
|
k_param_flybywire_elev_reverse,
|
2021-09-04 13:08:24 -03:00
|
|
|
k_param_alt_control_algorithm, // unused
|
2013-03-27 20:27:25 -03:00
|
|
|
k_param_flybywire_climb_rate,
|
2013-07-10 19:05:25 -03:00
|
|
|
k_param_acro_roll_rate,
|
|
|
|
k_param_acro_pitch_rate,
|
2013-10-04 09:15:53 -03:00
|
|
|
k_param_acro_locking,
|
2016-01-30 03:22:21 -04:00
|
|
|
k_param_use_reverse_thrust = 129,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 130: Sensor parameters
|
|
|
|
//
|
2012-11-20 03:24:17 -04:00
|
|
|
k_param_imu = 130, // unused
|
2017-02-10 02:23:54 -04:00
|
|
|
k_param_altitude_mix, // deprecated
|
2012-06-27 02:59:52 -03:00
|
|
|
|
2019-03-24 00:27:03 -03:00
|
|
|
k_param_compass_enabled_deprecated,
|
2012-08-21 23:19:51 -03:00
|
|
|
k_param_compass,
|
2013-09-29 09:54:39 -03:00
|
|
|
k_param_battery_monitoring, // unused
|
|
|
|
k_param_volt_div_ratio, // unused
|
|
|
|
k_param_curr_amp_per_volt, // unused
|
2013-03-07 19:01:33 -04:00
|
|
|
k_param_input_voltage, // deprecated, can be deleted
|
2013-09-29 09:54:39 -03:00
|
|
|
k_param_pack_capacity, // unused
|
2014-08-26 08:18:24 -03:00
|
|
|
k_param_sonar_enabled_old, // unused
|
2012-04-16 07:52:02 -03:00
|
|
|
k_param_ahrs, // AHRS group
|
2012-06-27 02:59:52 -03:00
|
|
|
k_param_barometer, // barometer ground calibration
|
2022-01-02 03:41:27 -04:00
|
|
|
k_param_airspeed, // only used for parameter conversion; AP_Airspeed parameters moved to AP_Vehicle
|
2012-11-20 22:33:23 -04:00
|
|
|
k_param_curr_amp_offset,
|
2016-08-14 06:46:24 -03:00
|
|
|
k_param_NavEKF, // deprecated - remove
|
2014-03-03 09:47:58 -04:00
|
|
|
k_param_mission, // mission library
|
2024-02-27 20:48:25 -04:00
|
|
|
k_param_serial_manager_old, // serial manager library
|
2016-08-14 06:46:24 -03:00
|
|
|
k_param_NavEKF2_old, // deprecated - remove
|
2016-11-23 05:33:41 -04:00
|
|
|
k_param_land_pre_flare_alt, // unused - moved to AP_Landing
|
|
|
|
k_param_land_pre_flare_airspeed = 149, // unused - moved to AP_Landing
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 150: Navigation parameters
|
|
|
|
//
|
2013-04-11 21:25:46 -03:00
|
|
|
k_param_crosstrack_gain = 150, // unused
|
|
|
|
k_param_crosstrack_entry_angle, // unused
|
2024-01-18 21:58:28 -04:00
|
|
|
k_param_roll_limit,
|
2024-01-18 21:50:36 -04:00
|
|
|
k_param_pitch_limit_max,
|
|
|
|
k_param_pitch_limit_min,
|
2024-01-17 22:34:22 -04:00
|
|
|
k_param_airspeed_cruise,
|
2024-01-18 01:58:09 -04:00
|
|
|
k_param_RTL_altitude,
|
2018-08-11 08:12:35 -03:00
|
|
|
k_param_inverted_flight_ch_unused, // unused
|
2024-01-18 01:53:11 -04:00
|
|
|
k_param_min_groundspeed,
|
2013-04-11 21:25:46 -03:00
|
|
|
k_param_crosstrack_use_wind, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2012-06-13 16:00:20 -03:00
|
|
|
|
|
|
|
//
|
2012-07-02 21:21:01 -03:00
|
|
|
// Camera and mount parameters
|
2012-06-13 16:00:20 -03:00
|
|
|
//
|
2012-08-07 03:05:51 -03:00
|
|
|
k_param_camera = 160,
|
2012-07-02 21:21:01 -03:00
|
|
|
k_param_camera_mount,
|
2015-01-08 16:12:08 -04:00
|
|
|
k_param_camera_mount2, // unused
|
2015-11-19 14:24:55 -04:00
|
|
|
k_param_adsb,
|
2015-12-03 16:47:48 -04:00
|
|
|
k_param_notify,
|
2016-11-23 05:33:41 -04:00
|
|
|
k_param_land_pre_flare_sec = 165, // unused - moved to AP_Landing
|
2012-06-13 16:00:20 -03:00
|
|
|
|
2012-10-13 08:51:41 -03:00
|
|
|
//
|
2012-10-16 03:21:04 -03:00
|
|
|
// Battery monitoring parameters
|
2012-10-13 08:51:41 -03:00
|
|
|
//
|
2013-09-29 09:54:39 -03:00
|
|
|
k_param_battery = 166,
|
2015-08-28 03:01:32 -03:00
|
|
|
k_param_rssi_pin, // unused, replaced by rssi_ library parameters - 167
|
|
|
|
k_param_battery_volt_pin, // unused - 168
|
|
|
|
k_param_battery_curr_pin, // unused - 169
|
2012-10-13 08:51:41 -03:00
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
//
|
2016-10-22 07:27:57 -03:00
|
|
|
// 170: Radio settings - all unused now
|
2011-12-26 19:48:26 -04:00
|
|
|
//
|
2016-10-22 07:27:57 -03:00
|
|
|
k_param_rc_1_old = 170,
|
|
|
|
k_param_rc_2_old,
|
|
|
|
k_param_rc_3_old,
|
|
|
|
k_param_rc_4_old,
|
|
|
|
k_param_rc_5_old,
|
|
|
|
k_param_rc_6_old,
|
|
|
|
k_param_rc_7_old,
|
|
|
|
k_param_rc_8_old,
|
|
|
|
k_param_rc_9_old,
|
|
|
|
k_param_rc_10_old,
|
|
|
|
k_param_rc_11_old,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
k_param_throttle_min,
|
|
|
|
k_param_throttle_max,
|
|
|
|
k_param_throttle_fs_enabled,
|
|
|
|
k_param_throttle_fs_value,
|
|
|
|
k_param_throttle_cruise,
|
|
|
|
|
2017-12-06 19:02:11 -04:00
|
|
|
k_param_fs_action_short,
|
|
|
|
k_param_fs_action_long,
|
2012-08-21 23:19:51 -03:00
|
|
|
k_param_gcs_heartbeat_fs_enabled,
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_throttle_slewrate,
|
2012-09-22 03:17:38 -03:00
|
|
|
k_param_throttle_suppress_manual,
|
2012-11-26 08:29:00 -04:00
|
|
|
k_param_throttle_passthru_stabilize,
|
2016-10-22 07:27:57 -03:00
|
|
|
k_param_rc_12_old,
|
2017-11-09 18:34:12 -04:00
|
|
|
k_param_fs_batt_voltage, // unused - moved to AP_BattMonitor
|
|
|
|
k_param_fs_batt_mah, // unused - moved to AP_BattMonitor
|
2017-12-06 19:02:11 -04:00
|
|
|
k_param_fs_timeout_short,
|
|
|
|
k_param_fs_timeout_long,
|
2016-10-22 07:27:57 -03:00
|
|
|
k_param_rc_13_old,
|
|
|
|
k_param_rc_14_old,
|
2016-04-16 07:26:43 -03:00
|
|
|
k_param_tuning,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 200: Feed-forward gains
|
|
|
|
//
|
2013-05-30 09:58:31 -03:00
|
|
|
k_param_kff_pitch_compensation = 200, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_kff_rudder_mix,
|
2013-07-22 00:28:11 -03:00
|
|
|
k_param_kff_pitch_to_throttle, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_kff_throttle_to_pitch,
|
2012-07-25 22:30:23 -03:00
|
|
|
k_param_scaling_speed,
|
2015-11-24 04:24:04 -04:00
|
|
|
k_param_quadplane,
|
2016-01-19 00:04:30 -04:00
|
|
|
k_param_rtl_radius,
|
2016-11-23 06:00:29 -04:00
|
|
|
k_param_land_then_servos_neutral, // unused - moved to AP_Landing
|
2016-10-22 07:27:57 -03:00
|
|
|
k_param_rc_15_old,
|
|
|
|
k_param_rc_16_old,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 210: flight modes
|
|
|
|
//
|
|
|
|
k_param_flight_mode_channel = 210,
|
|
|
|
k_param_flight_mode1,
|
|
|
|
k_param_flight_mode2,
|
|
|
|
k_param_flight_mode3,
|
|
|
|
k_param_flight_mode4,
|
|
|
|
k_param_flight_mode5,
|
|
|
|
k_param_flight_mode6,
|
2015-02-26 17:07:59 -04:00
|
|
|
k_param_initial_mode,
|
2016-11-23 05:33:41 -04:00
|
|
|
k_param_land_slope_recalc_shallow_threshold, // unused - moved to AP_Landing
|
|
|
|
k_param_land_slope_recalc_steep_threshold_to_abort, // unused - moved to AP_Landing
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 220: Waypoint data
|
|
|
|
//
|
2021-09-04 13:08:24 -03:00
|
|
|
k_param_waypoint_mode = 220, // unused
|
2014-03-03 09:47:58 -04:00
|
|
|
k_param_command_total, // unused
|
|
|
|
k_param_command_index, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
k_param_waypoint_radius,
|
|
|
|
k_param_loiter_radius,
|
2011-12-15 03:08:58 -04:00
|
|
|
k_param_fence_action,
|
|
|
|
k_param_fence_total,
|
2021-03-12 17:55:31 -04:00
|
|
|
k_param_fence_channel, // unused - moved to RC option
|
2011-12-15 03:08:58 -04:00
|
|
|
k_param_fence_minalt,
|
|
|
|
k_param_fence_maxalt,
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2012-07-08 22:49:26 -03:00
|
|
|
// other objects
|
2012-06-29 02:10:35 -03:00
|
|
|
k_param_sitl = 230,
|
2016-07-22 04:45:05 -03:00
|
|
|
k_param_afs,
|
2012-08-21 23:34:40 -03:00
|
|
|
k_param_rollController,
|
|
|
|
k_param_pitchController,
|
|
|
|
k_param_yawController,
|
2013-04-11 21:25:46 -03:00
|
|
|
k_param_L1_controller,
|
2013-06-03 02:32:08 -03:00
|
|
|
k_param_rcmap,
|
2013-06-26 05:36:53 -03:00
|
|
|
k_param_TECS_controller,
|
2014-04-18 16:19:13 -03:00
|
|
|
k_param_rally_total_old, //unused
|
2013-10-03 09:01:43 -03:00
|
|
|
k_param_steerController,
|
2012-06-29 02:10:35 -03:00
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
//
|
|
|
|
// 240: PID Controllers
|
2013-04-14 02:42:29 -03:00
|
|
|
k_param_pidNavRoll = 240, // unused
|
2013-05-30 09:58:31 -03:00
|
|
|
k_param_pidServoRoll, // unused
|
|
|
|
k_param_pidServoPitch, // unused
|
2013-07-22 00:28:11 -03:00
|
|
|
k_param_pidNavPitchAirspeed, // unused
|
|
|
|
k_param_pidServoRudder, // unused
|
|
|
|
k_param_pidTeThrottle, // unused
|
|
|
|
k_param_pidNavPitchAltitude, // unused
|
2013-10-03 09:01:43 -03:00
|
|
|
k_param_pidWheelSteer, // unused
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2015-10-04 03:22:07 -03:00
|
|
|
k_param_mixing_offset,
|
|
|
|
k_param_dspoiler_rud_rate,
|
|
|
|
|
2019-01-18 00:23:42 -04:00
|
|
|
k_param_logger = 253, // Logging Group
|
2015-11-09 18:40:34 -04:00
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
// 254,255: reserved
|
2019-12-01 13:02:40 -04:00
|
|
|
|
|
|
|
k_param_vehicle = 257, // vehicle common block of parameters
|
2020-12-22 15:42:02 -04:00
|
|
|
k_param_gcs4, // stream rates
|
|
|
|
k_param_gcs5, // stream rates
|
|
|
|
k_param_gcs6, // stream rates
|
2022-03-04 12:36:36 -04:00
|
|
|
k_param_fence, // vehicle fence - unused
|
2021-11-25 03:02:31 -04:00
|
|
|
k_param_acro_yaw_rate,
|
2023-01-09 23:54:32 -04:00
|
|
|
k_param_takeoff_throttle_max_t,
|
2023-07-19 09:40:43 -03:00
|
|
|
k_param_autotune_options,
|
2011-12-26 19:48:26 -04:00
|
|
|
};
|
|
|
|
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int16 format_version;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2012-08-21 23:19:51 -03:00
|
|
|
// Telemetry control
|
|
|
|
//
|
|
|
|
AP_Int16 sysid_this_mav;
|
|
|
|
AP_Int16 sysid_my_gcs;
|
2012-08-29 19:59:39 -03:00
|
|
|
AP_Int8 telem_delay;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2022-03-22 21:29:29 -03:00
|
|
|
AP_Enum<RtlAutoland> rtl_autoland;
|
2014-10-17 16:06:53 -03:00
|
|
|
|
2015-12-30 20:15:57 -04:00
|
|
|
AP_Int8 crash_accel_threshold;
|
2015-03-06 17:20:55 -04:00
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
// Feed-forward gains
|
|
|
|
//
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Float kff_rudder_mix;
|
|
|
|
AP_Float kff_pitch_to_throttle;
|
|
|
|
AP_Float kff_throttle_to_pitch;
|
2013-10-03 09:01:43 -03:00
|
|
|
AP_Float ground_steer_alt;
|
|
|
|
AP_Int16 ground_steer_dps;
|
2014-08-05 22:46:40 -03:00
|
|
|
AP_Float stab_pitch_down;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2012-07-25 22:30:23 -03:00
|
|
|
// speed used for speed scaling
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Float scaling_speed;
|
2012-07-25 22:30:23 -03:00
|
|
|
|
2011-12-26 19:48:26 -04:00
|
|
|
// Waypoints
|
|
|
|
//
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int16 waypoint_radius;
|
2013-09-13 04:43:00 -03:00
|
|
|
AP_Int16 waypoint_max_radius;
|
2016-01-19 00:04:30 -04:00
|
|
|
AP_Int16 rtl_radius;
|
2012-08-07 03:05:51 -03:00
|
|
|
|
2011-12-15 03:09:29 -04:00
|
|
|
// Fly-by-wire
|
|
|
|
//
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int8 flybywire_elev_reverse;
|
2013-03-27 20:27:25 -03:00
|
|
|
AP_Int8 flybywire_climb_rate;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// Throttle
|
|
|
|
//
|
2012-09-22 03:17:38 -03:00
|
|
|
AP_Int8 throttle_suppress_manual;
|
2012-11-26 08:29:00 -04:00
|
|
|
AP_Int8 throttle_passthru_stabilize;
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int8 throttle_fs_enabled;
|
|
|
|
AP_Int16 throttle_fs_value;
|
2012-09-09 06:36:35 -03:00
|
|
|
AP_Int8 throttle_nudge;
|
2021-05-25 14:49:38 -03:00
|
|
|
AP_Int32 use_reverse_thrust;
|
2012-08-21 23:19:51 -03:00
|
|
|
|
|
|
|
// Failsafe
|
2017-12-06 19:02:11 -04:00
|
|
|
AP_Int8 fs_action_short;
|
|
|
|
AP_Int8 fs_action_long;
|
|
|
|
AP_Float fs_timeout_short;
|
|
|
|
AP_Float fs_timeout_long;
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int8 gcs_heartbeat_fs_enabled;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// Flight modes
|
|
|
|
//
|
2012-08-21 23:19:51 -03:00
|
|
|
AP_Int8 flight_mode_channel;
|
|
|
|
AP_Int8 flight_mode1;
|
|
|
|
AP_Int8 flight_mode2;
|
|
|
|
AP_Int8 flight_mode3;
|
|
|
|
AP_Int8 flight_mode4;
|
|
|
|
AP_Int8 flight_mode5;
|
|
|
|
AP_Int8 flight_mode6;
|
2015-02-26 17:07:59 -04:00
|
|
|
AP_Int8 initial_mode;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
2023-10-11 04:41:54 -03:00
|
|
|
// Navigational manoeuvring limits
|
2011-12-26 19:48:26 -04:00
|
|
|
//
|
2012-09-19 03:22:53 -03:00
|
|
|
AP_Int16 alt_offset;
|
2013-07-10 19:05:25 -03:00
|
|
|
AP_Int16 acro_roll_rate;
|
|
|
|
AP_Int16 acro_pitch_rate;
|
2021-11-25 03:02:31 -04:00
|
|
|
AP_Int16 acro_yaw_rate;
|
2013-10-04 09:15:53 -03:00
|
|
|
AP_Int8 acro_locking;
|
2011-12-26 19:48:26 -04:00
|
|
|
|
|
|
|
// Misc
|
|
|
|
//
|
2015-04-15 22:16:30 -03:00
|
|
|
AP_Int8 rudder_only;
|
2013-05-25 05:27:57 -03:00
|
|
|
AP_Float mixing_gain;
|
2015-10-04 03:22:07 -03:00
|
|
|
AP_Int16 mixing_offset;
|
|
|
|
AP_Int16 dspoiler_rud_rate;
|
2014-01-13 21:52:22 -04:00
|
|
|
AP_Int32 log_bitmask;
|
2024-01-18 01:58:09 -04:00
|
|
|
AP_Float RTL_altitude;
|
2023-12-13 17:49:48 -04:00
|
|
|
AP_Float pitch_trim;
|
2024-01-18 21:36:20 -04:00
|
|
|
AP_Float cruise_alt_floor;
|
2012-08-21 23:19:51 -03:00
|
|
|
|
|
|
|
AP_Int8 flap_1_percent;
|
|
|
|
AP_Int8 flap_1_speed;
|
|
|
|
AP_Int8 flap_2_percent;
|
|
|
|
AP_Int8 flap_2_speed;
|
2015-08-28 03:01:32 -03:00
|
|
|
AP_Int8 takeoff_flap_percent;
|
2021-11-02 19:57:51 -03:00
|
|
|
AP_Enum<StickMixing> stick_mixing;
|
2013-02-09 07:40:16 -04:00
|
|
|
AP_Float takeoff_throttle_min_speed;
|
2013-03-08 23:41:04 -04:00
|
|
|
AP_Float takeoff_throttle_min_accel;
|
2013-06-26 05:36:53 -03:00
|
|
|
AP_Int8 takeoff_throttle_delay;
|
2014-05-21 07:21:19 -03:00
|
|
|
AP_Int8 takeoff_tdrag_elevator;
|
|
|
|
AP_Float takeoff_tdrag_speed1;
|
|
|
|
AP_Float takeoff_rotate_speed;
|
|
|
|
AP_Int8 takeoff_throttle_slewrate;
|
2016-03-09 18:22:53 -04:00
|
|
|
AP_Float takeoff_pitch_limit_reduction_sec;
|
2013-04-12 07:27:56 -03:00
|
|
|
AP_Int8 level_roll_limit;
|
2014-07-24 18:58:39 -03:00
|
|
|
#if AP_TERRAIN_AVAILABLE
|
2021-03-19 20:16:25 -03:00
|
|
|
AP_Int32 terrain_follow;
|
2014-08-06 20:31:03 -03:00
|
|
|
AP_Int16 terrain_lookahead;
|
2014-07-24 04:54:58 -03:00
|
|
|
#endif
|
2015-04-12 23:20:01 -03:00
|
|
|
AP_Int16 glide_slope_min;
|
|
|
|
AP_Float glide_slope_threshold;
|
2014-08-26 08:18:24 -03:00
|
|
|
AP_Int8 rangefinder_landing;
|
2014-08-29 07:30:41 -03:00
|
|
|
AP_Int8 flap_slewrate;
|
2019-01-19 03:46:40 -04:00
|
|
|
#if HAL_WITH_IO_MCU
|
2014-11-06 02:27:26 -04:00
|
|
|
AP_Int8 override_channel;
|
|
|
|
#endif
|
2015-05-27 02:09:19 -03:00
|
|
|
AP_Int16 gcs_pid_mask;
|
2011-12-26 19:48:26 -04:00
|
|
|
};
|
|
|
|
|
2016-07-21 21:28:17 -03:00
|
|
|
/*
|
|
|
|
2nd block of parameters, to avoid going past 256 top level keys
|
|
|
|
*/
|
|
|
|
class ParametersG2 {
|
|
|
|
public:
|
2016-07-23 04:37:42 -03:00
|
|
|
ParametersG2(void);
|
2016-07-21 21:28:17 -03:00
|
|
|
|
|
|
|
// var_info for holding Parameter information
|
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
|
|
|
|
// button reporting library
|
2021-08-12 00:38:21 -03:00
|
|
|
#if HAL_BUTTON_ENABLED
|
2019-11-27 18:46:58 -04:00
|
|
|
AP_Button *button_ptr;
|
2021-08-12 00:38:21 -03:00
|
|
|
#endif
|
2016-07-23 04:37:42 -03:00
|
|
|
|
2022-07-15 08:50:12 -03:00
|
|
|
#if AP_ICENGINE_ENABLED
|
2016-07-23 04:37:42 -03:00
|
|
|
// internal combustion engine control
|
|
|
|
AP_ICEngine ice_control;
|
2022-07-15 08:50:12 -03:00
|
|
|
#endif
|
2016-10-11 08:02:20 -03:00
|
|
|
|
2016-10-22 07:27:57 -03:00
|
|
|
// RC input channels
|
2018-04-26 22:01:37 -03:00
|
|
|
RC_Channels_Plane rc_channels;
|
2016-10-22 07:27:57 -03:00
|
|
|
|
2016-10-11 08:02:20 -03:00
|
|
|
// control over servo output ranges
|
|
|
|
SRV_Channels servo_channels;
|
2016-08-13 18:52:03 -03:00
|
|
|
|
|
|
|
// whether to enforce acceptance of packets only from sysid_my_gcs
|
|
|
|
AP_Int8 sysid_enforce;
|
2018-07-29 19:57:55 -03:00
|
|
|
|
2020-09-23 05:16:45 -03:00
|
|
|
#if HAL_SOARING_ENABLED
|
2017-02-26 19:18:38 -04:00
|
|
|
// ArduSoar parameters
|
|
|
|
SoaringController soaring_controller;
|
2018-07-29 19:57:55 -03:00
|
|
|
#endif
|
2017-04-05 00:37:49 -03:00
|
|
|
|
|
|
|
// dual motor tailsitter rudder to differential thrust scaling: 0-100%
|
|
|
|
AP_Int8 rudd_dt_gain;
|
2017-07-10 04:01:33 -03:00
|
|
|
|
|
|
|
// mask of channels to do manual pass-thru for
|
|
|
|
AP_Int32 manual_rc_mask;
|
2017-08-28 19:20:13 -03:00
|
|
|
|
|
|
|
// home reset altitude threshold
|
|
|
|
AP_Int8 home_reset_threshold;
|
|
|
|
|
2018-08-20 21:38:41 -03:00
|
|
|
AP_Int32 flight_options;
|
2018-09-27 20:03:56 -03:00
|
|
|
|
2018-09-13 19:43:29 -03:00
|
|
|
AP_Int8 takeoff_throttle_accel_count;
|
2019-01-31 19:17:00 -04:00
|
|
|
AP_Int8 takeoff_timeout;
|
2018-06-10 03:33:06 -03:00
|
|
|
|
2022-10-01 07:21:38 -03:00
|
|
|
#if AP_LANDINGGEAR_ENABLED
|
2018-06-10 03:33:06 -03:00
|
|
|
AP_LandingGear landing_gear;
|
|
|
|
#endif
|
2018-11-19 06:20:24 -04:00
|
|
|
|
2024-02-22 04:18:14 -04:00
|
|
|
#if AC_PRECLAND_ENABLED
|
|
|
|
AC_PrecLand precland;
|
|
|
|
#endif
|
|
|
|
|
2018-11-19 06:20:24 -04:00
|
|
|
// crow flaps weighting
|
2019-02-24 18:54:22 -04:00
|
|
|
AP_Int8 crow_flap_weight_outer;
|
|
|
|
AP_Int8 crow_flap_weight_inner;
|
|
|
|
AP_Int8 crow_flap_options;
|
|
|
|
AP_Int8 crow_flap_aileron_matching;
|
2019-11-09 04:55:05 -04:00
|
|
|
|
2023-10-11 04:41:54 -03:00
|
|
|
// Forward throttle battery voltage compensation
|
2023-12-16 13:23:56 -04:00
|
|
|
class FWD_BATT_CMP {
|
|
|
|
public:
|
|
|
|
// Calculate the throttle scale to compensate for battery voltage drop
|
|
|
|
void update();
|
|
|
|
|
|
|
|
// Apply throttle scale to min and max limits
|
|
|
|
void apply_min_max(int8_t &min_throttle, int8_t &max_throttle) const;
|
|
|
|
|
|
|
|
// Apply throttle scale to throttle demand
|
|
|
|
float apply_throttle(float throttle) const;
|
|
|
|
|
|
|
|
AP_Float batt_voltage_max;
|
|
|
|
AP_Float batt_voltage_min;
|
|
|
|
AP_Int8 batt_idx;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool enabled;
|
|
|
|
float ratio;
|
|
|
|
} fwd_batt_cmp;
|
|
|
|
|
2020-04-24 16:20:14 -03:00
|
|
|
|
2020-05-16 01:02:01 -03:00
|
|
|
#if OFFBOARD_GUIDED == ENABLED
|
|
|
|
// guided yaw heading PID
|
2023-09-28 22:53:10 -03:00
|
|
|
AC_PID guidedHeading{5000.0, 0.0, 0.0, 0 , 10.0, 5.0, 5.0 , 5.0 , 0.0};
|
2020-05-16 01:02:01 -03:00
|
|
|
#endif
|
|
|
|
|
2023-08-11 09:27:55 -03:00
|
|
|
#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED
|
2022-01-04 00:53:18 -04:00
|
|
|
AP_Follow follow;
|
|
|
|
#endif
|
2020-05-16 01:02:01 -03:00
|
|
|
|
2020-05-04 20:12:14 -03:00
|
|
|
AP_Float fs_ekf_thresh;
|
2020-05-14 21:12:02 -03:00
|
|
|
|
|
|
|
// min initial climb in RTL
|
|
|
|
AP_Int16 rtl_climb_min;
|
2021-07-17 03:40:38 -03:00
|
|
|
|
|
|
|
AP_Int8 man_expo_roll;
|
|
|
|
AP_Int8 man_expo_pitch;
|
|
|
|
AP_Int8 man_expo_rudder;
|
2021-07-17 05:11:28 -03:00
|
|
|
|
|
|
|
AP_Int32 oneshot_mask;
|
2022-11-01 10:46:52 -03:00
|
|
|
|
|
|
|
AP_Int8 axis_bitmask; // axes to be autotuned
|
2022-07-15 08:50:12 -03:00
|
|
|
|
|
|
|
// just to make compilation easier when all things are compiled out...
|
|
|
|
uint8_t unused_integer;
|
2016-07-21 21:28:17 -03:00
|
|
|
};
|
|
|
|
|
2012-08-06 22:03:08 -03:00
|
|
|
extern const AP_Param::Info var_info[];
|