#!/bin/sh
#
# @name 3DR Solo
#
# @type Quadrotor x
# @class Copter
#
# @board px4_fmu-v2 exclude
# @board px4_fmu-v3 exclude
# @board px4_fmu-v4 exclude
# @board px4_fmu-v4pro exclude
# @board px4_fmu-v5 exclude
# @board px4_fmu-v5x exclude
# @board intel_aerofc-v1 exclude
#
# @maintainer Andreas Antener <andreas@uaventure.com>
#

sh /etc/init.d/rc.mc_defaults

if [ $AUTOCNF = yes ]
then
	# tuning
	param set MC_PITCHRATE_P    0.11
	param set MC_ROLLRATE_P     0.11
	param set MPC_MANTHR_MIN    0.08
	param set MPC_XY_VEL_MAX    3
	param set MPC_Z_VEL_MAX_DN     2

	# takeoff, land and RTL settings
	param set MIS_TAKEOFF_ALT   4
	param set RTL_LAND_DELAY    1
	param set RTL_DESCEND_ALT   5
	param set RTL_RETURN_ALT    15
	param set MPC_TILTMAX_LND   8
	param set MPC_LAND_SPEED    0.4
	param set MPC_HOLD_MAX_Z    1.5
	param set MPC_TKO_JMPSPD    2
	param set MPC_TKO_SPEED     1.5

	# setup
	# main board rotation: pitch 180
	param set SENS_BOARD_ROT    12
	# solo external mag rotation
	param set CAL_MAG0_ROT      30
	# no safety switch
	param set CBRK_IO_SAFETY    22027
	# battery voltage not available yet
	param set CBRK_SUPPLY_CHK   894281

	# RC configuration
	param set RC_MAP_MODE_SW    5
	param set RC_MAP_PITCH      2
	param set RC_MAP_ROLL       1
	param set RC_MAP_THROTTLE   3
	param set RC_MAP_YAW        4

	param set RC1_DZ            10
	param set RC1_MAX           1988
	param set RC1_MIN           1003
	param set RC1_REV           1
	param set RC1_TRIM          1499
	param set RC2_DZ            10
	param set RC2_MAX           1987
	param set RC2_MIN           1023
	param set RC2_REV           -1
	param set RC2_TRIM          1499
	param set RC3_DZ            10
	param set RC3_MAX           1877
	param set RC3_MIN           1023
	param set RC3_REV           1
	param set RC3_TRIM          1023
	param set RC4_DZ            10
	param set RC4_MAX           1998
	param set RC4_MIN           1012
	param set RC4_REV           1
	param set RC4_TRIM          1500
	param set RC5_DZ            10
	param set RC5_MAX           2000
	param set RC5_MIN           1000
	param set RC5_REV           1
	param set RC5_TRIM          1500

	# enable high-speed link on telem 1
	param set MAV_0_RATE 80000
	param set MAV_0_MODE 2
	param set SER_TEL1_BAUD 921600
fi

set MIXER quad_x

set PWM_OUT 1234
set MIXER_AUX none

