2011-09-08 22:29:39 -03:00
|
|
|
// -*- 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.
|
|
|
|
///
|
2012-04-18 16:16:02 -03:00
|
|
|
#ifdef USE_CMAKE_APM_CONFIG
|
2012-08-21 23:19:51 -03:00
|
|
|
#include "APM_Config_cmake.h" // <== Prefer cmake config if it exists
|
2012-04-18 16:16:02 -03:00
|
|
|
#else
|
2012-08-21 23:19:51 -03:00
|
|
|
#include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER.
|
2012-04-18 16:16:02 -03:00
|
|
|
#endif
|
2011-09-08 22:29:39 -03:00
|
|
|
///
|
|
|
|
/// 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...
|
2012-08-21 23:19:51 -03:00
|
|
|
#define ENABLED 1
|
|
|
|
#define DISABLED 0
|
2011-09-08 22:29:39 -03:00
|
|
|
|
2012-03-07 03:40:04 -04:00
|
|
|
// this avoids a very common config error
|
|
|
|
#define ENABLE ENABLED
|
|
|
|
#define DISABLE DISABLED
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// HARDWARE CONFIGURATION AND CONNECTIONS
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-11-13 00:08:34 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// APM HARDWARE
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CONFIG_APM_HARDWARE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CONFIG_APM_HARDWARE APM_HARDWARE_APM1
|
2011-11-13 04:47:35 -04:00
|
|
|
#endif
|
|
|
|
|
2011-12-16 10:26:39 -04:00
|
|
|
#if defined( __AVR_ATmega1280__ )
|
2012-08-21 23:19:51 -03:00
|
|
|
#define LOGGING_ENABLED DISABLED
|
2011-12-16 10:26:39 -04:00
|
|
|
#endif
|
|
|
|
|
2011-11-13 04:47:35 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-11-25 19:11:36 -04:00
|
|
|
// APM2 HARDWARE DEFAULTS
|
2011-11-13 04:47:35 -04:00
|
|
|
//
|
|
|
|
|
2011-11-25 19:11:36 -04:00
|
|
|
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CONFIG_IMU_TYPE CONFIG_IMU_MPU6000
|
|
|
|
# define CONFIG_RELAY DISABLED
|
|
|
|
# define MAG_ORIENTATION AP_COMPASS_APM2_SHIELD
|
|
|
|
# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN
|
|
|
|
# define CONFIG_PITOT_SOURCE PITOT_SOURCE_ANALOG_PIN
|
|
|
|
# define MAGNETOMETER ENABLED
|
|
|
|
# ifdef APM2_BETA_HARDWARE
|
|
|
|
# define CONFIG_BARO AP_BARO_BMP085
|
|
|
|
# else // APM2 Production Hardware (default)
|
|
|
|
# define CONFIG_BARO AP_BARO_MS5611
|
|
|
|
# endif
|
2011-11-13 00:08:34 -04:00
|
|
|
#endif
|
|
|
|
|
2012-05-03 21:39:44 -03:00
|
|
|
// use this to enable telemetry on UART2. This is used
|
|
|
|
// when you have setup the solder bridge on an APM2 to enable UART2
|
|
|
|
#ifndef TELEMETRY_UART2
|
2012-08-21 23:19:51 -03:00
|
|
|
# define TELEMETRY_UART2 DISABLED
|
2012-05-03 21:39:44 -03:00
|
|
|
#endif
|
|
|
|
|
2011-11-27 02:09:14 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-11-13 05:19:07 -04:00
|
|
|
// LED and IO Pins
|
|
|
|
//
|
|
|
|
#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM1
|
2012-08-21 23:19:51 -03:00
|
|
|
# define A_LED_PIN 37
|
|
|
|
# define B_LED_PIN 36
|
|
|
|
# define C_LED_PIN 35
|
|
|
|
# define LED_ON HIGH
|
|
|
|
# define LED_OFF LOW
|
|
|
|
# define USB_MUX_PIN -1
|
|
|
|
# define CONFIG_RELAY ENABLED
|
|
|
|
# define BATTERY_PIN_1 0
|
|
|
|
# define CURRENT_PIN_1 1
|
2011-11-25 19:11:36 -04:00
|
|
|
#elif CONFIG_APM_HARDWARE == APM_HARDWARE_APM2
|
2012-08-21 23:19:51 -03:00
|
|
|
# define A_LED_PIN 27
|
|
|
|
# define B_LED_PIN 26
|
|
|
|
# define C_LED_PIN 25
|
|
|
|
# define LED_ON LOW
|
|
|
|
# define LED_OFF HIGH
|
|
|
|
#if TELEMETRY_UART2 == ENABLED
|
|
|
|
# define USB_MUX_PIN -1
|
|
|
|
#else
|
|
|
|
# define USB_MUX_PIN 23
|
|
|
|
#endif
|
|
|
|
# define BATTERY_PIN_1 1
|
|
|
|
# define CURRENT_PIN_1 2
|
2011-11-13 05:19:07 -04:00
|
|
|
#endif
|
|
|
|
|
2012-06-03 21:02:08 -03:00
|
|
|
|
2012-08-22 00:33:12 -03:00
|
|
|
// pin for receiver RSSI
|
|
|
|
#ifndef RECEIVER_RSSI_PIN
|
|
|
|
# define RECEIVER_RSSI_PIN -1
|
|
|
|
#endif
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2011-11-13 00:08:34 -04:00
|
|
|
// IMU Selection
|
2011-09-09 11:18:38 -03:00
|
|
|
//
|
2011-11-13 00:08:34 -04:00
|
|
|
#ifndef CONFIG_IMU_TYPE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CONFIG_IMU_TYPE CONFIG_IMU_OILPAN
|
2011-11-13 00:08:34 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_IMU_TYPE == CONFIG_IMU_MPU6000
|
2012-08-21 23:19:51 -03:00
|
|
|
# ifndef CONFIG_MPU6000_CHIP_SELECT_PIN
|
|
|
|
# define CONFIG_MPU6000_CHIP_SELECT_PIN 53
|
|
|
|
# endif
|
2011-11-13 00:08:34 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ADC Enable - used to eliminate for systems which don't have ADC.
|
|
|
|
//
|
|
|
|
#ifndef CONFIG_ADC
|
2012-08-21 23:19:51 -03:00
|
|
|
# if CONFIG_IMU_TYPE == CONFIG_IMU_OILPAN
|
|
|
|
# define CONFIG_ADC ENABLED
|
|
|
|
# else
|
|
|
|
# define CONFIG_ADC DISABLED
|
|
|
|
# endif
|
2011-11-13 00:08:34 -04:00
|
|
|
#endif
|
|
|
|
|
2011-11-27 02:07:49 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Barometer
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CONFIG_BARO
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CONFIG_BARO AP_BARO_BMP085
|
2011-11-27 02:07:49 -04:00
|
|
|
#endif
|
|
|
|
|
2011-11-13 00:08:34 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Pitot
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PITOT_ENABLED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define PITOT_ENABLED DISABLED
|
2011-11-13 00:08:34 -04:00
|
|
|
#endif
|
2011-09-09 11:18:38 -03:00
|
|
|
|
2011-11-13 00:08:34 -04:00
|
|
|
#ifndef CONFIG_PITOT_SOURCE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CONFIG_PITOT_SOURCE PITOT_SOURCE_ADC
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
2011-11-13 00:08:34 -04:00
|
|
|
#if CONFIG_PITOT_SOURCE == PITOT_SOURCE_ADC
|
2012-08-21 23:19:51 -03:00
|
|
|
# ifndef CONFIG_PITOT_SOURCE_ADC_CHANNEL
|
|
|
|
# define CONFIG_PITOT_SOURCE_ADC_CHANNEL 7
|
|
|
|
# endif
|
2011-11-13 00:08:34 -04:00
|
|
|
#elif CONFIG_PITOT_SOURCE == PITOT_SOURCE_ANALOG_PIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# ifndef CONFIG_PITOT_SOURCE_ANALOG_PIN
|
|
|
|
# define CONFIG_PITOT_SOURCE_ANALOG_PIN 0
|
|
|
|
# endif
|
2011-11-13 00:08:34 -04:00
|
|
|
#else
|
2012-08-21 23:19:51 -03:00
|
|
|
# warning Invalid value for CONFIG_PITOT_SOURCE, disabling airspeed
|
|
|
|
# undef PITOT_ENABLED
|
|
|
|
# define PITOT_ENABLED DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SONAR_TYPE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SONAR_TYPE MAX_SONAR_LV // MAX_SONAR_XL,
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
2012-01-15 19:12:08 -04:00
|
|
|
#ifndef SONAR_ENABLED
|
2012-08-21 23:19:51 -03:00
|
|
|
#define SONAR_ENABLED DISABLED
|
2012-01-15 19:12:08 -04:00
|
|
|
#endif
|
2011-09-09 11:18:38 -03:00
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// HIL_MODE OPTIONAL
|
|
|
|
|
|
|
|
#ifndef HIL_MODE
|
2012-08-21 23:19:51 -03:00
|
|
|
#define HIL_MODE HIL_MODE_DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
2012-08-21 23:19:51 -03:00
|
|
|
#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode
|
2011-09-08 22:29:39 -03:00
|
|
|
# undef GPS_PROTOCOL
|
|
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_NONE
|
|
|
|
#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
|
2012-08-21 23:19:51 -03:00
|
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_AUTO
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAV_SYSTEM_ID
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MAV_SYSTEM_ID 1
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Serial port speeds.
|
|
|
|
//
|
|
|
|
#ifndef SERIAL0_BAUD
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERIAL0_BAUD 115200
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERIAL3_BAUD
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERIAL3_BAUD 57600
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Battery monitoring
|
|
|
|
//
|
|
|
|
#ifndef BATTERY_EVENT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define BATTERY_EVENT DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOW_VOLTAGE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOW_VOLTAGE 9.6
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef VOLT_DIV_RATIO
|
2012-08-21 23:19:51 -03:00
|
|
|
# define VOLT_DIV_RATIO 3.56 // This is the proper value for an on-board APM1 voltage divider with a 3.9kOhm resistor
|
2012-01-15 19:35:46 -04:00
|
|
|
//# define VOLT_DIV_RATIO 15.70 // This is the proper value for the AttoPilot 50V/90A sensor
|
|
|
|
//# define VOLT_DIV_RATIO 4.127 // This is the proper value for the AttoPilot 13.6V/45A sensor
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CURR_AMP_PER_VOLT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CURR_AMP_PER_VOLT 27.32 // This is the proper value for the AttoPilot 50V/90A sensor
|
2012-01-15 19:35:46 -04:00
|
|
|
//# define CURR_AMP_PER_VOLT 13.66 // This is the proper value for the AttoPilot 13.6V/45A sensor
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
2012-01-15 19:35:46 -04:00
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
#ifndef CURR_AMPS_OFFSET
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CURR_AMPS_OFFSET 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef HIGH_DISCHARGE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define HIGH_DISCHARGE 1760
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// INPUT_VOLTAGE
|
|
|
|
//
|
|
|
|
#ifndef INPUT_VOLTAGE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define INPUT_VOLTAGE 4.68 // 4.68 is the average value for a sample set. This is the value at the processor with 5.02 applied at the servo rail
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// MAGNETOMETER
|
|
|
|
#ifndef MAGNETOMETER
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MAGNETOMETER DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef MAG_ORIENTATION
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// RADIO CONFIGURATION
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Radio channel limits
|
|
|
|
//
|
2011-09-09 11:18:38 -03:00
|
|
|
// Note that these are not called out in APM_Config.h.reference.
|
2011-09-08 22:29:39 -03:00
|
|
|
//
|
|
|
|
#ifndef CH5_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH5_MIN 1000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH5_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH5_MAX 2000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH6_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH6_MIN 1000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH6_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH6_MAX 2000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH7_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH7_MIN 1000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH7_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH7_MAX 2000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH8_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH8_MIN 1000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef CH8_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CH8_MAX 2000
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
#ifndef FLAP_1_PERCENT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLAP_1_PERCENT 0
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef FLAP_1_SPEED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLAP_1_SPEED 0
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef FLAP_2_PERCENT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLAP_2_PERCENT 0
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef FLAP_2_SPEED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLAP_2_SPEED 0
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FLIGHT_MODE
|
|
|
|
// FLIGHT_MODE_CHANNEL
|
|
|
|
//
|
|
|
|
#ifndef FLIGHT_MODE_CHANNEL
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_CHANNEL 8
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if (FLIGHT_MODE_CHANNEL != 5) && (FLIGHT_MODE_CHANNEL != 6) && (FLIGHT_MODE_CHANNEL != 7) && (FLIGHT_MODE_CHANNEL != 8)
|
2012-08-21 23:19:51 -03:00
|
|
|
# error XXX
|
|
|
|
# error XXX You must set FLIGHT_MODE_CHANNEL to 5, 6, 7 or 8
|
|
|
|
# error XXX
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(FLIGHT_MODE_1)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_1 RTL
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_2)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_2 RTL
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_3)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_3 STABILIZE
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_4)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_4 STABILIZE
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_5)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_5 MANUAL
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#if !defined(FLIGHT_MODE_6)
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FLIGHT_MODE_6 MANUAL
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// THROTTLE_FAILSAFE
|
|
|
|
// THROTTLE_FS_VALUE
|
|
|
|
// SHORT_FAILSAFE_ACTION
|
|
|
|
// LONG_FAILSAFE_ACTION
|
|
|
|
// GCS_HEARTBEAT_FAILSAFE
|
|
|
|
//
|
|
|
|
#ifndef THROTTLE_FAILSAFE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_FAILSAFE ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
2011-09-09 11:18:38 -03:00
|
|
|
#ifndef THROTTLE_FS_VALUE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_FS_VALUE 950
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SHORT_FAILSAFE_ACTION
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SHORT_FAILSAFE_ACTION 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LONG_FAILSAFE_ACTION
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LONG_FAILSAFE_ACTION 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef GCS_HEARTBEAT_FAILSAFE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define GCS_HEARTBEAT_FAILSAFE DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AUTO_TRIM
|
|
|
|
//
|
|
|
|
#ifndef AUTO_TRIM
|
2012-08-21 23:19:51 -03:00
|
|
|
# define AUTO_TRIM DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// THROTTLE_OUT
|
|
|
|
//
|
|
|
|
#ifndef THROTTE_OUT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_OUT ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// STARTUP BEHAVIOUR
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-06-10 17:08:48 -03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Level with each startup = 0, level with MP/CLI only = 1
|
|
|
|
//
|
|
|
|
#ifndef MANUAL_LEVEL
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MANUAL_LEVEL 0
|
2012-06-10 17:08:48 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GROUND_START_DELAY
|
|
|
|
//
|
|
|
|
#ifndef GROUND_START_DELAY
|
2012-08-21 23:19:51 -03:00
|
|
|
# define GROUND_START_DELAY 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ENABLE_AIR_START
|
|
|
|
//
|
|
|
|
#ifndef ENABLE_AIR_START
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ENABLE_AIR_START DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ENABLE ELEVON_MIXING
|
|
|
|
//
|
|
|
|
#ifndef ELEVON_MIXING
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ELEVON_MIXING DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef ELEVON_REVERSE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ELEVON_REVERSE DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef ELEVON_CH1_REVERSE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ELEVON_CH1_REVERSE DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
#ifndef ELEVON_CH2_REVERSE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ELEVON_CH2_REVERSE DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
2012-06-13 16:00:20 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CAMERA TRIGGER AND CONTROL
|
|
|
|
//
|
2012-08-26 20:32:27 -03:00
|
|
|
// uses 1182 bytes of memory
|
2012-06-13 16:00:20 -03:00
|
|
|
#ifndef CAMERA
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CAMERA ENABLED
|
2012-06-13 16:00:20 -03:00
|
|
|
#endif
|
|
|
|
|
2011-10-31 18:55:58 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// MOUNT (ANTENNA OR CAMERA)
|
|
|
|
//
|
2012-08-26 20:33:45 -03:00
|
|
|
// uses 4174 bytes of memory on 1280 chips (MNT_JSTICK_SPD_OPTION, MNT_RETRACT_OPTION, MNT_STABILIZE_OPTION and MNT_MOUNT2_OPTION disabled)
|
|
|
|
// uses 7726 bytes of memory on 2560 chips (all options are enabled)
|
2011-10-31 18:55:58 -03:00
|
|
|
#ifndef MOUNT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MOUNT ENABLED
|
2011-10-31 18:55:58 -03:00
|
|
|
#endif
|
|
|
|
|
2012-08-26 20:33:45 -03:00
|
|
|
// second mount, can for example be used to keep an antenna pointed at the home position
|
2012-08-08 18:22:24 -03:00
|
|
|
#ifndef MOUNT2
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MOUNT2 DISABLED
|
2012-08-08 18:22:24 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined( __AVR_ATmega1280__ ) && (MOUNT == ENABLED || MOUNT2 == ENABLED)
|
2012-08-04 11:32:20 -03:00
|
|
|
|
|
|
|
// The small ATmega1280 chip does not have enough memory for mount support
|
|
|
|
// so disable CLI, this will allow mount support and other improvements to fit.
|
2011-10-31 18:55:58 -03:00
|
|
|
// This should almost have no side effects, because the APM planner can now do a complete board setup.
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CLI_ENABLED DISABLED
|
2012-08-04 11:32:20 -03:00
|
|
|
|
|
|
|
// The small ATmega1280 chip does not have enough memory for mount support
|
|
|
|
// so disable AUTO GPS support, this will allow mount support and other improvements to fit.
|
|
|
|
// This should almost have no side effects, because the most users use MTK anyways.
|
|
|
|
// If the user defined a GPS protocol, than we will NOT overwrite it
|
2012-08-21 23:19:51 -03:00
|
|
|
# if GPS_PROTOCOL == GPS_PROTOCOL_AUTO
|
|
|
|
# undef GPS_PROTOCOL
|
|
|
|
# define GPS_PROTOCOL GPS_PROTOCOL_MTK
|
|
|
|
# endif
|
2012-08-04 11:32:20 -03:00
|
|
|
|
2012-08-26 20:33:45 -03:00
|
|
|
# undef CAMERA
|
|
|
|
# define CAMERA DISABLED
|
2011-10-31 18:55:58 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FLIGHT AND NAVIGATION CONTROL
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Altitude measurement and control.
|
|
|
|
//
|
|
|
|
#ifndef ALT_EST_GAIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ALT_EST_GAIN 0.01
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef ALTITUDE_MIX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ALTITUDE_MIX 1
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AIRSPEED_CRUISE
|
|
|
|
//
|
|
|
|
#ifndef AIRSPEED_CRUISE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define AIRSPEED_CRUISE 12 // 12 m/s
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define AIRSPEED_CRUISE_CM AIRSPEED_CRUISE*100
|
|
|
|
|
2011-12-09 19:40:56 -04:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// MIN_GNDSPEED
|
|
|
|
//
|
|
|
|
#ifndef MIN_GNDSPEED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define MIN_GNDSPEED 0 // m/s (0 disables)
|
2011-12-09 19:40:56 -04:00
|
|
|
#endif
|
|
|
|
#define MIN_GNDSPEED_CM MIN_GNDSPEED*100
|
|
|
|
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// FLY_BY_WIRE_B airspeed control
|
|
|
|
//
|
|
|
|
#ifndef AIRSPEED_FBW_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define AIRSPEED_FBW_MIN 6
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef AIRSPEED_FBW_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define AIRSPEED_FBW_MAX 22
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
2011-10-17 02:11:40 -03:00
|
|
|
|
|
|
|
#ifndef ALT_HOLD_FBW
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ALT_HOLD_FBW 0
|
2011-10-17 02:11:40 -03:00
|
|
|
#endif
|
|
|
|
#define ALT_HOLD_FBW_CM ALT_HOLD_FBW*100
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-11 17:30:09 -03:00
|
|
|
/* The following parameters have no corresponding control implementation
|
2012-08-21 23:19:51 -03:00
|
|
|
* #ifndef THROTTLE_ALT_P
|
|
|
|
# define THROTTLE_ALT_P 0.32
|
|
|
|
##endif
|
|
|
|
##ifndef THROTTLE_ALT_I
|
|
|
|
# define THROTTLE_ALT_I 0.0
|
|
|
|
##endif
|
|
|
|
##ifndef THROTTLE_ALT_D
|
|
|
|
# define THROTTLE_ALT_D 0.0
|
|
|
|
##endif
|
|
|
|
##ifndef THROTTLE_ALT_INT_MAX
|
|
|
|
# define THROTTLE_ALT_INT_MAX 20
|
|
|
|
##endif
|
|
|
|
##define THROTTLE_ALT_INT_MAX_CM THROTTLE_ALT_INT_MAX*100
|
|
|
|
*/
|
2011-09-08 22:29:39 -03:00
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Servo Mapping
|
|
|
|
//
|
|
|
|
#ifndef THROTTLE_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_MIN 0 // percent
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_CRUISE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_CRUISE 45
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_MAX 75
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Autopilot control limits
|
|
|
|
//
|
|
|
|
#ifndef HEAD_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define HEAD_MAX 45
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef PITCH_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define PITCH_MAX 15
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef PITCH_MIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define PITCH_MIN -25
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define HEAD_MAX_CENTIDEGREE HEAD_MAX * 100
|
|
|
|
#define PITCH_MAX_CENTIDEGREE PITCH_MAX * 100
|
|
|
|
#define PITCH_MIN_CENTIDEGREE PITCH_MIN * 100
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Attitude control gains
|
|
|
|
//
|
|
|
|
#ifndef SERVO_ROLL_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_ROLL_P 0.4
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_ROLL_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_ROLL_I 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_ROLL_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_ROLL_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_ROLL_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_ROLL_INT_MAX 5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define SERVO_ROLL_INT_MAX_CENTIDEGREE SERVO_ROLL_INT_MAX*100
|
|
|
|
#ifndef ROLL_SLEW_LIMIT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ROLL_SLEW_LIMIT 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_PITCH_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_PITCH_P 0.6
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_PITCH_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_PITCH_I 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_PITCH_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_PITCH_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_PITCH_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_PITCH_INT_MAX 5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define SERVO_PITCH_INT_MAX_CENTIDEGREE SERVO_PITCH_INT_MAX*100
|
|
|
|
#ifndef PITCH_COMP
|
2012-08-21 23:19:51 -03:00
|
|
|
# define PITCH_COMP 0.2
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_YAW_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_YAW_P 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_YAW_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_YAW_I 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_YAW_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_YAW_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef SERVO_YAW_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SERVO_YAW_INT_MAX 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef RUDDER_MIX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define RUDDER_MIX 0.5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Navigation control gains
|
|
|
|
//
|
|
|
|
#ifndef NAV_ROLL_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_ROLL_P 0.7
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_ROLL_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_ROLL_I 0.02
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_ROLL_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_ROLL_D 0.1
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_ROLL_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_ROLL_INT_MAX 5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define NAV_ROLL_INT_MAX_CENTIDEGREE NAV_ROLL_INT_MAX*100
|
|
|
|
#ifndef NAV_PITCH_ASP_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ASP_P 0.65
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ASP_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ASP_I 0.1
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ASP_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ASP_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ASP_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ASP_INT_MAX 5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define NAV_PITCH_ASP_INT_MAX_CMSEC NAV_PITCH_ASP_INT_MAX*100
|
|
|
|
#ifndef NAV_PITCH_ALT_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ALT_P 0.65
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ALT_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ALT_I 0.1
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ALT_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ALT_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef NAV_PITCH_ALT_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define NAV_PITCH_ALT_INT_MAX 5
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define NAV_PITCH_ALT_INT_MAX_CM NAV_PITCH_ALT_INT_MAX*100
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Energy/Altitude control gains
|
|
|
|
//
|
|
|
|
#ifndef THROTTLE_TE_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_TE_P 0.50
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_TE_I
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_TE_I 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_TE_D
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_TE_D 0.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_TE_INT_MAX
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_TE_INT_MAX 20
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef THROTTLE_SLEW_LIMIT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define THROTTLE_SLEW_LIMIT 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef P_TO_T
|
2012-08-21 23:19:51 -03:00
|
|
|
# define P_TO_T 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef T_TO_P
|
2012-08-21 23:19:51 -03:00
|
|
|
# define T_TO_P 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef PITCH_TARGET
|
2012-08-21 23:19:51 -03:00
|
|
|
# define PITCH_TARGET 0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Crosstrack compensation
|
|
|
|
//
|
|
|
|
#ifndef XTRACK_GAIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define XTRACK_GAIN 1 // deg/m
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef XTRACK_ENTRY_ANGLE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define XTRACK_ENTRY_ANGLE 30 // deg
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
# define XTRACK_GAIN_SCALED XTRACK_GAIN*100
|
|
|
|
# define XTRACK_ENTRY_ANGLE_CENTIDEGREE XTRACK_ENTRY_ANGLE*100
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DEBUGGING
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Dataflash logging control
|
|
|
|
//
|
2011-09-09 11:18:38 -03:00
|
|
|
|
|
|
|
#ifndef LOGGING_ENABLED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOGGING_ENABLED ENABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
#ifndef LOG_ATTITUDE_FAST
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_ATTITUDE_FAST DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_ATTITUDE_MED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_ATTITUDE_MED ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_GPS
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_GPS ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_PM
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_PM ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_CTUN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_CTUN DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_NTUN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_NTUN DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_MODE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_MODE ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_RAW
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_RAW DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_CMD
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_CMD ENABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#ifndef LOG_CUR
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOG_CUR DISABLED
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
// calculate the default log_bitmask
|
2012-08-21 23:19:51 -03:00
|
|
|
#define LOGBIT(_s) (LOG_ ## _s ? MASK_LOG_ ## _s : 0)
|
2011-09-09 11:18:38 -03:00
|
|
|
|
|
|
|
#define DEFAULT_LOG_BITMASK \
|
2012-08-21 23:19:51 -03:00
|
|
|
LOGBIT(ATTITUDE_FAST) | \
|
|
|
|
LOGBIT(ATTITUDE_MED) | \
|
|
|
|
LOGBIT(GPS) | \
|
|
|
|
LOGBIT(PM) | \
|
|
|
|
LOGBIT(CTUN) | \
|
|
|
|
LOGBIT(NTUN) | \
|
|
|
|
LOGBIT(MODE) | \
|
|
|
|
LOGBIT(RAW) | \
|
|
|
|
LOGBIT(CMD) | \
|
|
|
|
LOGBIT(CUR)
|
2011-09-09 11:18:38 -03:00
|
|
|
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Navigation defaults
|
|
|
|
//
|
|
|
|
#ifndef WP_RADIUS_DEFAULT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define WP_RADIUS_DEFAULT 30
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOITER_RADIUS_DEFAULT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define LOITER_RADIUS_DEFAULT 60
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ALT_HOLD_HOME
|
2012-08-21 23:19:51 -03:00
|
|
|
# define ALT_HOLD_HOME 100
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
#define ALT_HOLD_HOME_CM ALT_HOLD_HOME*100
|
|
|
|
|
|
|
|
#ifndef USE_CURRENT_ALT
|
2012-08-21 23:19:51 -03:00
|
|
|
# define USE_CURRENT_ALT FALSE
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
#ifndef INVERTED_FLIGHT_PWM
|
2012-08-21 23:19:51 -03:00
|
|
|
# define INVERTED_FLIGHT_PWM 1750
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Developer Items
|
|
|
|
//
|
|
|
|
|
2012-07-25 22:30:23 -03:00
|
|
|
#ifndef SCALING_SPEED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define SCALING_SPEED 15.0
|
2011-09-08 22:29:39 -03:00
|
|
|
#endif
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
// use this to enable servos in HIL mode
|
|
|
|
#ifndef HIL_SERVOS
|
2012-08-21 23:19:51 -03:00
|
|
|
# define HIL_SERVOS DISABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// use this to completely disable the CLI
|
|
|
|
#ifndef CLI_ENABLED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define CLI_ENABLED ENABLED
|
2011-09-09 11:18:38 -03:00
|
|
|
#endif
|
|
|
|
|
2012-08-26 20:32:27 -03:00
|
|
|
// use this to disable geo-fencing
|
2011-12-15 03:08:58 -04:00
|
|
|
#ifndef GEOFENCE_ENABLED
|
2012-08-21 23:19:51 -03:00
|
|
|
# define GEOFENCE_ENABLED ENABLED
|
2011-12-15 03:08:58 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// pwm value on FENCE_CHANNEL to use to enable fenced mode
|
|
|
|
#ifndef FENCE_ENABLE_PWM
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FENCE_ENABLE_PWM 1750
|
2011-12-15 03:08:58 -04:00
|
|
|
#endif
|
2011-12-16 15:28:25 -04:00
|
|
|
|
|
|
|
// a digital pin to set high when the geo-fence triggers. Defaults
|
|
|
|
// to -1, which means don't activate a pin
|
|
|
|
#ifndef FENCE_TRIGGERED_PIN
|
2012-08-21 23:19:51 -03:00
|
|
|
# define FENCE_TRIGGERED_PIN -1
|
2011-12-16 15:28:25 -04:00
|
|
|
#endif
|
2011-12-18 18:42:32 -04:00
|
|
|
|
|
|
|
// if RESET_SWITCH_CH is not zero, then this is the PWM value on
|
|
|
|
// that channel where we reset the control mode to the current switch
|
|
|
|
// position (to for example return to switched mode after failsafe or
|
|
|
|
// fence breach)
|
|
|
|
#ifndef RESET_SWITCH_CHAN_PWM
|
2012-08-21 23:19:51 -03:00
|
|
|
# define RESET_SWITCH_CHAN_PWM 1750
|
2011-12-18 18:42:32 -04:00
|
|
|
#endif
|
2012-03-03 03:33:40 -04:00
|
|
|
|
2012-07-08 22:49:26 -03:00
|
|
|
// OBC Failsafe enable
|
|
|
|
#ifndef OBC_FAILSAFE
|
2012-08-21 23:19:51 -03:00
|
|
|
# define OBC_FAILSAFE DISABLED
|
2012-07-08 22:49:26 -03:00
|
|
|
#endif
|
2012-08-21 23:12:15 -03:00
|
|
|
|
|
|
|
// new APM_Control controller library by Jon Challinger
|
|
|
|
#ifndef APM_CONTROL
|
|
|
|
# define APM_CONTROL DISABLED
|
|
|
|
#endif
|
2012-08-31 04:40:35 -03:00
|
|
|
|
|
|
|
#ifndef SERIAL_BUFSIZE
|
|
|
|
# define SERIAL_BUFSIZE 256
|
|
|
|
#endif
|
2012-09-11 03:39:36 -03:00
|
|
|
|
|
|
|
#if CONFIG_IMU_TYPE == CONFIG_IMU_OILPAN
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_200HZ 5
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_100HZ 10
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_50HZ 20
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_IMU_TYPE == CONFIG_IMU_MPU6000
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_200HZ 1
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_100HZ 2
|
|
|
|
# define NUM_IMU_SAMPLES_FOR_50HZ 4
|
|
|
|
#endif
|