Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/ArduPlane/defines.h
Views: 1798
#pragma once12// Internal defines, don't edit and expect things to work3// -------------------------------------------------------45#define SERVO_MAX 4500.0 // This value represents 45 degrees and is just an6// arbitrary representation of servo max travel.78#define MIN_AIRSPEED_MIN 5 // m/s, used for arming check and speed scaling910#define TAKEOFF_RUDDER_WARNING_TIMEOUT 3000 //ms that GCS warning about not returning arming rudder to neutral repeats1112#define GPS_GND_CRS_MIN_SPD 5 // m/s, used to set when intial_direction.heading is captured in NAV_TAKEOFF and Mode TAKEOFF1314// failsafe15// ----------------------16enum failsafe_state {17FAILSAFE_NONE=0,18FAILSAFE_SHORT=1,19FAILSAFE_LONG=2,20FAILSAFE_GCS=321};222324// GCS failsafe types for FS_GCS_ENABL parameter25enum gcs_failsafe {26GCS_FAILSAFE_OFF = 0, // no GCS failsafe27GCS_FAILSAFE_HEARTBEAT = 1, // failsafe if we stop receiving heartbeat28GCS_FAILSAFE_HB_RSSI = 2, // failsafe if we stop receiving29// heartbeat or if RADIO.remrssi30// drops to 031GCS_FAILSAFE_HB_AUTO = 3 // failsafe if we stop receiving heartbeat32// while in AUTO mode33};3435enum failsafe_action_short {36FS_ACTION_SHORT_BESTGUESS = 0, // CIRCLE/no change(if already in AUTO|GUIDED|LOITER)37FS_ACTION_SHORT_CIRCLE = 1,38FS_ACTION_SHORT_FBWA = 2,39FS_ACTION_SHORT_DISABLED = 3,40FS_ACTION_SHORT_FBWB = 4,41};4243enum failsafe_action_long {44FS_ACTION_LONG_CONTINUE = 0,45FS_ACTION_LONG_RTL = 1,46FS_ACTION_LONG_GLIDE = 2,47FS_ACTION_LONG_PARACHUTE = 3,48FS_ACTION_LONG_AUTO = 4,49FS_ACTION_LONG_AUTOLAND = 5,50};5152// type of stick mixing enabled53enum class StickMixing {54NONE = 0,55FBW = 1,56DIRECT_REMOVED = 2,57VTOL_YAW = 3,58};5960// values for RTL_AUTOLAND61enum class RtlAutoland {62RTL_DISABLE = 0,63RTL_THEN_DO_LAND_START = 1,64RTL_IMMEDIATE_DO_LAND_START = 2,65NO_RTL_GO_AROUND = 3,66DO_RETURN_PATH_START = 4,67};6869// PID broadcast bitmask70enum tuning_pid_bits {71TUNING_BITS_ROLL = (1 << 0),72TUNING_BITS_PITCH = (1 << 1),73TUNING_BITS_YAW = (1 << 2),74TUNING_BITS_STEER = (1 << 3),75TUNING_BITS_LAND = (1 << 4),76TUNING_BITS_ACCZ = (1 << 5),77TUNING_BITS_END // dummy just used for static checking78};7980static_assert(TUNING_BITS_END <= (1 << 24) + 1, "Tuning bit mask is too large to be set by MAVLink");8182// Logging message types - only 32 messages are available to the vehicle here.83enum log_messages {84LOG_CTUN_MSG,85LOG_NTUN_MSG,86LOG_STATUS_MSG,87LOG_QTUN_MSG,88LOG_PIQR_MSG,89LOG_PIQP_MSG,90LOG_PIQY_MSG,91LOG_PIQA_MSG,92LOG_PIDG_MSG,93LOG_AETR_MSG,94LOG_OFG_MSG,95LOG_TSIT_MSG,96LOG_TILT_MSG,97};9899#define MASK_LOG_ATTITUDE_FAST (1<<0)100#define MASK_LOG_ATTITUDE_MED (1<<1)101#define MASK_LOG_GPS (1<<2)102#define MASK_LOG_PM (1<<3)103#define MASK_LOG_CTUN (1<<4)104#define MASK_LOG_NTUN (1<<5)105//#define MASK_LOG_MODE (1<<6) // no longer used106#define MASK_LOG_IMU (1<<7)107#define MASK_LOG_CMD (1<<8)108#define MASK_LOG_CURRENT (1<<9)109#define MASK_LOG_COMPASS (1<<10)110#define MASK_LOG_TECS (1<<11)111#define MASK_LOG_CAMERA (1<<12)112#define MASK_LOG_RC (1<<13)113#define MASK_LOG_SONAR (1<<14)114// #define MASK_LOG_ARM_DISARM (1<<15)115#define MASK_LOG_IMU_RAW (1UL<<19)116#define MASK_LOG_ATTITUDE_FULLRATE (1U<<20)117#define MASK_LOG_VIDEO_STABILISATION (1UL<<21)118#define MASK_LOG_NOTCH_FULLRATE (1UL<<22)119120enum {121CRASH_DETECT_ACTION_BITMASK_DISABLED = 0,122CRASH_DETECT_ACTION_BITMASK_DISARM = (1<<0),123// note: next enum will be (1<<1), then (1<<2), then (1<<3)124};125126enum {127USE_REVERSE_THRUST_NEVER = 0,128USE_REVERSE_THRUST_AUTO_ALWAYS = (1<<0),129USE_REVERSE_THRUST_AUTO_LAND_APPROACH = (1<<1),130USE_REVERSE_THRUST_AUTO_LOITER_TO_ALT = (1<<2),131USE_REVERSE_THRUST_AUTO_LOITER_ALL = (1<<3),132USE_REVERSE_THRUST_AUTO_WAYPOINT = (1<<4),133USE_REVERSE_THRUST_LOITER = (1<<5),134USE_REVERSE_THRUST_RTL = (1<<6),135USE_REVERSE_THRUST_CIRCLE = (1<<7),136USE_REVERSE_THRUST_CRUISE = (1<<8),137USE_REVERSE_THRUST_FBWB = (1<<9),138USE_REVERSE_THRUST_GUIDED = (1<<10),139USE_REVERSE_THRUST_AUTO_LANDING_PATTERN = (1<<11),140USE_REVERSE_THRUST_FBWA = (1<<12),141USE_REVERSE_THRUST_ACRO = (1<<13),142USE_REVERSE_THRUST_STABILIZE = (1<<14),143USE_REVERSE_THRUST_THERMAL = (1<<15),144};145146enum FlightOptions {147DIRECT_RUDDER_ONLY = (1 << 0),148CRUISE_TRIM_THROTTLE = (1 << 1),149DISABLE_TOFF_ATTITUDE_CHK = (1 << 2),150CRUISE_TRIM_AIRSPEED = (1 << 3),151CLIMB_BEFORE_TURN = (1 << 4),152ACRO_YAW_DAMPER = (1 << 5),153SURPRESS_TKOFF_SCALING = (1<<6),154ENABLE_DEFAULT_AIRSPEED = (1<<7),155GCS_REMOVE_TRIM_PITCH = (1 << 8),156OSD_REMOVE_TRIM_PITCH = (1 << 9),157CENTER_THROTTLE_TRIM = (1<<10),158DISABLE_GROUND_PID_SUPPRESSION = (1<<11),159ENABLE_LOITER_ALT_CONTROL = (1<<12),160INDICATE_WAITING_FOR_RUDDER_NEUTRAL = (1<<13),161IMMEDIATE_CLIMB_IN_AUTO = (1<<14),162};163164enum CrowFlapOptions {165FLYINGWING = (1 << 0),166FULLSPAN = (1 << 1),167PROGRESSIVE_CROW = (1 << 2),168};169170171enum guided_heading_type_t {172GUIDED_HEADING_NONE = 0, // no heading track173GUIDED_HEADING_COG, // maintain ground track174GUIDED_HEADING_HEADING, // maintain a heading175};176177178enum class AirMode {179OFF,180ON,181ASSISTED_FLIGHT_ONLY,182};183184enum class FenceAutoEnable : uint8_t {185OFF=0,186Auto=1,187AutoDisableFloorOnly=2,188WhenArmed=3189};190191192