2012-04-30 04:17:14 -03:00
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
|
|
|
#ifndef PARAMETERS_H
|
|
|
|
#define PARAMETERS_H
|
|
|
|
|
|
|
|
#include <AP_Common.h>
|
|
|
|
|
|
|
|
// Global parameter class.
|
|
|
|
//
|
|
|
|
class Parameters {
|
|
|
|
public:
|
|
|
|
// The version of the layout as described by the parameter enum.
|
|
|
|
//
|
|
|
|
// When changing the parameter enum in an incompatible fashion, this
|
|
|
|
// value should be incremented by one.
|
|
|
|
//
|
|
|
|
// The increment will prevent old parameters from being used incorrectly
|
|
|
|
// by newer code.
|
|
|
|
//
|
2013-02-28 16:47:26 -04:00
|
|
|
static const uint16_t k_format_version = 16;
|
2013-02-08 06:17:54 -04:00
|
|
|
static const uint16_t k_software_type = 20;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
enum {
|
|
|
|
// Layout version number, always key zero.
|
|
|
|
//
|
|
|
|
k_param_format_version = 0,
|
|
|
|
k_param_software_type,
|
|
|
|
|
|
|
|
// Misc
|
|
|
|
//
|
2014-03-30 18:49:15 -03:00
|
|
|
k_param_log_bitmask_old = 10, // unused
|
2012-04-30 04:17:14 -03:00
|
|
|
k_param_num_resets,
|
|
|
|
k_param_reset_switch_chan,
|
2013-05-02 18:59:15 -03:00
|
|
|
k_param_initial_mode,
|
2013-06-03 21:37:05 -03:00
|
|
|
k_param_scheduler,
|
2013-06-24 23:48:58 -03:00
|
|
|
k_param_relay,
|
2014-01-19 21:57:59 -04:00
|
|
|
k_param_BoardConfig,
|
2014-02-16 19:08:59 -04:00
|
|
|
k_param_pivot_turn_angle,
|
2014-03-25 00:41:38 -03:00
|
|
|
k_param_rc_13,
|
|
|
|
k_param_rc_14,
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// IO pins
|
|
|
|
k_param_rssi_pin = 20,
|
2012-12-18 07:44:12 -04:00
|
|
|
k_param_battery_volt_pin,
|
|
|
|
k_param_battery_curr_pin,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2014-03-30 18:44:19 -03:00
|
|
|
// braking
|
|
|
|
k_param_braking_percent = 30,
|
2014-04-06 19:42:54 -03:00
|
|
|
k_param_braking_speederr,
|
2014-03-30 18:44:19 -03:00
|
|
|
|
2014-03-30 18:49:15 -03:00
|
|
|
// misc2
|
|
|
|
k_param_log_bitmask = 40,
|
2014-03-31 16:18:27 -03:00
|
|
|
k_param_gps,
|
2014-05-20 23:38:53 -03:00
|
|
|
k_param_serial0_baud,
|
|
|
|
k_param_serial1_baud,
|
|
|
|
k_param_serial2_baud,
|
2014-03-30 18:49:15 -03:00
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-01-17 16:56:32 -04:00
|
|
|
// 110: Telemetry control
|
|
|
|
//
|
2013-11-23 06:57:26 -04:00
|
|
|
k_param_gcs0 = 110, // stream rates for uartA
|
|
|
|
k_param_gcs1, // stream rates for uartC
|
2013-01-17 16:56:32 -04:00
|
|
|
k_param_sysid_this_mav,
|
|
|
|
k_param_sysid_my_gcs,
|
2014-05-20 23:38:53 -03:00
|
|
|
k_param_serial0_baud_old,
|
|
|
|
k_param_serial1_baud_old,
|
2012-08-29 20:36:18 -03:00
|
|
|
k_param_telem_delay,
|
2013-10-20 19:09:57 -03:00
|
|
|
k_param_skip_gyro_cal,
|
2013-11-23 06:57:26 -04:00
|
|
|
k_param_gcs2, // stream rates for uartD
|
2014-05-20 23:38:53 -03:00
|
|
|
k_param_serial2_baud_old,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
//
|
|
|
|
// 130: Sensor parameters
|
|
|
|
//
|
2013-02-08 06:17:54 -04:00
|
|
|
k_param_compass_enabled = 130,
|
2013-09-08 21:18:31 -03:00
|
|
|
k_param_steering_learn, // unused
|
2014-02-21 00:51:34 -04:00
|
|
|
k_param_NavEKF, // Extended Kalman Filter Inertial Navigation Group
|
2014-03-10 05:42:44 -03:00
|
|
|
k_param_mission, // mission library
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// 140: battery controls
|
2013-10-02 03:07:28 -03:00
|
|
|
k_param_battery_monitoring = 140, // deprecated, can be deleted
|
|
|
|
k_param_volt_div_ratio, // deprecated, can be deleted
|
|
|
|
k_param_curr_amp_per_volt, // deprecated, can be deleted
|
2013-03-07 19:01:51 -04:00
|
|
|
k_param_input_voltage, // deprecated, can be deleted
|
2013-10-02 03:07:28 -03:00
|
|
|
k_param_pack_capacity, // deprecated, can be deleted
|
|
|
|
k_param_battery,
|
2013-02-07 18:21:22 -04:00
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
//
|
|
|
|
// 150: Navigation parameters
|
|
|
|
//
|
|
|
|
k_param_crosstrack_gain = 150,
|
|
|
|
k_param_crosstrack_entry_angle,
|
2013-02-07 18:21:22 -04:00
|
|
|
k_param_speed_cruise,
|
2013-02-21 17:38:13 -04:00
|
|
|
k_param_speed_turn_gain,
|
|
|
|
k_param_speed_turn_dist,
|
2012-04-30 04:17:14 -03:00
|
|
|
k_param_ch7_option,
|
2013-03-21 19:38:25 -03:00
|
|
|
k_param_auto_trigger_pin,
|
|
|
|
k_param_auto_kickstart,
|
2013-09-08 21:18:31 -03:00
|
|
|
k_param_turn_circle, // unused
|
2013-06-16 20:50:53 -03:00
|
|
|
k_param_turn_max_g,
|
2013-02-07 18:21:22 -04:00
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
//
|
|
|
|
// 160: Radio settings
|
|
|
|
//
|
2013-06-03 06:33:59 -03:00
|
|
|
k_param_rc_1 = 160,
|
2013-02-07 18:21:22 -04:00
|
|
|
k_param_rc_2,
|
2013-06-03 06:33:59 -03:00
|
|
|
k_param_rc_3,
|
2013-02-07 18:21:22 -04:00
|
|
|
k_param_rc_4,
|
2012-04-30 04:17:14 -03:00
|
|
|
k_param_rc_5,
|
|
|
|
k_param_rc_6,
|
|
|
|
k_param_rc_7,
|
|
|
|
k_param_rc_8,
|
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// throttle control
|
|
|
|
k_param_throttle_min = 170,
|
2012-04-30 04:17:14 -03:00
|
|
|
k_param_throttle_max,
|
|
|
|
k_param_throttle_cruise,
|
|
|
|
k_param_throttle_slewrate,
|
2013-02-08 06:17:54 -04:00
|
|
|
k_param_throttle_reduction,
|
2013-03-14 21:04:33 -03:00
|
|
|
k_param_skid_steer_in,
|
|
|
|
k_param_skid_steer_out,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// failsafe control
|
|
|
|
k_param_fs_action = 180,
|
|
|
|
k_param_fs_timeout,
|
|
|
|
k_param_fs_throttle_enabled,
|
|
|
|
k_param_fs_throttle_value,
|
|
|
|
k_param_fs_gcs_enabled,
|
|
|
|
|
|
|
|
// obstacle control
|
2013-03-21 17:53:16 -03:00
|
|
|
k_param_sonar_enabled = 190, // deprecated, can be removed
|
2013-02-28 21:00:48 -04:00
|
|
|
k_param_sonar, // sonar object
|
2013-02-28 16:15:09 -04:00
|
|
|
k_param_sonar_trigger_cm,
|
|
|
|
k_param_sonar_turn_angle,
|
|
|
|
k_param_sonar_turn_time,
|
2013-03-21 18:49:51 -03:00
|
|
|
k_param_sonar2, // sonar2 object
|
2013-03-28 20:49:08 -03:00
|
|
|
k_param_sonar_debounce,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
//
|
2013-02-08 06:17:54 -04:00
|
|
|
// 210: driving modes
|
2012-04-30 04:17:14 -03:00
|
|
|
//
|
2013-02-07 18:21:22 -04:00
|
|
|
k_param_mode_channel = 210,
|
|
|
|
k_param_mode1,
|
|
|
|
k_param_mode2,
|
|
|
|
k_param_mode3,
|
|
|
|
k_param_mode4,
|
|
|
|
k_param_mode5,
|
|
|
|
k_param_mode6,
|
2013-06-30 21:10:38 -03:00
|
|
|
k_param_learn_channel,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
//
|
|
|
|
// 220: Waypoint data
|
|
|
|
//
|
2014-03-10 05:42:44 -03:00
|
|
|
k_param_command_total = 220, // unused
|
|
|
|
k_param_command_index, // unused
|
2012-04-30 04:17:14 -03:00
|
|
|
k_param_waypoint_radius,
|
|
|
|
|
2013-07-14 21:25:04 -03:00
|
|
|
//
|
|
|
|
// 230: camera control
|
|
|
|
//
|
|
|
|
k_param_camera,
|
|
|
|
k_param_camera_mount,
|
|
|
|
k_param_camera_mount2,
|
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
//
|
|
|
|
// 240: PID Controllers
|
2013-02-08 06:17:54 -04:00
|
|
|
k_param_pidNavSteer = 230,
|
2013-09-08 21:18:31 -03:00
|
|
|
k_param_pidServoSteer, // unused
|
2013-02-07 18:21:22 -04:00
|
|
|
k_param_pidSpeedThrottle,
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-07-14 20:57:00 -03:00
|
|
|
// high RC channels
|
|
|
|
k_param_rc_9 = 235,
|
|
|
|
k_param_rc_10,
|
|
|
|
k_param_rc_11,
|
|
|
|
k_param_rc_12,
|
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// other objects
|
|
|
|
k_param_sitl = 240,
|
|
|
|
k_param_ahrs,
|
|
|
|
k_param_ins,
|
|
|
|
k_param_compass,
|
2013-06-03 06:33:59 -03:00
|
|
|
k_param_rcmap,
|
2013-06-16 20:50:53 -03:00
|
|
|
k_param_L1_controller,
|
2013-09-08 21:18:31 -03:00
|
|
|
k_param_steerController,
|
2014-02-23 18:25:50 -04:00
|
|
|
k_param_barometer,
|
2013-02-08 06:17:54 -04:00
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
// 254,255: reserved
|
|
|
|
};
|
|
|
|
|
2013-01-17 16:56:32 -04:00
|
|
|
AP_Int16 format_version;
|
2012-04-30 04:17:14 -03:00
|
|
|
AP_Int8 software_type;
|
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// Misc
|
|
|
|
//
|
2014-03-30 18:49:15 -03:00
|
|
|
AP_Int32 log_bitmask;
|
2013-02-08 06:17:54 -04:00
|
|
|
AP_Int16 num_resets;
|
|
|
|
AP_Int8 reset_switch_chan;
|
2013-05-02 18:59:15 -03:00
|
|
|
AP_Int8 initial_mode;
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// IO pins
|
|
|
|
AP_Int8 rssi_pin;
|
|
|
|
|
2014-03-30 18:44:19 -03:00
|
|
|
// braking
|
|
|
|
AP_Int8 braking_percent;
|
2014-04-06 19:42:54 -03:00
|
|
|
AP_Float braking_speederr;
|
2014-03-30 18:44:19 -03:00
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
// Telemetry control
|
|
|
|
//
|
|
|
|
AP_Int16 sysid_this_mav;
|
|
|
|
AP_Int16 sysid_my_gcs;
|
2014-05-20 23:38:53 -03:00
|
|
|
AP_Int16 serial0_baud;
|
|
|
|
AP_Int16 serial1_baud;
|
2013-11-25 19:21:30 -04:00
|
|
|
#if MAVLINK_COMM_NUM_BUFFERS > 2
|
2014-05-20 23:38:53 -03:00
|
|
|
AP_Int16 serial2_baud;
|
2013-11-25 19:21:30 -04:00
|
|
|
#endif
|
2013-01-17 16:56:32 -04:00
|
|
|
AP_Int8 telem_delay;
|
2013-10-20 19:09:57 -03:00
|
|
|
AP_Int8 skip_gyro_cal;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// sensor parameters
|
2013-10-02 03:07:28 -03:00
|
|
|
AP_Int8 compass_enabled;
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// navigation parameters
|
2013-01-17 16:56:32 -04:00
|
|
|
//
|
2013-02-08 06:17:54 -04:00
|
|
|
AP_Float speed_cruise;
|
2013-02-21 17:38:13 -04:00
|
|
|
AP_Int8 speed_turn_gain;
|
|
|
|
AP_Float speed_turn_dist;
|
2013-02-08 06:17:54 -04:00
|
|
|
AP_Int8 ch7_option;
|
2013-03-21 19:38:25 -03:00
|
|
|
AP_Int8 auto_trigger_pin;
|
|
|
|
AP_Float auto_kickstart;
|
2013-06-16 20:50:53 -03:00
|
|
|
AP_Float turn_max_g;
|
2014-02-16 19:08:59 -04:00
|
|
|
AP_Int16 pivot_turn_angle;
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// RC channels
|
2013-06-03 06:33:59 -03:00
|
|
|
RC_Channel rc_1;
|
2013-02-08 06:17:54 -04:00
|
|
|
RC_Channel_aux rc_2;
|
2013-06-03 06:33:59 -03:00
|
|
|
RC_Channel rc_3;
|
2013-02-08 06:17:54 -04:00
|
|
|
RC_Channel_aux rc_4;
|
|
|
|
RC_Channel_aux rc_5;
|
|
|
|
RC_Channel_aux rc_6;
|
|
|
|
RC_Channel_aux rc_7;
|
|
|
|
RC_Channel_aux rc_8;
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
RC_Channel_aux rc_9;
|
|
|
|
#endif
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_APM2 || CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
RC_Channel_aux rc_10;
|
|
|
|
RC_Channel_aux rc_11;
|
|
|
|
#endif
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
RC_Channel_aux rc_12;
|
2014-03-25 00:41:38 -03:00
|
|
|
RC_Channel_aux rc_13;
|
|
|
|
RC_Channel_aux rc_14;
|
2013-07-14 20:57:00 -03:00
|
|
|
#endif
|
2013-02-08 06:17:54 -04:00
|
|
|
|
2013-01-17 16:56:32 -04:00
|
|
|
// Throttle
|
|
|
|
//
|
|
|
|
AP_Int8 throttle_min;
|
|
|
|
AP_Int8 throttle_max;
|
|
|
|
AP_Int8 throttle_cruise;
|
2013-02-08 06:17:54 -04:00
|
|
|
AP_Int8 throttle_slewrate;
|
2013-03-14 21:04:33 -03:00
|
|
|
AP_Int8 skid_steer_in;
|
|
|
|
AP_Int8 skid_steer_out;
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// failsafe control
|
|
|
|
AP_Int8 fs_action;
|
|
|
|
AP_Float fs_timeout;
|
|
|
|
AP_Int8 fs_throttle_enabled;
|
|
|
|
AP_Int16 fs_throttle_value;
|
|
|
|
AP_Int8 fs_gcs_enabled;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// obstacle control
|
2013-02-28 16:15:09 -04:00
|
|
|
AP_Int16 sonar_trigger_cm;
|
|
|
|
AP_Float sonar_turn_angle;
|
|
|
|
AP_Float sonar_turn_time;
|
2013-03-28 20:49:08 -03:00
|
|
|
AP_Int8 sonar_debounce;
|
2013-02-28 16:15:09 -04:00
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
|
|
|
|
// driving modes
|
2013-01-17 16:56:32 -04:00
|
|
|
//
|
2013-02-07 18:21:22 -04:00
|
|
|
AP_Int8 mode_channel;
|
|
|
|
AP_Int8 mode1;
|
|
|
|
AP_Int8 mode2;
|
|
|
|
AP_Int8 mode3;
|
|
|
|
AP_Int8 mode4;
|
|
|
|
AP_Int8 mode5;
|
|
|
|
AP_Int8 mode6;
|
2013-06-30 21:10:38 -03:00
|
|
|
AP_Int8 learn_channel;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-02-08 06:17:54 -04:00
|
|
|
// Waypoints
|
2013-01-17 16:56:32 -04:00
|
|
|
//
|
2013-02-08 06:17:54 -04:00
|
|
|
AP_Float waypoint_radius;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
2013-01-17 16:56:32 -04:00
|
|
|
// PID controllers
|
|
|
|
//
|
2013-02-07 18:21:22 -04:00
|
|
|
PID pidSpeedThrottle;
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
Parameters() :
|
2012-08-06 22:24:20 -03:00
|
|
|
// RC channels
|
2013-06-03 06:33:59 -03:00
|
|
|
rc_1(CH_1),
|
2013-02-07 18:21:22 -04:00
|
|
|
rc_2(CH_2),
|
2013-06-03 06:33:59 -03:00
|
|
|
rc_3(CH_3),
|
2013-02-07 18:21:22 -04:00
|
|
|
rc_4(CH_4),
|
2012-08-06 22:24:20 -03:00
|
|
|
rc_5(CH_5),
|
|
|
|
rc_6(CH_6),
|
|
|
|
rc_7(CH_7),
|
|
|
|
rc_8(CH_8),
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
rc_9 (CH_9),
|
|
|
|
#endif
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_APM2 || CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
rc_10 (CH_10),
|
|
|
|
rc_11 (CH_11),
|
|
|
|
#endif
|
2014-03-31 14:58:48 -03:00
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
2013-07-14 20:57:00 -03:00
|
|
|
rc_12 (CH_12),
|
2014-03-25 00:41:38 -03:00
|
|
|
rc_13 (CH_13),
|
|
|
|
rc_14 (CH_14),
|
2013-07-14 20:57:00 -03:00
|
|
|
#endif
|
2012-04-30 04:17:14 -03:00
|
|
|
|
|
|
|
// PID controller initial P initial I initial D initial imax
|
|
|
|
//-----------------------------------------------------------------------------------
|
2013-02-08 06:17:54 -04:00
|
|
|
pidSpeedThrottle (0.7, 0.2, 0.2, 4000)
|
2012-04-30 04:17:14 -03:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2012-08-06 22:24:20 -03:00
|
|
|
extern const AP_Param::Info var_info[];
|
|
|
|
|
2012-04-30 04:17:14 -03:00
|
|
|
#endif // PARAMETERS_H
|
|
|
|
|