2016-02-17 21:25:58 -04:00
|
|
|
#pragma once
|
2013-10-13 04:14:13 -03:00
|
|
|
|
2023-01-03 21:39:14 -04:00
|
|
|
#define AP_PARAM_VEHICLE_NAME tracker
|
|
|
|
|
2019-11-24 18:59:53 -04:00
|
|
|
#include <AC_PID/AC_PID.h>
|
|
|
|
#include <AP_Param/AP_Param.h>
|
2013-10-13 04:14:13 -03:00
|
|
|
|
|
|
|
// Global parameter class.
|
|
|
|
//
|
|
|
|
class Parameters {
|
|
|
|
public:
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
// STOP!!! DO NOT CHANGE THIS VALUE UNTIL YOU FULLY UNDERSTAND THE
|
|
|
|
// COMMENTS ABOVE. IF UNSURE, ASK ANOTHER DEVELOPER!!!
|
|
|
|
static const uint16_t k_format_version = 1;
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
// Layout version number, always key zero.
|
|
|
|
//
|
|
|
|
k_param_format_version = 0,
|
2018-06-01 22:21:18 -03:00
|
|
|
k_param_software_type, // deprecated
|
2013-10-13 04:14:13 -03:00
|
|
|
|
2023-12-11 12:55:07 -04:00
|
|
|
k_param_gcs0 = 100, // stream rates for SERIAL0
|
|
|
|
k_param_gcs1, // stream rates for SERIAL1
|
2013-10-13 04:14:13 -03:00
|
|
|
k_param_sysid_this_mav,
|
|
|
|
k_param_sysid_my_gcs,
|
2015-01-28 01:27:03 -04:00
|
|
|
k_param_serial0_baud, // deprecated
|
|
|
|
k_param_serial1_baud, // deprecated
|
2013-10-13 04:14:13 -03:00
|
|
|
k_param_imu,
|
2019-03-24 00:26:06 -03:00
|
|
|
k_param_compass_enabled_deprecated,
|
2013-10-13 04:14:13 -03:00
|
|
|
k_param_compass,
|
|
|
|
k_param_ahrs, // AHRS group
|
|
|
|
k_param_barometer,
|
|
|
|
k_param_scheduler,
|
|
|
|
k_param_ins,
|
|
|
|
k_param_sitl,
|
2016-06-16 00:07:07 -03:00
|
|
|
k_param_pidPitch_old, // deprecated
|
|
|
|
k_param_pidYaw_old, // deprecated
|
2023-12-11 12:55:07 -04:00
|
|
|
k_param_gcs2, // stream rates for SERIAL2
|
2015-01-28 01:27:03 -04:00
|
|
|
k_param_serial2_baud, // deprecated
|
2013-10-13 04:14:13 -03:00
|
|
|
|
2014-03-22 05:08:00 -03:00
|
|
|
k_param_yaw_slew_time,
|
|
|
|
k_param_pitch_slew_time,
|
|
|
|
k_param_min_reverse_time,
|
|
|
|
|
|
|
|
k_param_start_latitude,
|
|
|
|
k_param_start_longitude,
|
|
|
|
k_param_startup_delay,
|
2014-03-26 18:06:50 -03:00
|
|
|
k_param_BoardConfig,
|
2014-03-31 16:18:07 -03:00
|
|
|
k_param_gps,
|
2019-03-10 07:53:28 -03:00
|
|
|
k_param_scan_speed_unused, // deprecated
|
2014-12-09 23:35:39 -04:00
|
|
|
k_param_proxy_mode_unused, // deprecated
|
2016-05-23 04:54:47 -03:00
|
|
|
k_param_servo_pitch_type,
|
2014-07-23 05:41:25 -03:00
|
|
|
k_param_onoff_yaw_rate,
|
|
|
|
k_param_onoff_pitch_rate,
|
|
|
|
k_param_onoff_yaw_mintime,
|
|
|
|
k_param_onoff_pitch_mintime,
|
2014-08-03 05:16:37 -03:00
|
|
|
k_param_yaw_trim,
|
|
|
|
k_param_pitch_trim,
|
2014-10-06 02:51:53 -03:00
|
|
|
k_param_yaw_range,
|
2016-07-01 00:40:01 -03:00
|
|
|
k_param_pitch_range, //deprecated
|
2015-04-27 04:44:32 -03:00
|
|
|
k_param_distance_min,
|
|
|
|
k_param_sysid_target, // 138
|
2015-05-02 09:38:58 -03:00
|
|
|
k_param_gcs3, // stream rates for fourth MAVLink port
|
2015-12-27 03:05:14 -04:00
|
|
|
k_param_log_bitmask, // 140
|
2015-12-30 22:10:13 -04:00
|
|
|
k_param_notify,
|
2020-05-31 08:46:53 -03:00
|
|
|
k_param_can_mgr,
|
2018-01-16 16:06:27 -04:00
|
|
|
k_param_battery,
|
2014-03-22 05:08:00 -03:00
|
|
|
|
2015-01-28 01:27:03 -04:00
|
|
|
//
|
|
|
|
// 150: Telemetry control
|
|
|
|
//
|
|
|
|
k_param_serial_manager, // serial manager library
|
2016-05-23 04:54:47 -03:00
|
|
|
k_param_servo_yaw_type,
|
2016-05-24 08:53:57 -03:00
|
|
|
k_param_alt_source,
|
2016-06-12 22:44:56 -03:00
|
|
|
k_param_mavlink_update_rate,
|
2016-07-01 00:40:01 -03:00
|
|
|
k_param_pitch_min,
|
|
|
|
k_param_pitch_max,
|
2023-03-02 02:28:33 -04:00
|
|
|
k_param_gcs4,
|
|
|
|
k_param_gcs5,
|
|
|
|
k_param_gcs6,
|
2015-01-28 01:27:03 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// 200 : Radio settings
|
|
|
|
//
|
2017-01-06 22:51:56 -04:00
|
|
|
k_param_channel_yaw_old = 200,
|
|
|
|
k_param_channel_pitch_old,
|
2016-06-16 00:07:07 -03:00
|
|
|
k_param_pidPitch2Srv,
|
|
|
|
k_param_pidYaw2Srv,
|
2017-01-06 22:51:56 -04:00
|
|
|
k_param_rc_channels,
|
|
|
|
k_param_servo_channels,
|
2014-03-02 03:00:37 -04:00
|
|
|
|
2019-08-06 04:09:08 -03:00
|
|
|
k_param_stats = 218,
|
2019-03-01 02:40:18 -04:00
|
|
|
k_param_scripting = 219,
|
|
|
|
|
2014-03-02 03:00:37 -04:00
|
|
|
//
|
|
|
|
// 220: Waypoint data
|
|
|
|
//
|
|
|
|
k_param_command_total = 220,
|
2013-10-13 04:14:13 -03:00
|
|
|
|
|
|
|
// 254,255: reserved
|
2019-02-28 17:38:28 -04:00
|
|
|
k_param_gcs_pid_mask = 225,
|
2019-03-10 07:53:28 -03:00
|
|
|
k_param_scan_speed_yaw,
|
|
|
|
k_param_scan_speed_pitch,
|
2019-06-13 14:16:29 -03:00
|
|
|
k_param_initial_mode,
|
2019-12-19 18:59:06 -04:00
|
|
|
k_param_disarm_pwm,
|
|
|
|
|
2019-10-21 03:50:19 -03:00
|
|
|
k_param_auto_opts,
|
2023-10-04 05:33:15 -03:00
|
|
|
k_param_NavEKF2,
|
|
|
|
k_param_NavEKF3,
|
2019-10-21 03:50:19 -03:00
|
|
|
|
2020-05-20 08:20:17 -03:00
|
|
|
k_param_logger = 253, // 253 - Logging Group
|
|
|
|
|
2019-12-19 18:59:06 -04:00
|
|
|
k_param_vehicle = 257, // vehicle common block of parameters
|
2013-10-13 04:14:13 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
AP_Int16 format_version;
|
|
|
|
|
|
|
|
// Telemetry control
|
|
|
|
//
|
|
|
|
AP_Int16 sysid_this_mav;
|
|
|
|
AP_Int16 sysid_my_gcs;
|
2015-04-27 04:44:32 -03:00
|
|
|
AP_Int16 sysid_target;
|
2013-10-13 04:14:13 -03:00
|
|
|
|
2014-03-22 05:08:00 -03:00
|
|
|
AP_Float yaw_slew_time;
|
|
|
|
AP_Float pitch_slew_time;
|
|
|
|
AP_Float min_reverse_time;
|
2019-03-10 07:53:28 -03:00
|
|
|
AP_Int16 scan_speed_yaw;
|
|
|
|
AP_Int16 scan_speed_pitch;
|
2014-03-22 05:08:00 -03:00
|
|
|
|
|
|
|
AP_Float start_latitude;
|
|
|
|
AP_Float start_longitude;
|
|
|
|
|
|
|
|
AP_Float startup_delay;
|
2016-05-23 04:54:47 -03:00
|
|
|
AP_Int8 servo_pitch_type;
|
|
|
|
AP_Int8 servo_yaw_type;
|
2016-05-24 08:53:57 -03:00
|
|
|
AP_Int8 alt_source;
|
2016-06-12 22:44:56 -03:00
|
|
|
AP_Int8 mavlink_update_rate;
|
2014-07-23 05:41:25 -03:00
|
|
|
AP_Float onoff_yaw_rate;
|
|
|
|
AP_Float onoff_pitch_rate;
|
|
|
|
AP_Float onoff_yaw_mintime;
|
|
|
|
AP_Float onoff_pitch_mintime;
|
2014-08-03 05:16:37 -03:00
|
|
|
AP_Float yaw_trim;
|
|
|
|
AP_Float pitch_trim;
|
2014-10-06 02:51:53 -03:00
|
|
|
AP_Int16 yaw_range; // yaw axis total range of motion in degrees
|
2015-04-26 23:24:47 -03:00
|
|
|
AP_Int16 distance_min; // target's must be at least this distance from tracker to be tracked
|
2016-07-01 00:40:01 -03:00
|
|
|
AP_Int16 pitch_min;
|
|
|
|
AP_Int16 pitch_max;
|
2019-02-28 17:38:28 -04:00
|
|
|
AP_Int16 gcs_pid_mask;
|
2019-03-10 07:54:17 -03:00
|
|
|
AP_Int8 initial_mode;
|
2019-06-13 14:16:29 -03:00
|
|
|
AP_Int8 disarm_pwm;
|
2019-10-21 03:50:19 -03:00
|
|
|
AP_Int8 auto_opts;
|
2014-03-22 05:08:00 -03:00
|
|
|
|
2014-03-02 03:00:37 -04:00
|
|
|
// Waypoints
|
|
|
|
//
|
|
|
|
AP_Int8 command_total; // 1 if HOME is set
|
|
|
|
|
2015-12-27 03:05:14 -04:00
|
|
|
AP_Int32 log_bitmask;
|
|
|
|
|
2016-06-16 00:07:07 -03:00
|
|
|
// AC_PID controllers
|
|
|
|
AC_PID pidPitch2Srv;
|
|
|
|
AC_PID pidYaw2Srv;
|
2013-10-13 04:14:13 -03:00
|
|
|
|
|
|
|
Parameters() :
|
2019-06-27 06:36:31 -03:00
|
|
|
pidPitch2Srv(0.2, 0.0f, 0.05f, 0.02f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.1f),
|
|
|
|
pidYaw2Srv (0.2, 0.0f, 0.05f, 0.02f, 4000.0f, 0.0f, 0.0f, 0.0f, 0.1f)
|
2013-10-13 04:14:13 -03:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
extern const AP_Param::Info var_info[];
|