mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 23:48:31 -04:00
5d63a05de7
removed FBW mode - no longer needed added set_throttle_cruise_flag to auto set the throttle value for alt hold added altitude minimum option for waypoints added support for relative WPs added support for Yaw tracking per WP in options bitmask lowered default sonar kD value increased minimal value to set the throttle cruise value with CH7 switch updated README.txt added additional stock test missions available in CLI git-svn-id: https://arducopter.googlecode.com/svn/trunk@1856 f9c3cf11-9bcb-44bc-f272-b75c42450872
561 lines
14 KiB
C
561 lines
14 KiB
C
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
//
|
|
// DO NOT EDIT this file to adjust your configuration. Create your own
|
|
// APM_Config.h and use APM_Config.h.example as a reference.
|
|
//
|
|
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
|
///
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Default and automatic configuration details.
|
|
//
|
|
// Notes for maintainers:
|
|
//
|
|
// - Try to keep this file organised in the same order as APM_Config.h.example
|
|
//
|
|
|
|
#include "defines.h"
|
|
|
|
///
|
|
/// DO NOT EDIT THIS INCLUDE - if you want to make a local change, make that
|
|
/// change in your local copy of APM_Config.h.
|
|
///
|
|
#include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER.
|
|
///
|
|
/// DO NOT EDIT THIS INCLUDE - if you want to make a local change, make that
|
|
/// change in your local copy of APM_Config.h.
|
|
///
|
|
|
|
// Just so that it's completely clear...
|
|
#define ENABLED 1
|
|
#define DISABLED 0
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// HARDWARE CONFIGURATION AND CONNECTIONS
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// FRAME_CONFIG
|
|
//
|
|
#ifndef FRAME_CONFIG
|
|
# define FRAME_CONFIG PLUS_FRAME
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Sonar
|
|
//
|
|
#ifndef SONAR_PIN
|
|
# define SONAR_PIN AP_RANGEFINDER_PITOT_TUBE
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// AIRSPEED_SENSOR
|
|
// AIRSPEED_RATIO
|
|
//
|
|
#ifndef AIRSPEED_SENSOR
|
|
# define AIRSPEED_SENSOR DISABLED
|
|
#endif
|
|
#ifndef AIRSPEED_RATIO
|
|
# define AIRSPEED_RATIO 1.9936 // Note - this varies from the value in ArduPilot due to the difference in ADC resolution
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// HIL_PROTOCOL OPTIONAL
|
|
// HIL_MODE OPTIONAL
|
|
// HIL_PORT OPTIONAL
|
|
|
|
#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
|
|
|
|
# undef GPS_PROTOCOL
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_NONE
|
|
|
|
#ifndef HIL_PROTOCOL
|
|
# error Must define HIL_PROTOCOL if HIL_MODE is not disabled
|
|
#endif
|
|
|
|
#ifndef HIL_PORT
|
|
# error Must define HIL_PORT if HIL_PROTOCOL is set
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
// If we are in XPlane, diasble the mag
|
|
#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
|
|
|
|
// check xplane settings
|
|
#if HIL_PROTOCOL == HIL_PROTOCOL_XPLANE
|
|
|
|
// MAGNETOMETER not supported by XPLANE
|
|
# undef MAGNETOMETER
|
|
# define MAGNETOMETER DISABLED
|
|
|
|
# if HIL_MODE != HIL_MODE_ATTITUDE
|
|
# error HIL_PROTOCOL_XPLANE requires HIL_MODE_ATTITUDE
|
|
# endif
|
|
|
|
#endif
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// GPS_PROTOCOL
|
|
//
|
|
// Note that this test must follow the HIL_PROTOCOL block as the HIL
|
|
// setup may override the GPS configuration.
|
|
//
|
|
#ifndef GPS_PROTOCOL
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_AUTO
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// GCS_PROTOCOL
|
|
// GCS_PORT
|
|
//
|
|
#ifndef GCS_PROTOCOL
|
|
# define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Serial port speeds.
|
|
//
|
|
#ifndef SERIAL0_BAUD
|
|
# define SERIAL0_BAUD 115200
|
|
#endif
|
|
#ifndef SERIAL3_BAUD
|
|
# define SERIAL3_BAUD 57600
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Battery monitoring
|
|
//
|
|
#ifndef BATTERY_EVENT
|
|
# define BATTERY_EVENT DISABLED
|
|
#endif
|
|
#ifndef BATTERY_TYPE
|
|
# define BATTERY_TYPE 0
|
|
#endif
|
|
#ifndef LOW_VOLTAGE
|
|
# define LOW_VOLTAGE 9.6
|
|
#endif
|
|
#ifndef VOLT_DIV_RATIO
|
|
# define VOLT_DIV_RATIO 3.0
|
|
#endif
|
|
|
|
#ifndef CURR_VOLT_DIV_RATIO
|
|
# define CURR_VOLT_DIV_RATIO 15.7
|
|
#endif
|
|
#ifndef CURR_AMP_DIV_RATIO
|
|
# define CURR_AMP_DIV_RATIO 30.35
|
|
#endif
|
|
#ifndef CURR_AMP_HOURS
|
|
# define CURR_AMP_HOURS 2000
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// INPUT_VOLTAGE
|
|
//
|
|
#ifndef INPUT_VOLTAGE
|
|
# define INPUT_VOLTAGE 5.0
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// MAGNETOMETER
|
|
#ifndef MAGNETOMETER
|
|
# define MAGNETOMETER DISABLED
|
|
#endif
|
|
#ifndef MAG_ORIENTATION
|
|
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// RADIO CONFIGURATION
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// FLIGHT_MODE
|
|
// FLIGHT_MODE_CHANNEL
|
|
//
|
|
#ifndef FLIGHT_MODE_CHANNEL
|
|
# define FLIGHT_MODE_CHANNEL CH_5
|
|
#endif
|
|
#if (FLIGHT_MODE_CHANNEL != CH_5) && (FLIGHT_MODE_CHANNEL != CH_6) && (FLIGHT_MODE_CHANNEL != CH_7) && (FLIGHT_MODE_CHANNEL != CH_8)
|
|
# error XXX
|
|
# error XXX You must set FLIGHT_MODE_CHANNEL to 5, 6, 7 or 8
|
|
# error XXX
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_1)
|
|
# define FLIGHT_MODE_1 STABILIZE
|
|
#endif
|
|
#if !defined(FLIGHT_MODE_2)
|
|
# define FLIGHT_MODE_2 STABILIZE
|
|
#endif
|
|
#if !defined(FLIGHT_MODE_3)
|
|
# define FLIGHT_MODE_3 STABILIZE
|
|
#endif
|
|
#if !defined(FLIGHT_MODE_4)
|
|
# define FLIGHT_MODE_4 STABILIZE
|
|
#endif
|
|
#if !defined(FLIGHT_MODE_5)
|
|
# define FLIGHT_MODE_5 STABILIZE
|
|
#endif
|
|
#if !defined(FLIGHT_MODE_6)
|
|
# define FLIGHT_MODE_6 STABILIZE
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// THROTTLE_FAILSAFE
|
|
// THROTTLE_FS_VALUE
|
|
// THROTTLE_FAILSAFE_ACTION
|
|
//
|
|
#ifndef THROTTLE_FAILSAFE
|
|
# define THROTTLE_FAILSAFE DISABLED
|
|
#endif
|
|
#ifndef THROTTE_FS_VALUE
|
|
# define THROTTLE_FS_VALUE 975
|
|
#endif
|
|
#ifndef THROTTLE_FAILSAFE_ACTION
|
|
# define THROTTLE_FAILSAFE_ACTION 2
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// STARTUP BEHAVIOUR
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// GROUND_START_DELAY
|
|
//
|
|
#ifndef GROUND_START_DELAY
|
|
# define GROUND_START_DELAY 0
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// FLIGHT AND NAVIGATION CONTROL
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// ACRO Rate Control
|
|
|
|
#ifndef ACRO_RATE_ROLL_P
|
|
# define ACRO_RATE_ROLL_P .190
|
|
#endif
|
|
#ifndef ACRO_RATE_ROLL_I
|
|
# define ACRO_RATE_ROLL_I 0.0
|
|
#endif
|
|
#ifndef ACRO_RATE_ROLL_D
|
|
# define ACRO_RATE_ROLL_D 0.0
|
|
#endif
|
|
#ifndef ACRO_RATE_ROLL_IMAX
|
|
# define ACRO_RATE_ROLL_IMAX 20
|
|
#endif
|
|
# define ACRO_RATE_ROLL_IMAX_CENTIDEGREE ACRO_RATE_ROLL_IMAX * 100
|
|
|
|
#ifndef ACRO_RATE_PITCH_P
|
|
# define ACRO_RATE_PITCH_P .190
|
|
#endif
|
|
#ifndef ACRO_RATE_PITCH_I
|
|
# define ACRO_RATE_PITCH_I 0.0
|
|
#endif
|
|
#ifndef ACRO_RATE_PITCH_D
|
|
# define ACRO_RATE_PITCH_D 0.0
|
|
#endif
|
|
#ifndef ACRO_RATE_PITCH_IMAX
|
|
# define ACRO_RATE_PITCH_IMAX 20
|
|
#endif
|
|
#define ACRO_RATE_PITCH_IMAX_CENTIDEGREE ACRO_RATE_PITCH_IMAX * 100
|
|
|
|
#ifndef ACRO_RATE_YAW_P
|
|
# define ACRO_RATE_YAW_P .1
|
|
#endif
|
|
#ifndef ACRO_RATE_YAW_I
|
|
# define ACRO_RATE_YAW_I 0.0
|
|
#endif
|
|
#ifndef ACRO_RATE_YAW_D
|
|
# define ACRO_RATE_YAW_D 0.05
|
|
#endif
|
|
#ifndef ACRO_RATE_YAW_IMAX
|
|
# define ACRO_RATE_YAW_IMAX 0
|
|
#endif
|
|
# define ACRO_RATE_YAW_IMAX_CENTIDEGREE ACRO_RATE_YAW_IMAX * 100
|
|
|
|
#ifndef ACRO_RATE_TRIGGER
|
|
# define ACRO_RATE_TRIGGER 0
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// STABILZE Angle Control
|
|
//
|
|
#ifndef STABILIZE_ROLL_P
|
|
# define STABILIZE_ROLL_P 0.6
|
|
#endif
|
|
#ifndef STABILIZE_ROLL_I
|
|
# define STABILIZE_ROLL_I 0.0
|
|
#endif
|
|
#ifndef STABILIZE_ROLL_D
|
|
# define STABILIZE_ROLL_D 0.0
|
|
#endif
|
|
#ifndef STABILIZE_ROLL_IMAX
|
|
# define STABILIZE_ROLL_IMAX 3
|
|
#endif
|
|
|
|
#ifndef STABILIZE_PITCH_P
|
|
# define STABILIZE_PITCH_P 0.6
|
|
#endif
|
|
#ifndef STABILIZE_PITCH_I
|
|
# define STABILIZE_PITCH_I 0.0
|
|
#endif
|
|
#ifndef STABILIZE_PITCH_D
|
|
# define STABILIZE_PITCH_D 0.0
|
|
#endif
|
|
#ifndef STABILIZE_PITCH_IMAX
|
|
# define STABILIZE_PITCH_IMAX 3
|
|
#endif
|
|
|
|
// STABILZE RATE Control
|
|
//
|
|
#ifndef STABILIZE_DAMPENER
|
|
# define STABILIZE_DAMPENER 0.135
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// YAW Control
|
|
//
|
|
#ifndef YAW_P
|
|
# define YAW_P 0.25
|
|
#endif
|
|
#ifndef YAW_I
|
|
# define YAW_I 0.0
|
|
#endif
|
|
#ifndef YAW_D
|
|
# define YAW_D 0.0
|
|
#endif
|
|
#ifndef YAW_IMAX
|
|
# define YAW_IMAX 1
|
|
#endif
|
|
|
|
// STABILZE YAW Control
|
|
//
|
|
#ifndef HOLD_YAW_DAMPENER
|
|
# define HOLD_YAW_DAMPENER 0.175
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Throttle control
|
|
//
|
|
#ifndef THROTTLE_MIN
|
|
# define THROTTLE_MIN 0
|
|
#endif
|
|
#ifndef THROTTLE_CRUISE
|
|
# define THROTTLE_CRUISE 250
|
|
#endif
|
|
#ifndef THROTTLE_MAX
|
|
# define THROTTLE_MAX 1000
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Autopilot control limits
|
|
//
|
|
// how much to we pitch towards the target
|
|
#ifndef PITCH_MAX
|
|
# define PITCH_MAX 36
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Navigation control gains
|
|
//
|
|
#ifndef NAV_P
|
|
# define NAV_P 2.0
|
|
#endif
|
|
#ifndef NAV_I
|
|
# define NAV_I 0.1
|
|
#endif
|
|
#ifndef NAV_D
|
|
# define NAV_D 0.00
|
|
#endif
|
|
#ifndef NAV_IMAX
|
|
# define NAV_IMAX 250
|
|
#endif
|
|
# define NAV_IMAX_CENTIDEGREE NAV_IMAX * 100
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Throttle control gains
|
|
//
|
|
#ifndef THROTTLE_BARO_P
|
|
# define THROTTLE_BARO_P 0.25
|
|
#endif
|
|
#ifndef THROTTLE_BARO_I
|
|
# define THROTTLE_BARO_I 0.01
|
|
#endif
|
|
#ifndef THROTTLE_BARO_D
|
|
# define THROTTLE_BARO_D 0.2
|
|
#endif
|
|
#ifndef THROTTLE_BARO_IMAX
|
|
# define THROTTLE_BARO_IMAX 50
|
|
#endif
|
|
|
|
|
|
#ifndef THROTTLE_SONAR_P
|
|
# define THROTTLE_SONAR_P .3
|
|
#endif
|
|
#ifndef THROTTLE_SONAR_I
|
|
# define THROTTLE_SONAR_I 0.01
|
|
#endif
|
|
#ifndef THROTTLE_SONAR_D
|
|
# define THROTTLE_SONAR_D 0.03
|
|
#endif
|
|
#ifndef THROTTLE_SONAR_IMAX
|
|
# define THROTTLE_SONAR_IMAX 50
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Crosstrack compensation
|
|
//
|
|
#ifndef XTRACK_GAIN
|
|
# define XTRACK_GAIN 1 // deg/m
|
|
#endif
|
|
#ifndef XTRACK_ENTRY_ANGLE
|
|
# define XTRACK_ENTRY_ANGLE 30 // deg
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// DEBUGGING
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// DEBUG_LEVEL
|
|
//
|
|
#ifndef DEBUG_LEVEL
|
|
# define DEBUG_LEVEL SEVERITY_LOW
|
|
#endif
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Dataflash logging control
|
|
//
|
|
#ifndef LOG_ATTITUDE_FAST
|
|
# define LOG_ATTITUDE_FAST DISABLED
|
|
#endif
|
|
#ifndef LOG_ATTITUDE_MED
|
|
# define LOG_ATTITUDE_MED ENABLED
|
|
#endif
|
|
#ifndef LOG_GPS
|
|
# define LOG_GPS ENABLED
|
|
#endif
|
|
#ifndef LOG_PM
|
|
# define LOG_PM ENABLED
|
|
#endif
|
|
#ifndef LOG_CTUN
|
|
# define LOG_CTUN DISABLED
|
|
#endif
|
|
#ifndef LOG_NTUN
|
|
# define LOG_NTUN DISABLED
|
|
#endif
|
|
#ifndef LOG_MODE
|
|
# define LOG_MODE ENABLED
|
|
#endif
|
|
#ifndef LOG_RAW
|
|
# define LOG_RAW DISABLED
|
|
#endif
|
|
#ifndef LOG_CMD
|
|
# define LOG_CMD ENABLED
|
|
#endif
|
|
#ifndef LOG_CURRENT
|
|
# define LOG_CURRENT DISABLED
|
|
#endif
|
|
|
|
#ifndef DEBUG_PORT
|
|
# define DEBUG_PORT 0
|
|
#endif
|
|
|
|
#if DEBUG_PORT == 0
|
|
# define SendDebug_P(a) Serial.print_P(PSTR(a))
|
|
# define SendDebugln_P(a) Serial.println_P(PSTR(a))
|
|
# define SendDebug Serial.print
|
|
# define SendDebugln Serial.println
|
|
#elif DEBUG_PORT == 1
|
|
# define SendDebug_P(a) Serial1.print_P(PSTR(a))
|
|
# define SendDebugln_P(a) Serial1.println_P(PSTR(a))
|
|
# define SendDebug Serial1.print
|
|
# define SendDebugln Serial1.println
|
|
#elif DEBUG_PORT == 2
|
|
# define SendDebug_P(a) Serial2.print_P(PSTR(a))
|
|
# define SendDebugln_P(a) Serial2.println_P(PSTR(a))
|
|
# define SendDebug Serial2.print
|
|
# define SendDebugln Serial2.println
|
|
#elif DEBUG_PORT == 3
|
|
# define SendDebug_P(a) Serial3.print_P(PSTR(a))
|
|
# define SendDebugln_P(a) Serial3.println_P(PSTR(a))
|
|
# define SendDebug Serial3.print
|
|
# define SendDebugln Serial3.println
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Navigation defaults
|
|
//
|
|
#ifndef WP_RADIUS_DEFAULT
|
|
# define WP_RADIUS_DEFAULT 3
|
|
#endif
|
|
|
|
#ifndef LOITER_RADIUS_DEFAULT
|
|
# define LOITER_RADIUS_DEFAULT 10
|
|
#endif
|
|
|
|
#ifndef ALT_HOLD_HOME
|
|
# define ALT_HOLD_HOME 8
|
|
#endif
|
|
#define ALT_HOLD_HOME_CM ALT_HOLD_HOME * 100
|
|
|
|
#ifndef USE_CURRENT_ALT
|
|
# define USE_CURRENT_ALT FALSE
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Developer Items
|
|
//
|
|
|
|
#ifndef STANDARD_SPEED
|
|
# define STANDARD_SPEED 15.0
|
|
#define STANDARD_SPEED_SQUARED (STANDARD_SPEED * STANDARD_SPEED)
|
|
#endif
|
|
#define STANDARD_THROTTLE_SQUARED (THROTTLE_CRUISE * THROTTLE_CRUISE)
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// RC override
|
|
//
|
|
#ifndef ALLOW_RC_OVERRIDE
|
|
# define ALLOW_RC_OVERRIDE DISABLED
|
|
#endif
|