2016-03-17 15:02:55 -03:00
# pragma once
2015-12-30 18:57:56 -04:00
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
//
// DO NOT EDIT this file to adjust your configuration. Create your own
// APM_Config.h and use APM_Config.h.example as a reference.
//
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
///
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Default and automatic configuration details.
//
// Notes for maintainers:
//
// - Try to keep this file organised in the same order as APM_Config.h.example
//
# include "defines.h"
///
/// DO NOT EDIT THIS INCLUDE - if you want to make a local change, make that
/// change in your local copy of APM_Config.h.
///
2016-02-20 15:32:42 -04:00
# include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER.
2015-12-30 18:57:56 -04:00
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// 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
# define MAIN_LOOP_SECONDS 0.0025f
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 18:58:31 -04:00
//////////////////////////////////////////////////////////////////////////////
// RPM
//
# ifndef RPM_ENABLED
# define RPM_ENABLED DISABLED
# 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_ENABLED
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_ENABLED ENABLED
2015-12-30 18:57:56 -04:00
# endif
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_GAIN_DEFAULT
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_GAIN_DEFAULT 0.8f // gain for controlling how quickly rangefinder range adjusts target altitude (lower means slower reaction)
2015-12-30 18:57:56 -04:00
# endif
2016-05-22 21:50:44 -03:00
# ifndef THR_SURFACE_TRACKING_VELZ_MAX
2017-02-03 17:33:27 -04:00
# define THR_SURFACE_TRACKING_VELZ_MAX 150 // max vertical speed change while surface tracking with 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
2016-05-22 21:50:44 -03:00
# ifndef RANGEFINDER_TILT_CORRECTION // by disable tilt correction for use of range finder data by EKF
2017-02-03 17:33:27 -04:00
# define RANGEFINDER_TILT_CORRECTION ENABLED
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
# if AVOIDANCE_ENABLED == ENABLED // Avoidance Library relies on Proximity and Fence
# define PROXIMITY_ENABLED ENABLED
# define FENCE_ENABLED ENABLED
# endif
// Proximity sensor
//
# ifndef PROXIMITY_ENABLED
2017-02-03 17:33:27 -04:00
# define PROXIMITY_ENABLED DISABLED
2017-02-03 00:18:27 -04:00
# 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
//////////////////////////////////////////////////////////////////////////////
// MAGNETOMETER
# ifndef MAGNETOMETER
2017-02-03 17:33:27 -04:00
# define MAGNETOMETER ENABLED
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// OPTICAL_FLOW
# ifndef OPTFLOW
2017-02-03 17:33:27 -04:00
# define OPTFLOW DISABLED
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
2017-02-03 17:33:27 -04:00
// gripper
2017-02-03 00:18:27 -04:00
# ifndef GRIPPER_ENABLED
2017-02-03 17:33:27 -04:00
# define GRIPPER_ENABLED DISABLED
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
//////////////////////////////////////////////////////////////////////////////
// CAMERA TRIGGER AND CONTROL
//
# ifndef CAMERA
2017-04-13 00:15:51 -03:00
# define CAMERA DISABLED
2015-12-30 18:57:56 -04:00
# endif
//////////////////////////////////////////////////////////////////////////////
// MOUNT (ANTENNA OR CAMERA)
//
# ifndef MOUNT
2017-02-03 17:33:27 -04:00
# define MOUNT 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
//
# ifndef LOGGING_ENABLED
2017-02-03 17:33:27 -04:00
# define LOGGING_ENABLED ENABLED
2015-12-30 18:57:56 -04:00
# endif
// 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
2018-06-01 00:33:37 -03:00
// Enable/disable Fence
2015-12-30 18:57:56 -04:00
# ifndef AC_FENCE
2017-02-03 17:33:27 -04:00
# define AC_FENCE ENABLED
2015-12-30 18:57:56 -04:00
# endif
# ifndef AC_RALLY
2017-02-03 17:33:27 -04:00
# define AC_RALLY DISABLED
2015-12-30 18:57:56 -04:00
# endif
# ifndef AC_TERRAIN
2017-02-03 17:33:27 -04:00
# define AC_TERRAIN DISABLED // Requires Rally enabled as well
2015-12-30 18:57:56 -04:00
# endif