2013-05-29 20:55:37 -03:00
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
2012-04-30 04:17:14 -03:00
/*
ArduPlane parameter definitions
*/
2012-08-06 22:24:20 -03:00
#define GSCALAR(v, name, def) { g.v.vtype, name, Parameters::k_param_ ## v, &g.v, {def_value:def} }
#define GGROUP(v, name, class) { AP_PARAM_GROUP, name, Parameters::k_param_ ## v, &g.v, {group_info:class::var_info} }
#define GOBJECT(v, name, class) { AP_PARAM_GROUP, name, Parameters::k_param_ ## v, &v, {group_info:class::var_info} }
const AP_Param::Info var_info[] PROGMEM = {
2013-01-17 16:56:32 -04:00
GSCALAR(format_version, "FORMAT_VERSION", 1),
2012-08-06 22:24:20 -03:00
GSCALAR(software_type, "SYSID_SW_TYPE", Parameters::k_software_type),
2013-02-08 06:17:54 -04:00
// misc
2013-05-20 23:21:38 -03:00
// @Param: LOG_BITMASK
// @DisplayName: Log bitmask
// @Description: Two byte bitmap of log types to enable in dataflash
// @Values: 0:Disabled,3950:Default,4078:Default+IMU
// @User: Advanced
2013-02-08 06:17:54 -04:00
GSCALAR(log_bitmask, "LOG_BITMASK", DEFAULT_LOG_BITMASK),
GSCALAR(num_resets, "SYS_NUM_RESETS", 0),
2013-06-03 04:55:22 -03:00
// @Param: RST_SWITCH_CH
// @DisplayName: Reset Switch Channel
// @Description: RC channel to use to reset to last flight mode after geofence takeover.
// @User: Advanced
2013-02-08 06:17:54 -04:00
GSCALAR(reset_switch_chan, "RST_SWITCH_CH", 0),
2013-05-02 18:59:15 -03:00
// @Param: INITIAL_MODE
// @DisplayName: Initial driving mode
// @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. Usuallly used in combination with when AUTO_TRIGGER_PIN or AUTO_KICKSTART.
// @Values: 0:MANUAL,2:LEARNING,3:STEERING,4:HOLD,10:AUTO,11:RTL,15:GUIDED
// @User: Advanced
GSCALAR(initial_mode, "INITIAL_MODE", MANUAL),
2013-02-08 06:17:54 -04:00
// @Param: RSSI_PIN
// @DisplayName: Receiver RSSI sensing pin
// @Description: This selects an analog pin for the receiver RSSI voltage. It assumes the voltage is 5V for max rssi, 0V for minimum
// @Values: -1:Disabled, 0:A0, 1:A1, 13:A13
// @User: Standard
GSCALAR(rssi_pin, "RSSI_PIN", -1),
// @Param: BATT_VOLT_PIN
// @DisplayName: Battery Voltage sensing pin
2013-05-30 00:38:14 -03:00
// @Description: Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. For the 3DR power brick on APM2.5 it should be set to 13. On the PX4 it should be set to 100.
// @Values: -1:Disabled, 0:A0, 1:A1, 13:A13, 100:PX4
2013-02-08 06:17:54 -04:00
// @User: Standard
GSCALAR(battery_volt_pin, "BATT_VOLT_PIN", 1),
// @Param: BATT_CURR_PIN
// @DisplayName: Battery Current sensing pin
2013-05-30 00:38:14 -03:00
// @Description: Setting this to 0 ~ 13 will enable battery current sensing on pins A0 ~ A13. For the 3DR power brick on APM2.5 it should be set to 12. On the PX4 it should be set to 101.
// @Values: -1:Disabled, 1:A1, 2:A2, 12:A12, 101:PX4
2013-02-08 06:17:54 -04:00
// @User: Standard
GSCALAR(battery_curr_pin, "BATT_CURR_PIN", 2),
// @Param: SYSID_THIS_MAV
// @DisplayName: MAVLink system ID
// @Description: ID used in MAVLink protocol to identify this vehicle
// @User: Advanced
2012-08-06 22:24:20 -03:00
GSCALAR(sysid_this_mav, "SYSID_THISMAV", MAV_SYSTEM_ID),
2013-02-08 06:17:54 -04:00
// @Param: SYSID_MYGCS
// @DisplayName: MAVLink ground station ID
// @Description: ID used in MAVLink protocol to identify the controlling ground station
// @User: Advanced
2012-08-06 22:24:20 -03:00
GSCALAR(sysid_my_gcs, "SYSID_MYGCS", 255),
2012-11-27 20:42:51 -04:00
2013-01-17 16:56:32 -04:00
// @Param: SERIAL0_BAUD
2013-02-21 17:38:13 -04:00
// @DisplayName: USB Console Baud Rate
2013-01-17 16:56:32 -04:00
// @Description: The baud rate used on the first serial port
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200
// @User: Standard
GSCALAR(serial0_baud, "SERIAL0_BAUD", SERIAL0_BAUD/1000),
2012-11-27 20:42:51 -04:00
// @Param: SERIAL3_BAUD
// @DisplayName: Telemetry Baud Rate
// @Description: The baud rate used on the telemetry port
// @Values: 1:1200,2:2400,4:4800,9:9600,19:19200,38:38400,57:57600,111:111100,115:115200
// @User: Standard
2012-08-06 22:24:20 -03:00
GSCALAR(serial3_baud, "SERIAL3_BAUD", SERIAL3_BAUD/1000),
2012-11-27 20:42:51 -04:00
// @Param: TELEM_DELAY
// @DisplayName: Telemetry startup delay
// @Description: The amount of time (in seconds) to delay radio telemetry to prevent an Xbee bricking on power up
// @User: Standard
// @Units: seconds
// @Range: 0 10
// @Increment: 1
2012-08-29 20:36:18 -03:00
GSCALAR(telem_delay, "TELEM_DELAY", 0),
2012-11-27 20:42:51 -04:00
2013-02-08 06:17:54 -04:00
// @Param: MAG_ENABLED
// @DisplayName: Magnetometer (compass) enabled
// @Description: This should be set to 1 if a compass is installed
// @User: Standard
2012-11-27 20:42:51 -04:00
// @Values: 0:Disabled,1:Enabled
2013-02-08 06:17:54 -04:00
GSCALAR(compass_enabled, "MAG_ENABLE", MAGNETOMETER),
// @Param: BATT_MONITOR
// @DisplayName: Battery monitoring
// @Description: Controls enabling monitoring of the battery's voltage and current
// @Values: 0:Disabled,3:Voltage Only,4:Voltage and Current
// @User: Standard
GSCALAR(battery_monitoring, "BATT_MONITOR", DISABLED),
// @Param: VOLT_DIVIDER
// @DisplayName: Voltage Divider
2013-06-06 19:40:45 -03:00
// @Description: Used to convert the voltage of the voltage sensing pin (BATT_VOLT_PIN) to the actual battery's voltage (pin_voltage * VOLT_DIVIDER). For the 3DR Power brick, this should be set to 10.1. For the PX4 using the PX4IO power supply this should be set to 1.
2012-11-27 20:42:51 -04:00
// @User: Advanced
2013-02-08 06:17:54 -04:00
GSCALAR(volt_div_ratio, "VOLT_DIVIDER", VOLT_DIV_RATIO),
// @Param: AMP_PER_VOLT
// @DisplayName: Current Amps per volt
// @Description: Used to convert the voltage on the current sensing pin (BATT_CURR_PIN) to the actual current being consumed in amps (curr pin voltage * INPUT_VOLTS/1024 * AMP_PER_VOLT )
// @User: Advanced
GSCALAR(curr_amp_per_volt, "AMP_PER_VOLT", CURR_AMP_PER_VOLT),
// @Param: BATT_CAPACITY
// @DisplayName: Battery Capacity
// @Description: Battery capacity in milliamp-hours (mAh)
// @Units: mAh
2013-05-21 03:59:13 -03:00
// @User: Standard
2013-02-08 06:17:54 -04:00
GSCALAR(pack_capacity, "BATT_CAPACITY", HIGH_DISCHARGE),
2012-11-27 20:42:51 -04:00
// @Param: XTRK_GAIN_SC
// @DisplayName: Crosstrack Gain
2013-02-07 18:21:22 -04:00
// @Description: This controls how hard the Rover tries to follow the lines between waypoints, as opposed to driving directly to the next waypoint. The value is the scale between distance off the line and angle to meet the line (in Degrees * 100)
2012-11-27 20:42:51 -04:00
// @Range: 0 2000
// @Increment: 1
// @User: Standard
2012-08-06 22:24:20 -03:00
GSCALAR(crosstrack_gain, "XTRK_GAIN_SC", XTRACK_GAIN_SCALED),
2012-11-27 20:42:51 -04:00
// @Param: XTRK_ANGLE_CD
// @DisplayName: Crosstrack Entry Angle
// @Description: Maximum angle used to correct for track following.
// @Units: centi-Degrees
// @Range: 0 9000
// @Increment: 1
// @User: Standard
2012-08-06 22:24:20 -03:00
GSCALAR(crosstrack_entry_angle, "XTRK_ANGLE_CD", XTRACK_ENTRY_ANGLE_CENTIDEGREE),
2012-04-30 04:17:14 -03:00
2013-03-21 19:38:25 -03:00
// @Param: AUTO_TRIGGER_PIN
// @DisplayName: Auto mode trigger pin
2013-06-01 18:55:38 -03:00
// @Description: pin number to use to enable the throttle in auto mode. If set to -1 then don't use a trigger, otherwise this is a pin number which if held low in auto mode will enable the motor to run. If the switch is released while in AUTO then the motor will stop again. This can be used in combination with INITIAL_MODE to give a 'press button to start' rover with no receiver.
// @Values: -1:Disabled,0-8:TiggerPin
2013-03-21 19:38:25 -03:00
// @User: standard
GSCALAR(auto_trigger_pin, "AUTO_TRIGGER_PIN", -1),
// @Param: AUTO_KICKSTART
// @DisplayName: Auto mode trigger kickstart acceleration
2013-03-21 21:22:02 -03:00
// @Description: X acceleration in meters/second/second to use to trigger the motor start in auto mode. If set to zero then auto throttle starts immediately when the mode switch happens, otherwise the rover waits for the X acceleration to go above this value before it will start the motor
// @Units: m/s/s
2013-03-21 19:38:25 -03:00
// @Range: 0 20
2013-03-21 21:22:02 -03:00
// @Increment: 0.1
2013-03-21 19:38:25 -03:00
// @User: standard
GSCALAR(auto_kickstart, "AUTO_KICKSTART", 0.0f),
2013-02-08 06:17:54 -04:00
// @Param: CRUISE_SPEED
2013-02-21 17:38:13 -04:00
// @DisplayName: Target cruise speed in auto modes
2013-02-08 06:17:54 -04:00
// @Description: The target speed in auto missions.
// @Units: m/s
// @Range: 0 100
2013-02-07 18:21:22 -04:00
// @Increment: 0.1
// @User: Standard
2013-02-08 06:17:54 -04:00
GSCALAR(speed_cruise, "CRUISE_SPEED", 5),
2013-02-21 17:38:13 -04:00
// @Param: SPEED_TURN_GAIN
// @DisplayName: Target speed reduction while turning
// @Description: The percentage to reduce the throttle while turning. If this is 100% then the target speed is not reduced while turning. If this is 50% then the target speed is reduced in proportion to the turn rate, with a reduction of 50% when the steering is maximally deflected.
// @Units: percent
// @Range: 0 100
// @Increment: 1
// @User: Standard
GSCALAR(speed_turn_gain, "SPEED_TURN_GAIN", 50),
// @Param: SPEED_TURN_DIST
// @DisplayName: Distance to turn to start reducing speed
// @Description: The distance to the next turn at which the rover reduces its target speed by the SPEED_TURN_GAIN
// @Units: meters
// @Range: 0 100
// @Increment: 0.1
// @User: Standard
GSCALAR(speed_turn_dist, "SPEED_TURN_DIST", 2.0f),
2013-02-08 06:17:54 -04:00
// @Param: CH7_OPTION
// @DisplayName: Channel 7 option
// @Description: What to do use channel 7 for
// @Values: 0:Nothing,1:LearnWaypoint
// @User: Standard
GSCALAR(ch7_option, "CH7_OPTION", CH7_OPTION),
2013-06-03 04:55:22 -03:00
// @Group: RC1_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-06-03 06:33:59 -03:00
GGROUP(rc_1, "RC1_", RC_Channel),
2013-06-03 04:55:22 -03:00
// @Group: RC2_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_2, "RC2_", RC_Channel_aux),
2013-06-03 04:55:22 -03:00
// @Group: RC3_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-06-03 06:33:59 -03:00
GGROUP(rc_3, "RC3_", RC_Channel),
2013-06-03 04:55:22 -03:00
// @Group: RC4_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_4, "RC4_", RC_Channel_aux),
2013-06-03 04:55:22 -03:00
// @Group: RC5_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_5, "RC5_", RC_Channel_aux),
2013-06-03 04:55:22 -03:00
// @Group: RC6_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_6, "RC6_", RC_Channel_aux),
2013-06-03 04:55:22 -03:00
// @Group: RC7_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_7, "RC7_", RC_Channel_aux),
2013-06-03 04:55:22 -03:00
// @Group: RC8_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp
2013-02-08 06:17:54 -04:00
GGROUP(rc_8, "RC8_", RC_Channel_aux),
2012-04-30 04:17:14 -03:00
2013-07-14 20:57:00 -03:00
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
// @Group: RC9_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_9, "RC9_", RC_Channel_aux),
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_APM2 || CONFIG_HAL_BOARD == HAL_BOARD_PX4
// @Group: RC10_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_10, "RC10_", RC_Channel_aux),
// @Group: RC11_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_11, "RC11_", RC_Channel_aux),
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
// @Group: RC12_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_12, "RC12_", RC_Channel_aux),
#endif
2012-11-27 20:42:51 -04:00
// @Param: THR_MIN
// @DisplayName: Minimum Throttle
2013-02-07 18:21:22 -04:00
// @Description: The minimum throttle setting to which the autopilot will apply. This is mostly useful for rovers with internal combustion motors, to prevent the motor from cutting out in auto mode.
2012-11-27 20:42:51 -04:00
// @Units: Percent
// @Range: 0 100
// @Increment: 1
// @User: Standard
2012-08-06 22:24:20 -03:00
GSCALAR(throttle_min, "THR_MIN", THROTTLE_MIN),
2012-11-27 20:42:51 -04:00
// @Param: THR_MAX
// @DisplayName: Maximum Throttle
2013-02-21 17:38:13 -04:00
// @Description: The maximum throttle setting to which the autopilot will apply. This can be used to prevent overheating a ESC or motor on an electric rover.
2012-11-27 20:42:51 -04:00
// @Units: Percent
// @Range: 0 100
// @Increment: 1
// @User: Standard
2012-08-06 22:24:20 -03:00
GSCALAR(throttle_max, "THR_MAX", THROTTLE_MAX),
2012-11-27 20:42:51 -04:00
2013-02-08 06:17:54 -04:00
// @Param: CRUISE_THROTTLE
// @DisplayName: Base throttle percentage in auto
2013-02-21 17:38:13 -04:00
// @Description: The base throttle percentage to use in auto mode. The CRUISE_SPEED parameter controls the target speed, but the rover starts with the CRUISE_THROTTLE setting as the initial estimate for how much throttle is needed to achieve that speed. It then adjusts the throttle based on how fast the rover is actually going.
2013-02-08 06:17:54 -04:00
// @Units: Percent
// @Range: 0 100
// @Increment: 1
// @User: Standard
GSCALAR(throttle_cruise, "CRUISE_THROTTLE", 50),
2012-11-27 20:42:51 -04:00
// @Param: THR_SLEWRATE
2012-12-03 20:38:29 -04:00
// @DisplayName: Throttle slew rate
2013-02-08 06:17:54 -04:00
// @Description: maximum percentage change in throttle per second. A setting of 10 means to not change the throttle by more than 10% of the full throttle range in one second. A value of zero means no limit.
2012-11-27 20:42:51 -04:00
// @Units: Percent
// @Range: 0 100
// @Increment: 1
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(throttle_slewrate, "THR_SLEWRATE", 0),
2012-11-27 20:42:51 -04:00
2013-03-14 21:04:33 -03:00
// @Param: SKID_STEER_OUT
// @DisplayName: Skid steering output
// @Description: Set this to 1 for skid steering controlled rovers (tank track style). When enabled, servo1 is used for the left track control, servo3 is used for right track control
// @Values: 0:Disabled, 1:SkidSteeringOutput
// @User: Standard
GSCALAR(skid_steer_out, "SKID_STEER_OUT", 0),
// @Param: SKID_STEER_IN
// @DisplayName: Skid steering input
// @Description: Set this to 1 for skid steering input rovers (tank track style in RC controller). When enabled, servo1 is used for the left track control, servo3 is used for right track control
2013-03-29 08:46:58 -03:00
// @Values: 0:Disabled, 1:SkidSteeringInput
2013-03-14 21:04:33 -03:00
// @User: Standard
GSCALAR(skid_steer_in, "SKID_STEER_IN", 0),
2013-02-08 06:17:54 -04:00
// @Param: FS_ACTION
// @DisplayName: Failsafe Action
// @Description: What to do on a failsafe event
2013-03-28 20:25:53 -03:00
// @Values: 0:Nothing,1:RTL,2:HOLD
2013-02-08 06:17:54 -04:00
// @User: Standard
2013-03-28 21:34:42 -03:00
GSCALAR(fs_action, "FS_ACTION", 2),
2013-02-08 06:17:54 -04:00
// @Param: FS_TIMEOUT
// @DisplayName: Failsafe timeout
// @Description: How long a failsafe event need to happen for before we trigger the failsafe action
// @Units: seconds
// @User: Standard
2013-03-28 20:25:53 -03:00
GSCALAR(fs_timeout, "FS_TIMEOUT", 5),
2013-02-08 06:17:54 -04:00
// @Param: FS_THR_ENABLE
2012-11-27 20:42:51 -04:00
// @DisplayName: Throttle Failsafe Enable
2013-03-29 08:46:58 -03:00
// @Description: The throttle failsafe allows you to configure a software failsafe activated by a setting on the throttle input channel to a low value. This can be used to detect the RC transmitter going out of range. Failsafe will be triggered when the throttle channel goes below the FS_THR_VALUE for FS_TIMEOUT seconds.
2012-11-27 20:42:51 -04:00
// @Values: 0:Disabled,1:Enabled
// @User: Standard
2013-03-28 21:34:42 -03:00
GSCALAR(fs_throttle_enabled, "FS_THR_ENABLE", 1),
2012-11-27 20:42:51 -04:00
2013-02-08 06:17:54 -04:00
// @Param: FS_THR_VALUE
2012-11-27 20:42:51 -04:00
// @DisplayName: Throttle Failsafe Value
2013-02-07 18:21:22 -04:00
// @Description: The PWM level on channel 3 below which throttle sailsafe triggers.
2013-06-18 03:57:11 -03:00
// @Range: 925 1100
// @Increment: 1
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-03-28 21:34:42 -03:00
GSCALAR(fs_throttle_value, "FS_THR_VALUE", 910),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: FS_GCS_ENABLE
2012-11-27 20:42:51 -04:00
// @DisplayName: GCS failsafe enable
2013-03-29 08:46:58 -03:00
// @Description: Enable ground control station telemetry failsafe. When enabled the Rover will execute the FS_ACTION when it fails to receive MAVLink heartbeat packets for FS_TIMEOUT seconds.
2012-11-27 20:42:51 -04:00
// @Values: 0:Disabled,1:Enabled
// @User: Standard
2013-02-08 06:17:54 -04:00
GSCALAR(fs_gcs_enabled, "FS_GCS_ENABLE", 0),
2013-02-28 16:15:09 -04:00
// @Param: SONAR_TRIGGER_CM
// @DisplayName: Sonar trigger distance
2013-03-29 08:46:58 -03:00
// @Description: The distance from an obstacle in centimeters at which the sonar triggers a turn to avoid the obstacle
2013-02-28 16:15:09 -04:00
// @Units: centimeters
// @Range: 0 1000
// @Increment: 1
// @User: Standard
GSCALAR(sonar_trigger_cm, "SONAR_TRIGGER_CM", 100),
// @Param: SONAR_TURN_ANGLE
// @DisplayName: Sonar trigger angle
// @Description: The course deviation in degrees to apply while avoiding an obstacle detected with the sonar. A positive number means to turn right, and a negative angle means to turn left.
// @Units: centimeters
2013-03-01 07:32:57 -04:00
// @Range: -45 45
2013-02-28 16:15:09 -04:00
// @Increment: 1
// @User: Standard
GSCALAR(sonar_turn_angle, "SONAR_TURN_ANGLE", 45),
// @Param: SONAR_TURN_TIME
// @DisplayName: Sonar turn time
// @Description: The amount of time in seconds to apply the SONAR_TURN_ANGLE after detecting an obstacle.
// @Units: seconds
// @Range: 0 100
// @Increment: 0.1
// @User: Standard
2013-02-28 22:06:04 -04:00
GSCALAR(sonar_turn_time, "SONAR_TURN_TIME", 1.0f),
2013-02-28 16:15:09 -04:00
2013-03-28 20:49:08 -03:00
// @Param: SONAR_DEBOUNCE
// @DisplayName: Sonar debounce count
2013-03-29 08:46:58 -03:00
// @Description: The number of 50Hz sonar hits needed to trigger an obstacle avoidance event. If you get a lot of false sonar events then raise this number, but if you make it too large then it will cause lag in detecting obstacles, which could cause you go hit the obstacle.
2013-03-28 20:49:08 -03:00
// @Range: 1 100
// @Increment: 1
// @User: Standard
GSCALAR(sonar_debounce, "SONAR_DEBOUNCE", 2),
2013-06-30 21:10:38 -03:00
// @Param: LEARN_CH
// @DisplayName: Learning channel
// @Description: RC Channel to use for learning waypoints
// @User: Advanced
GSCALAR(learn_channel, "LEARN_CH", 7),
2013-02-07 18:21:22 -04:00
// @Param: MODE_CH
// @DisplayName: Mode channel
2013-02-08 06:17:54 -04:00
// @Description: RC Channel to use for driving mode control
2012-11-27 20:42:51 -04:00
// @User: Advanced
2013-02-07 18:21:22 -04:00
GSCALAR(mode_channel, "MODE_CH", MODE_CHANNEL),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE1
// @DisplayName: Mode1
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 1 (910 to 1230 and above 2049)
2013-02-07 18:21:22 -04:00
GSCALAR(mode1, "MODE1", MODE_1),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE2
// @DisplayName: Mode2
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 2 (1231 to 1360)
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(mode2, "MODE2", MODE_2),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE3
// @DisplayName: Mode3
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 3 (1361 to 1490)
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(mode3, "MODE3", MODE_3),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE4
// @DisplayName: Mode4
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 4 (1491 to 1620)
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(mode4, "MODE4", MODE_4),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE5
// @DisplayName: Mode5
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 5 (1621 to 1749)
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(mode5, "MODE5", MODE_5),
2012-11-27 20:42:51 -04:00
2013-02-07 18:21:22 -04:00
// @Param: MODE6
// @DisplayName: Mode6
2013-02-08 06:17:54 -04:00
// @Description: Driving mode for switch position 6 (1750 to 2049)
2013-03-28 18:53:20 -03:00
// @Values: 0:Manual,2:LEARNING,3:STEERING,4:HOLD,10:Auto,11:RTL,15:Guided
2012-11-27 20:42:51 -04:00
// @User: Standard
2013-02-07 18:21:22 -04:00
GSCALAR(mode6, "MODE6", MODE_6),
2012-08-06 22:24:20 -03:00
2013-02-08 06:17:54 -04:00
GSCALAR(command_total, "CMD_TOTAL", 0),
GSCALAR(command_index, "CMD_INDEX", 0),
2012-12-18 07:44:12 -04:00
2013-02-08 06:17:54 -04:00
// @Param: WP_RADIUS
// @DisplayName: Waypoint radius
// @Description: The distance in meters from a waypoint when we consider the waypoint has been reached. This determines when the rover will turn along the next waypoint path.
// @Units: meters
// @Range: 0 1000
// @Increment: 0.1
2012-12-18 07:44:12 -04:00
// @User: Standard
2013-02-08 06:17:54 -04:00
GSCALAR(waypoint_radius, "WP_RADIUS", 2.0f),
2012-04-30 04:17:14 -03:00
2013-02-07 18:21:22 -04:00
GGROUP(pidNavSteer, "HDNG2STEER_", PID),
GGROUP(pidServoSteer, "STEER2SRV_", PID),
GGROUP(pidSpeedThrottle, "SPEED2THR_", PID),
2012-04-30 04:17:14 -03:00
// variables not in the g class which contain EEPROM saved variables
2013-06-03 04:55:22 -03:00
// @Group: COMPASS_
// @Path: ../libraries/AP_Compass/Compass.cpp
2012-04-30 04:17:14 -03:00
GOBJECT(compass, "COMPASS_", Compass),
2013-06-03 04:55:22 -03:00
2013-06-03 21:37:05 -03:00
// @Group: SCHED_
// @Path: ../libraries/AP_Scheduler/AP_Scheduler.cpp
GOBJECT(scheduler, "SCHED_", AP_Scheduler),
2013-06-24 23:48:58 -03:00
// @Group: RELAY_
// @Path: ../libraries/AP_Relay/AP_Relay.cpp
GOBJECT(relay, "RELAY_", AP_Relay),
2013-06-03 06:33:59 -03:00
// @Group: RCMAP_
// @Path: ../libraries/AP_RCMapper/AP_RCMapper.cpp
GOBJECT(rcmap, "RCMAP_", RCMapper),
2012-04-30 04:17:14 -03:00
GOBJECT(gcs0, "SR0_", GCS_MAVLINK),
GOBJECT(gcs3, "SR3_", GCS_MAVLINK),
2012-11-07 03:28:20 -04:00
2013-02-28 21:00:48 -04:00
// @Group: SONAR_
// @Path: ../libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp
GOBJECT(sonar, "SONAR_", AP_RangeFinder_analog),
2013-05-16 18:38:34 -03:00
// @Group: SONAR2_
// @Path: ../libraries/AP_RangeFinder/AP_RangeFinder_analog.cpp
2013-03-21 18:49:51 -03:00
GOBJECT(sonar2, "SONAR2_", AP_RangeFinder_analog),
2013-02-28 21:00:48 -04:00
2012-11-07 03:28:20 -04:00
// @Group: INS_
// @Path: ../libraries/AP_InertialSensor/AP_InertialSensor.cpp
GOBJECT(ins, "INS_", AP_InertialSensor),
2012-08-06 22:24:20 -03:00
2012-12-18 07:44:12 -04:00
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
2012-11-27 08:20:25 -04:00
// @Group: SIM_
// @Path: ../libraries/SITL/SITL.cpp
GOBJECT(sitl, "SIM_", SITL),
#endif
2012-11-17 02:45:20 -04:00
// @Group: AHRS_
// @Path: ../libraries/AP_AHRS/AP_AHRS.cpp
GOBJECT(ahrs, "AHRS_", AP_AHRS),
2013-07-14 20:57:00 -03:00
#if CAMERA == ENABLED
// @Group: CAM_
// @Path: ../libraries/AP_Camera/AP_Camera.cpp
GOBJECT(camera, "CAM_", AP_Camera),
#endif
#if MOUNT == ENABLED
// @Group: MNT_
// @Path: ../libraries/AP_Mount/AP_Mount.cpp
GOBJECT(camera_mount, "MNT_", AP_Mount),
#endif
2012-08-06 22:24:20 -03:00
AP_VAREND
2012-04-30 04:17:14 -03:00
};
static void load_parameters(void)
{
if (!g.format_version.load() ||
g.format_version != Parameters::k_format_version) {
// erase all parameters
2012-11-21 02:25:11 -04:00
cliSerial->printf_P(PSTR("Firmware change: erasing EEPROM...\n"));
2012-04-30 04:17:14 -03:00
AP_Param::erase_all();
// save the current format version
g.format_version.set_and_save(Parameters::k_format_version);
2012-11-21 02:25:11 -04:00
cliSerial->println_P(PSTR("done."));
2012-04-30 04:17:14 -03:00
} else {
unsigned long before = micros();
// Load all auto-loaded EEPROM variables
AP_Param::load_all();
2012-11-21 02:25:11 -04:00
cliSerial->printf_P(PSTR("load_all took %luus\n"), micros() - before);
2012-04-30 04:17:14 -03:00
}
}