#pragma once12#include "defines.h"34//////////////////////////////////////////////////////////////////////////////5//////////////////////////////////////////////////////////////////////////////6// HARDWARE CONFIGURATION AND CONNECTIONS7//////////////////////////////////////////////////////////////////////////////8//////////////////////////////////////////////////////////////////////////////910#ifndef CONFIG_HAL_BOARD11#error CONFIG_HAL_BOARD must be defined to build ArduSub12#endif1314// run at 400Hz on all systems15# define MAIN_LOOP_RATE 4001617#ifndef SURFACE_DEPTH_DEFAULT18# define SURFACE_DEPTH_DEFAULT -10.0f // pressure sensor reading 10cm depth means craft is considered surfaced19#endif2021//////////////////////////////////////////////////////////////////////////////22// PWM control23// default RC speed in Hz24#ifndef RC_SPEED_DEFAULT25# define RC_SPEED_DEFAULT 20026#endif2728//////////////////////////////////////////////////////////////////////////////29// Circle Nav parameters30//3132#ifndef CIRCLE_NAV_ENABLED33# define CIRCLE_NAV_ENABLED 134#endif3536//////////////////////////////////////////////////////////////////////////////37// RC38//3940#ifndef AP_SUB_RC_ENABLED41# define AP_SUB_RC_ENABLED 142#endif43#ifndef RCMAP_ENABLED44# define RCMAP_ENABLED AP_SUB_RC_ENABLED45#endif4647//////////////////////////////////////////////////////////////////////////////48// Throttle Failsafe49//50#ifndef FS_THR_VALUE_DEFAULT51# define FS_THR_VALUE_DEFAULT 97552#endif535455//////////////////////////////////////////////////////////////////////////////56// Rangefinder57//5859#ifndef RANGEFINDER_HEALTH_MAX60# define RANGEFINDER_HEALTH_MAX 3 // number of good reads that indicates a healthy rangefinder61#endif6263#ifndef RANGEFINDER_TIMEOUT_MS64# define RANGEFINDER_TIMEOUT_MS 1000 // desired rangefinder alt will reset to current rangefinder alt after this many milliseconds without a good rangefinder alt65#endif6667#ifndef RANGEFINDER_WPNAV_FILT_HZ68# define RANGEFINDER_WPNAV_FILT_HZ 0.25f // filter frequency for rangefinder altitude provided to waypoint navigation class69#endif7071#ifndef RANGEFINDER_TILT_CORRECTION // by disable tilt correction for use of range finder data by EKF72# define RANGEFINDER_TILT_CORRECTION 073#endif7475#ifndef RANGEFINDER_SIGNAL_MIN_DEFAULT76# define RANGEFINDER_SIGNAL_MIN_DEFAULT 90 // rangefinder readings with signal quality below this value are ignored77#endif7879#ifndef SURFTRAK_DEPTH_DEFAULT80# define SURFTRAK_DEPTH_DEFAULT -50.0f // surftrak will try to keep the sub below this depth81#endif8283// Avoidance (relies on Proximity and Fence)84#ifndef AVOIDANCE_ENABLED85# define AVOIDANCE_ENABLED 086#endif8788#if AVOIDANCE_ENABLED // Avoidance Library relies on Fence89# define FENCE_ENABLED 190#endif9192#ifndef MAV_SYSTEM_ID93# define MAV_SYSTEM_ID 194#endif9596//////////////////////////////////////////////////////////////////////////////97// Nav-Guided - allows external nav computer to control vehicle98#ifndef NAV_GUIDED99# define NAV_GUIDED 1100#endif101102//////////////////////////////////////////////////////////////////////////////103// Flight mode definitions104//105106// Acro Mode107#ifndef ACRO_RP_P108# define ACRO_RP_P 4.5f109#endif110111#ifndef ACRO_YAW_P112# define ACRO_YAW_P 3.375f113#endif114115#ifndef ACRO_LEVEL_MAX_ANGLE116# define ACRO_LEVEL_MAX_ANGLE 3000117#endif118119#ifndef ACRO_BALANCE_ROLL120#define ACRO_BALANCE_ROLL 1.0f121#endif122123#ifndef ACRO_BALANCE_PITCH124#define ACRO_BALANCE_PITCH 1.0f125#endif126127#ifndef ACRO_EXPO_DEFAULT128#define ACRO_EXPO_DEFAULT 0.3f129#endif130131// AUTO Mode132#ifndef WP_YAW_BEHAVIOR_DEFAULT133# define WP_YAW_BEHAVIOR_DEFAULT WP_YAW_BEHAVIOR_CORRECT_XTRACK134#endif135136#ifndef AUTO_YAW_SLEW_RATE137# define AUTO_YAW_SLEW_RATE 60 // degrees/sec138#endif139140#ifndef YAW_LOOK_AHEAD_MIN_SPEED141# define YAW_LOOK_AHEAD_MIN_SPEED 100 // minimum ground speed in cm/s required before vehicle is aimed at ground course142#endif143144//////////////////////////////////////////////////////////////////////////////145// Stabilize Rate Control146//147#ifndef ROLL_PITCH_INPUT_MAX148# define ROLL_PITCH_INPUT_MAX 4500 // roll, pitch input range149#endif150#ifndef DEFAULT_ANGLE_MAX151# define DEFAULT_ANGLE_MAX 4500 // ANGLE_MAX parameters default value152#endif153154//////////////////////////////////////////////////////////////////////////////155// Loiter position control gains156//157#ifndef POS_XY_P158# define POS_XY_P 1.0f159#endif160161//////////////////////////////////////////////////////////////////////////////162// PosHold parameter defaults163//164#ifndef POSHOLD_ENABLED165# define POSHOLD_ENABLED 1 // PosHold flight mode enabled by default166#endif167168//////////////////////////////////////////////////////////////////////////////169// Throttle control gains170//171172#ifndef THR_DZ_DEFAULT173# define THR_DZ_DEFAULT 100 // the deadzone above and below mid throttle while in althold or loiter174#endif175176// default maximum velocities and acceleration the pilot may request177#ifndef PILOT_VELZ_MAX178# define PILOT_VELZ_MAX 500 // maximum vertical velocity in cm/s179#endif180#ifndef PILOT_SPEED_DEFAULT181# define PILOT_SPEED_DEFAULT 200 // maximum horizontal velocity in cm/s while under pilot control182#endif183#ifndef PILOT_ACCEL_Z_DEFAULT184# define PILOT_ACCEL_Z_DEFAULT 100 // vertical acceleration in cm/s/s while altitude is under pilot control185#endif186187#ifndef AUTO_DISARMING_DELAY188# define AUTO_DISARMING_DELAY 0189#endif190191#ifndef NEUTRAL_THROTTLE192# define NEUTRAL_THROTTLE (0.5f) // Throttle output for "no vertical thrust"193#endif194195//////////////////////////////////////////////////////////////////////////////196// Logging control197//198199// Default logging bitmask200#ifndef DEFAULT_LOG_BITMASK201# define DEFAULT_LOG_BITMASK \202MASK_LOG_ATTITUDE_MED | \203MASK_LOG_GPS | \204MASK_LOG_PM | \205MASK_LOG_CTUN | \206MASK_LOG_NTUN | \207MASK_LOG_RCIN | \208MASK_LOG_IMU | \209MASK_LOG_CMD | \210MASK_LOG_CURRENT | \211MASK_LOG_RCOUT | \212MASK_LOG_OPTFLOW | \213MASK_LOG_COMPASS | \214MASK_LOG_CAMERA | \215MASK_LOG_MOTBATT216#endif217218//Default flight modes219#ifndef FLIGHT_MODE_1220# define FLIGHT_MODE_1 Mode::Number::MANUAL221#endif222#ifndef FLIGHT_MODE_2223# define FLIGHT_MODE_2 Mode::Number::MANUAL224#endif225#ifndef FLIGHT_MODE_3226# define FLIGHT_MODE_3 Mode::Number::STABILIZE227#endif228#ifndef FLIGHT_MODE_4229# define FLIGHT_MODE_4 Mode::Number::STABILIZE230#endif231#ifndef FLIGHT_MODE_5232# define FLIGHT_MODE_5 Mode::Number::SURFACE233#endif234#ifndef FLIGHT_MODE_6235# define FLIGHT_MODE_6 Mode::Number::SURFACE236#endif237238239240