2016-03-17 15:02:55 -03:00
# pragma once
2015-12-30 18:57:56 -04:00
# include "defines.h"
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// HARDWARE CONFIGURATION AND CONNECTIONS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
# ifndef CONFIG_HAL_BOARD
2017-02-10 13:46:54 -04:00
# error CONFIG_HAL_BOARD must be defined to build ArduSub
2015-12-30 18:57:56 -04:00
# endif
// run at 400Hz on all systems
# define MAIN_LOOP_RATE 400
2016-03-01 21:39:23 -04:00
# ifndef SURFACE_DEPTH_DEFAULT
2017-02-03 17:33:27 -04:00
# define SURFACE_DEPTH_DEFAULT -10.0f // pressure sensor reading 10cm depth means craft is considered surfaced
2016-03-01 21:39:23 -04:00
# endif
2015-12-30 18:57:56 -04:00
//////////////////////////////////////////////////////////////////////////////
// PWM control
// default RC speed in Hz
2016-12-07 12:43:30 -04:00
# ifndef RC_SPEED_DEFAULT
2017-02-03 17:33:27 -04:00
# define RC_SPEED_DEFAULT 200
2015-12-30 18:57:56 -04:00
# endif
2016-11-29 12:53:48 -04:00
//////////////////////////////////////////////////////////////////////////////
// Circle Nav parameters
//
# ifndef CIRCLE_NAV_ENABLED
2017-03-09 18:29:59 -04:00
# define CIRCLE_NAV_ENABLED ENABLED
2016-11-29 12:53:48 -04:00
# endif
2016-11-25 19:26:28 -04:00
//////////////////////////////////////////////////////////////////////////////
// RCMAP
//
# ifndef RCMAP_ENABLED
# define RCMAP_ENABLED DISABLED
# endif
2015-12-30 18:57:56 -04:00
//////////////////////////////////////////////////////////////////////////////
2016-05-22 21:50:44 -03:00
// Rangefinder
2015-12-30 18:57:56 -04:00
//
2016-05-22 21:50:44 -03:00
# ifndef RANGEFINDER_HEALTH_MAX
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_HEALTH_MAX 3 // number of good reads that indicates a healthy rangefinder
2015-12-30 18:57:56 -04:00
# endif
2016-05-22 21:50:44 -03:00
# ifndef RANGEFINDER_TIMEOUT_MS
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_TIMEOUT_MS 1000 // desired rangefinder alt will reset to current rangefinder alt after this many milliseconds without a good rangefinder alt
2015-12-30 18:57:56 -04:00
# endif
2016-05-22 21:50:44 -03:00
# ifndef RANGEFINDER_WPNAV_FILT_HZ
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_WPNAV_FILT_HZ 0.25f // filter frequency for rangefinder altitude provided to waypoint navigation class
2015-12-30 18:57:56 -04:00
# endif
2024-02-21 16:12:34 -04:00
# ifndef RANGEFINDER_TILT_CORRECTION // by disable tilt correction for use of range finder data by EKF
# define RANGEFINDER_TILT_CORRECTION DISABLED
# endif
# ifndef RANGEFINDER_SIGNAL_MIN_DEFAULT
# define RANGEFINDER_SIGNAL_MIN_DEFAULT 90 // rangefinder readings with signal quality below this value are ignored
# endif
# ifndef SURFTRAK_DEPTH_DEFAULT
# define SURFTRAK_DEPTH_DEFAULT -50.0f // surftrak will try to keep the sub below this depth
2015-12-30 18:57:56 -04:00
# endif
2017-02-03 00:18:27 -04:00
// Avoidance (relies on Proximity and Fence)
# ifndef AVOIDANCE_ENABLED
# define AVOIDANCE_ENABLED DISABLED
# endif
2021-03-25 05:09:38 -03:00
# if AVOIDANCE_ENABLED == ENABLED // Avoidance Library relies on Fence
2017-02-03 00:18:27 -04:00
# define FENCE_ENABLED ENABLED
# endif
2015-12-30 18:57:56 -04:00
# ifndef MAV_SYSTEM_ID
2017-02-03 17:33:27 -04:00
# define MAV_SYSTEM_ID 1
2015-12-30 18:57:56 -04:00
# endif
# ifndef EKF_ORIGIN_MAX_DIST_M
2017-02-03 17:33:27 -04:00
# define EKF_ORIGIN_MAX_DIST_M 50000 // EKF origin and waypoints (including home) must be within 50km
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// Nav-Guided - allows external nav computer to control vehicle
# ifndef NAV_GUIDED
2017-02-03 17:33:27 -04:00
# define NAV_GUIDED ENABLED
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// Flight mode definitions
//
// Acro Mode
# ifndef ACRO_RP_P
2017-02-03 17:33:27 -04:00
# define ACRO_RP_P 4.5f
2015-12-30 18:57:56 -04:00
# endif
# ifndef ACRO_YAW_P
2018-04-22 02:03:38 -03:00
# define ACRO_YAW_P 3.375f
2015-12-30 18:57:56 -04:00
# endif
# ifndef ACRO_LEVEL_MAX_ANGLE
2017-02-03 17:33:27 -04:00
# define ACRO_LEVEL_MAX_ANGLE 3000
2015-12-30 18:57:56 -04:00
# endif
# ifndef ACRO_BALANCE_ROLL
2017-02-03 17:33:27 -04:00
# define ACRO_BALANCE_ROLL 1.0f
2015-12-30 18:57:56 -04:00
# endif
# ifndef ACRO_BALANCE_PITCH
2017-02-03 17:33:27 -04:00
# define ACRO_BALANCE_PITCH 1.0f
2015-12-30 18:57:56 -04:00
# endif
# ifndef ACRO_EXPO_DEFAULT
2017-02-03 17:33:27 -04:00
# define ACRO_EXPO_DEFAULT 0.3f
2015-12-30 18:57:56 -04:00
# endif
// AUTO Mode
# ifndef WP_YAW_BEHAVIOR_DEFAULT
2017-08-19 20:53:09 -03:00
# define WP_YAW_BEHAVIOR_DEFAULT WP_YAW_BEHAVIOR_CORRECT_XTRACK
2015-12-30 18:57:56 -04:00
# endif
# ifndef AUTO_YAW_SLEW_RATE
2017-02-03 17:33:27 -04:00
# define AUTO_YAW_SLEW_RATE 60 // degrees/sec
2015-12-30 18:57:56 -04:00
# endif
# ifndef YAW_LOOK_AHEAD_MIN_SPEED
2017-02-10 13:46:54 -04:00
# define YAW_LOOK_AHEAD_MIN_SPEED 100 // minimum ground speed in cm/s required before vehicle is aimed at ground course
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// Stabilize Rate Control
//
# ifndef ROLL_PITCH_INPUT_MAX
2017-02-03 17:33:27 -04:00
# define ROLL_PITCH_INPUT_MAX 4500 // roll, pitch input range
2015-12-30 18:57:56 -04:00
# endif
# ifndef DEFAULT_ANGLE_MAX
2017-02-03 17:33:27 -04:00
# define DEFAULT_ANGLE_MAX 4500 // ANGLE_MAX parameters default value
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// Loiter position control gains
//
# ifndef POS_XY_P
2017-02-03 17:33:27 -04:00
# define POS_XY_P 1.0f
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// PosHold parameter defaults
//
# ifndef POSHOLD_ENABLED
2017-02-03 17:33:27 -04:00
# define POSHOLD_ENABLED ENABLED // PosHold flight mode enabled by default
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// Throttle control gains
//
# ifndef THR_DZ_DEFAULT
# define THR_DZ_DEFAULT 100 // the deadzone above and below mid throttle while in althold or loiter
# endif
// default maximum vertical velocity and acceleration the pilot may request
# ifndef PILOT_VELZ_MAX
2017-02-03 17:33:27 -04:00
# define PILOT_VELZ_MAX 500 // maximum vertical velocity in cm/s
2015-12-30 18:57:56 -04:00
# endif
# ifndef PILOT_ACCEL_Z_DEFAULT
2017-02-03 17:33:27 -04:00
# define PILOT_ACCEL_Z_DEFAULT 100 // vertical acceleration in cm/s/s while altitude is under pilot control
2015-12-30 18:57:56 -04:00
# endif
# ifndef AUTO_DISARMING_DELAY
2016-05-03 23:23:58 -03:00
# define AUTO_DISARMING_DELAY 0
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
2019-02-11 04:11:57 -04:00
// Logging control
2015-12-30 18:57:56 -04:00
//
// Default logging bitmask
# ifndef DEFAULT_LOG_BITMASK
2017-02-03 17:33:27 -04:00
# define DEFAULT_LOG_BITMASK \
2015-12-30 18:57:56 -04:00
MASK_LOG_ATTITUDE_MED | \
MASK_LOG_GPS | \
MASK_LOG_PM | \
MASK_LOG_CTUN | \
MASK_LOG_NTUN | \
MASK_LOG_RCIN | \
MASK_LOG_IMU | \
MASK_LOG_CMD | \
MASK_LOG_CURRENT | \
MASK_LOG_RCOUT | \
MASK_LOG_OPTFLOW | \
MASK_LOG_COMPASS | \
MASK_LOG_CAMERA | \
MASK_LOG_MOTBATT
# endif