2016-02-17 21:26:00 -04:00
|
|
|
#pragma once
|
2011-09-18 00:33:01 -03:00
|
|
|
|
2011-09-08 22:29:39 -03:00
|
|
|
// Internal defines, don't edit and expect things to work
|
|
|
|
// -------------------------------------------------------
|
|
|
|
|
2021-09-18 15:02:12 -03:00
|
|
|
#define SERVO_MAX 4500.0 // This value represents 45 degrees and is just an
|
2012-08-16 21:50:16 -03:00
|
|
|
// arbitrary representation of servo max travel.
|
2011-09-08 22:29:39 -03:00
|
|
|
|
2022-09-04 20:10:01 -03:00
|
|
|
#define MIN_AIRSPEED_MIN 5 // m/s, used for arming check and speed scaling
|
|
|
|
|
2023-04-11 14:11:33 -03:00
|
|
|
#define TAKEOFF_RUDDER_WARNING_TIMEOUT 3000 //ms that GCS warning about not returning arming rudder to neutral repeats
|
|
|
|
|
2011-09-09 11:18:38 -03:00
|
|
|
// failsafe
|
2011-09-08 22:29:39 -03:00
|
|
|
// ----------------------
|
2013-07-19 01:11:16 -03:00
|
|
|
enum failsafe_state {
|
|
|
|
FAILSAFE_NONE=0,
|
|
|
|
FAILSAFE_SHORT=1,
|
|
|
|
FAILSAFE_LONG=2,
|
|
|
|
FAILSAFE_GCS=3
|
|
|
|
};
|
2011-09-08 22:29:39 -03:00
|
|
|
|
|
|
|
|
2013-12-19 20:39:00 -04:00
|
|
|
// GCS failsafe types for FS_GCS_ENABL parameter
|
|
|
|
enum gcs_failsafe {
|
|
|
|
GCS_FAILSAFE_OFF = 0, // no GCS failsafe
|
|
|
|
GCS_FAILSAFE_HEARTBEAT = 1, // failsafe if we stop receiving heartbeat
|
2015-05-09 07:50:13 -03:00
|
|
|
GCS_FAILSAFE_HB_RSSI = 2, // failsafe if we stop receiving
|
2013-12-19 20:39:00 -04:00
|
|
|
// heartbeat or if RADIO.remrssi
|
|
|
|
// drops to 0
|
2015-05-09 07:50:13 -03:00
|
|
|
GCS_FAILSAFE_HB_AUTO = 3 // failsafe if we stop receiving heartbeat
|
|
|
|
// while in AUTO mode
|
2013-12-19 20:39:00 -04:00
|
|
|
};
|
|
|
|
|
2017-12-06 19:02:11 -04:00
|
|
|
enum failsafe_action_short {
|
|
|
|
FS_ACTION_SHORT_BESTGUESS = 0, // CIRCLE/no change(if already in AUTO|GUIDED|LOITER)
|
|
|
|
FS_ACTION_SHORT_CIRCLE = 1,
|
|
|
|
FS_ACTION_SHORT_FBWA = 2,
|
|
|
|
FS_ACTION_SHORT_DISABLED = 3,
|
2021-10-17 21:32:10 -03:00
|
|
|
FS_ACTION_SHORT_FBWB = 4,
|
2017-12-06 19:02:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum failsafe_action_long {
|
|
|
|
FS_ACTION_LONG_CONTINUE = 0,
|
|
|
|
FS_ACTION_LONG_RTL = 1,
|
|
|
|
FS_ACTION_LONG_GLIDE = 2,
|
|
|
|
FS_ACTION_LONG_PARACHUTE = 3,
|
2022-08-29 16:34:13 -03:00
|
|
|
FS_ACTION_LONG_AUTO = 4,
|
2017-09-21 03:53:15 -03:00
|
|
|
};
|
2013-12-19 20:39:00 -04:00
|
|
|
|
2013-04-01 18:52:56 -03:00
|
|
|
// type of stick mixing enabled
|
2021-11-02 19:57:51 -03:00
|
|
|
enum class StickMixing {
|
|
|
|
NONE = 0,
|
|
|
|
FBW = 1,
|
2023-01-29 22:52:19 -04:00
|
|
|
DIRECT_REMOVED = 2,
|
2021-11-02 19:57:51 -03:00
|
|
|
VTOL_YAW = 3,
|
2013-04-01 18:52:56 -03:00
|
|
|
};
|
2011-09-08 22:29:39 -03:00
|
|
|
|
2022-03-22 21:29:29 -03:00
|
|
|
// values for RTL_AUTOLAND
|
|
|
|
enum class RtlAutoland {
|
|
|
|
RTL_DISABLE = 0,
|
|
|
|
RTL_THEN_DO_LAND_START = 1,
|
|
|
|
RTL_IMMEDIATE_DO_LAND_START = 2,
|
|
|
|
NO_RTL_GO_AROUND = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-04-28 07:49:53 -03:00
|
|
|
enum ChannelMixing {
|
|
|
|
MIXING_DISABLED = 0,
|
|
|
|
MIXING_UPUP = 1,
|
|
|
|
MIXING_UPDN = 2,
|
|
|
|
MIXING_DNUP = 3,
|
2016-09-13 22:44:03 -03:00
|
|
|
MIXING_DNDN = 4,
|
|
|
|
MIXING_UPUP_SWP = 5,
|
|
|
|
MIXING_UPDN_SWP = 6,
|
|
|
|
MIXING_DNUP_SWP = 7,
|
|
|
|
MIXING_DNDN_SWP = 8,
|
2013-04-05 01:22:00 -03:00
|
|
|
};
|
|
|
|
|
2018-03-02 20:46:46 -04:00
|
|
|
// PID broadcast bitmask
|
|
|
|
enum tuning_pid_bits {
|
|
|
|
TUNING_BITS_ROLL = (1 << 0),
|
|
|
|
TUNING_BITS_PITCH = (1 << 1),
|
|
|
|
TUNING_BITS_YAW = (1 << 2),
|
|
|
|
TUNING_BITS_STEER = (1 << 3),
|
|
|
|
TUNING_BITS_LAND = (1 << 4),
|
2018-11-11 19:22:28 -04:00
|
|
|
TUNING_BITS_ACCZ = (1 << 5),
|
2018-03-02 20:46:46 -04:00
|
|
|
TUNING_BITS_END // dummy just used for static checking
|
|
|
|
};
|
|
|
|
|
2018-03-03 01:37:11 -04:00
|
|
|
static_assert(TUNING_BITS_END <= (1 << 24) + 1, "Tuning bit mask is too large to be set by MAVLink");
|
2011-09-08 22:29:39 -03:00
|
|
|
|
2021-12-17 21:21:57 -04:00
|
|
|
// Logging message types - only 32 messages are available to the vehicle here.
|
2013-01-12 07:16:50 -04:00
|
|
|
enum log_messages {
|
2013-04-19 10:37:21 -03:00
|
|
|
LOG_CTUN_MSG,
|
|
|
|
LOG_NTUN_MSG,
|
2016-01-20 20:39:09 -04:00
|
|
|
LOG_STATUS_MSG,
|
2016-04-16 07:26:43 -03:00
|
|
|
LOG_QTUN_MSG,
|
2017-03-13 03:22:41 -03:00
|
|
|
LOG_PIQR_MSG,
|
|
|
|
LOG_PIQP_MSG,
|
|
|
|
LOG_PIQY_MSG,
|
|
|
|
LOG_PIQA_MSG,
|
2020-05-16 01:02:01 -03:00
|
|
|
LOG_PIDG_MSG,
|
2017-07-06 02:56:13 -03:00
|
|
|
LOG_AETR_MSG,
|
2020-05-16 01:02:01 -03:00
|
|
|
LOG_OFG_MSG,
|
2013-01-12 07:16:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define MASK_LOG_ATTITUDE_FAST (1<<0)
|
|
|
|
#define MASK_LOG_ATTITUDE_MED (1<<1)
|
2012-08-16 21:50:16 -03:00
|
|
|
#define MASK_LOG_GPS (1<<2)
|
|
|
|
#define MASK_LOG_PM (1<<3)
|
|
|
|
#define MASK_LOG_CTUN (1<<4)
|
|
|
|
#define MASK_LOG_NTUN (1<<5)
|
2017-10-23 21:39:45 -03:00
|
|
|
//#define MASK_LOG_MODE (1<<6) // no longer used
|
2013-01-26 04:29:29 -04:00
|
|
|
#define MASK_LOG_IMU (1<<7)
|
2012-08-16 21:50:16 -03:00
|
|
|
#define MASK_LOG_CMD (1<<8)
|
2013-01-26 04:19:42 -04:00
|
|
|
#define MASK_LOG_CURRENT (1<<9)
|
2013-04-19 10:54:40 -03:00
|
|
|
#define MASK_LOG_COMPASS (1<<10)
|
2013-06-26 05:36:53 -03:00
|
|
|
#define MASK_LOG_TECS (1<<11)
|
2013-07-09 23:23:36 -03:00
|
|
|
#define MASK_LOG_CAMERA (1<<12)
|
2013-11-25 17:44:17 -04:00
|
|
|
#define MASK_LOG_RC (1<<13)
|
2013-10-30 19:23:21 -03:00
|
|
|
#define MASK_LOG_SONAR (1<<14)
|
2019-05-03 20:35:12 -03:00
|
|
|
// #define MASK_LOG_ARM_DISARM (1<<15)
|
2015-05-06 23:11:52 -03:00
|
|
|
#define MASK_LOG_IMU_RAW (1UL<<19)
|
2021-08-09 03:21:18 -03:00
|
|
|
#define MASK_LOG_ATTITUDE_FULLRATE (1U<<20)
|
2021-12-15 15:09:08 -04:00
|
|
|
#define MASK_LOG_VIDEO_STABILISATION (1UL<<21)
|
2011-09-08 22:29:39 -03:00
|
|
|
|
2015-06-03 16:22:24 -03:00
|
|
|
enum {
|
|
|
|
CRASH_DETECT_ACTION_BITMASK_DISABLED = 0,
|
|
|
|
CRASH_DETECT_ACTION_BITMASK_DISARM = (1<<0),
|
|
|
|
// note: next enum will be (1<<1), then (1<<2), then (1<<3)
|
|
|
|
};
|
2016-01-30 03:22:21 -04:00
|
|
|
|
|
|
|
enum {
|
|
|
|
USE_REVERSE_THRUST_NEVER = 0,
|
|
|
|
USE_REVERSE_THRUST_AUTO_ALWAYS = (1<<0),
|
|
|
|
USE_REVERSE_THRUST_AUTO_LAND_APPROACH = (1<<1),
|
|
|
|
USE_REVERSE_THRUST_AUTO_LOITER_TO_ALT = (1<<2),
|
|
|
|
USE_REVERSE_THRUST_AUTO_LOITER_ALL = (1<<3),
|
|
|
|
USE_REVERSE_THRUST_AUTO_WAYPOINT = (1<<4),
|
|
|
|
USE_REVERSE_THRUST_LOITER = (1<<5),
|
|
|
|
USE_REVERSE_THRUST_RTL = (1<<6),
|
|
|
|
USE_REVERSE_THRUST_CIRCLE = (1<<7),
|
|
|
|
USE_REVERSE_THRUST_CRUISE = (1<<8),
|
|
|
|
USE_REVERSE_THRUST_FBWB = (1<<9),
|
|
|
|
USE_REVERSE_THRUST_GUIDED = (1<<10),
|
2020-09-14 23:27:08 -03:00
|
|
|
USE_REVERSE_THRUST_AUTO_LANDING_PATTERN = (1<<11),
|
2021-05-25 14:49:38 -03:00
|
|
|
USE_REVERSE_THRUST_FBWA = (1<<12),
|
|
|
|
USE_REVERSE_THRUST_ACRO = (1<<13),
|
|
|
|
USE_REVERSE_THRUST_STABILIZE = (1<<14),
|
|
|
|
USE_REVERSE_THRUST_THERMAL = (1<<15),
|
2016-01-30 03:22:21 -04:00
|
|
|
};
|
2018-08-20 21:38:41 -03:00
|
|
|
|
|
|
|
enum FlightOptions {
|
2018-09-01 21:01:32 -03:00
|
|
|
DIRECT_RUDDER_ONLY = (1 << 0),
|
|
|
|
CRUISE_TRIM_THROTTLE = (1 << 1),
|
2018-09-14 06:05:25 -03:00
|
|
|
DISABLE_TOFF_ATTITUDE_CHK = (1 << 2),
|
2018-12-15 01:43:39 -04:00
|
|
|
CRUISE_TRIM_AIRSPEED = (1 << 3),
|
2021-03-12 13:21:49 -04:00
|
|
|
CLIMB_BEFORE_TURN = (1 << 4),
|
2021-04-08 04:56:33 -03:00
|
|
|
ACRO_YAW_DAMPER = (1 << 5),
|
2021-04-16 17:01:59 -03:00
|
|
|
SURPRESS_TKOFF_SCALING = (1<<6),
|
2021-07-15 06:04:53 -03:00
|
|
|
ENABLE_DEFAULT_AIRSPEED = (1<<7),
|
2021-07-26 21:07:27 -03:00
|
|
|
GCS_REMOVE_TRIM_PITCH_CD = (1 << 8),
|
|
|
|
OSD_REMOVE_TRIM_PITCH_CD = (1 << 9),
|
2021-08-30 15:57:10 -03:00
|
|
|
CENTER_THROTTLE_TRIM = (1<<10),
|
2021-10-29 07:37:52 -03:00
|
|
|
DISABLE_GROUND_PID_SUPPRESSION = (1<<11),
|
2022-05-10 09:53:10 -03:00
|
|
|
ENABLE_LOITER_ALT_CONTROL = (1<<12),
|
2023-04-11 14:11:33 -03:00
|
|
|
INDICATE_WAITING_FOR_RUDDER_NEUTRAL = (1<<13),
|
2018-08-20 21:38:41 -03:00
|
|
|
};
|
2019-02-24 18:54:22 -04:00
|
|
|
|
|
|
|
enum CrowFlapOptions {
|
|
|
|
FLYINGWING = (1 << 0),
|
|
|
|
FULLSPAN = (1 << 1),
|
|
|
|
PROGRESSIVE_CROW = (1 << 2),
|
|
|
|
};
|
|
|
|
|
2020-05-16 01:02:01 -03:00
|
|
|
|
|
|
|
enum guided_heading_type_t {
|
|
|
|
GUIDED_HEADING_NONE = 0, // no heading track
|
|
|
|
GUIDED_HEADING_COG, // maintain ground track
|
|
|
|
GUIDED_HEADING_HEADING, // maintain a heading
|
|
|
|
};
|
2020-07-07 21:22:56 -03:00
|
|
|
|
|
|
|
|
|
|
|
enum class AirMode {
|
|
|
|
OFF,
|
|
|
|
ON,
|
2021-08-28 14:51:41 -03:00
|
|
|
ASSISTED_FLIGHT_ONLY,
|
2020-07-07 21:22:56 -03:00
|
|
|
};
|
2020-11-30 23:06:45 -04:00
|
|
|
|
|
|
|
enum class FenceAutoEnable : uint8_t {
|
|
|
|
OFF=0,
|
|
|
|
Auto=1,
|
|
|
|
AutoDisableFloorOnly=2,
|
|
|
|
WhenArmed=3
|
|
|
|
};
|