2016-02-17 21:26:00 -04:00
# pragma once
2011-09-08 22:29:39 -03:00
# include "defines.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
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
2012-12-11 20:33:38 -04:00
# ifdef CONFIG_APM_HARDWARE
# error CONFIG_APM_HARDWARE option is depreated! use CONFIG_HAL_BOARD instead.
# endif
2011-09-08 22:29:39 -03:00
# 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
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// RADIO CONFIGURATION
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
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)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_1 Mode::Number::RTL
2011-09-08 22:29:39 -03:00
# endif
# if !defined(FLIGHT_MODE_2)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_2 Mode::Number::RTL
2011-09-08 22:29:39 -03:00
# endif
# if !defined(FLIGHT_MODE_3)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_3 Mode::Number::FLY_BY_WIRE_A
2011-09-08 22:29:39 -03:00
# endif
# if !defined(FLIGHT_MODE_4)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_4 Mode::Number::FLY_BY_WIRE_A
2011-09-08 22:29:39 -03:00
# endif
# if !defined(FLIGHT_MODE_5)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_5 Mode::Number::MANUAL
2011-09-08 22:29:39 -03:00
# endif
# if !defined(FLIGHT_MODE_6)
2019-01-15 13:46:13 -04:00
# define FLIGHT_MODE_6 Mode::Number::MANUAL
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
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// STARTUP BEHAVIOUR
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
2012-06-10 17:08:48 -03:00
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
2015-10-04 03:22:07 -03:00
# ifndef DSPOILR_RUD_RATE_DEFAULT
# define DSPOILR_RUD_RATE_DEFAULT 100
# endif
2011-09-08 22:29:39 -03:00
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// FLIGHT AND NAVIGATION CONTROL
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// 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
//
2016-08-07 21:48:36 -03:00
# ifndef AIRSPEED_FBW_MIN
# define AIRSPEED_FBW_MIN 9
# endif
# ifndef AIRSPEED_FBW_MAX
# define AIRSPEED_FBW_MAX 22
# 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
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
2017-04-03 19:19:41 -03:00
# define THROTTLE_MAX 100
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
2014-03-03 00:49:04 -04:00
# define PITCH_MAX 20
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
# ifndef RUDDER_MIX
2015-04-11 06:43:13 -03:00
# define RUDDER_MIX 0.5f
2011-09-08 22:29:39 -03:00
# endif
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// DEBUGGING
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
2019-02-11 04:11:32 -04:00
// Logging control
2011-09-08 22:29:39 -03:00
//
2011-09-09 11:18:38 -03:00
2013-12-30 07:26:02 -04:00
# define DEFAULT_LOG_BITMASK 0xffff
2011-09-09 11:18:38 -03:00
2011-09-08 22:29:39 -03:00
//////////////////////////////////////////////////////////////////////////////
// Navigation defaults
//
# ifndef WP_RADIUS_DEFAULT
2014-08-29 18:43:11 -03:00
# define WP_RADIUS_DEFAULT 90
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
//////////////////////////////////////////////////////////////////////////////
// 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-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
2015-06-18 07:45:33 -03:00
//////////////////////////////////////////////////////////////////////////////
// Parachute release
# ifndef PARACHUTE
2020-01-17 18:57:55 -04:00
# define PARACHUTE HAL_PARACHUTE_ENABLED
2015-06-18 07:45:33 -03:00
# endif
2016-09-10 19:19:22 -03:00
2018-02-28 08:22:16 -04:00
# ifndef STATS_ENABLED
# define STATS_ENABLED ENABLED
# endif
2018-03-04 05:41:06 -04:00
2018-06-23 04:11:05 -03:00
# ifndef OSD_ENABLED
# define OSD_ENABLED DISABLED
# endif
2020-05-16 01:02:01 -03:00
# ifndef OFFBOARD_GUIDED
2023-07-31 23:08:06 -03:00
# define OFFBOARD_GUIDED 1
2020-05-16 01:02:01 -03:00
# endif
2018-06-10 03:33:06 -03:00
2020-05-04 20:12:14 -03:00
//////////////////////////////////////////////////////////////////////////////
// EKF Failsafe
# ifndef FS_EKF_THRESHOLD_DEFAULT
# define FS_EKF_THRESHOLD_DEFAULT 0.8f // EKF failsafe's default compass and velocity variance threshold above which the EKF failsafe will be triggered
# endif
2021-08-17 12:29:42 -03:00
/////////////////////////////////////////////////////////////////////////////
// Landing Throttle Control Trigger Threshold
# ifndef THR_CTRL_LAND_THRESH
# define THR_CTRL_LAND_THRESH 0.7
# endif