#!/bin/sh
#
# @name TBS Caipirinha
#
# @type Flying Wing
# @class Plane
#
# @output MAIN1 left aileron
# @output MAIN2 right aileron
# @output MAIN4 throttle
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
#

. /etc/init.d/rc.fw_defaults

if [ $AUTOCNF = yes ]
then
	param set FW_AIRSPD_MAX 25
	param set FW_AIRSPD_MIN 12.5
	param set FW_AIRSPD_TRIM 16.5
	param set FW_L1_DAMPING 0.75
	param set FW_L1_PERIOD 15
	param set FW_LND_ANG 15
	param set FW_LND_FLALT 8
	param set FW_LND_HHDIST 15
	param set FW_LND_HVIRT 13
	param set FW_LND_TLALT 10
	param set FW_THR_LND_MAX 0
	param set FW_P_LIM_MAX 20
	param set FW_P_LIM_MIN -30
	param set FW_R_LIM 45
	param set FW_R_TC 0.4
	param set FW_P_TC 0.4
	param set FW_PR_FF 0.45
	param set FW_PR_IMAX 0.4
	param set FW_PR_P 0.005
	param set FW_RR_FF 0.45
	param set FW_RR_IMAX 0.2
	param set FW_RR_P 0.013
	param set FW_P_RMAX_NEG 70
	param set FW_P_RMAX_POS 70
	param set FW_R_RMAX 70
	param set FW_THR_CRUISE 0.55

	param set LNDFW_AIRSPD_MAX 6
	param set LNDFW_XYACC_MAX 4
	param set LNDFW_VEL_XY_MAX 3
	param set LNDFW_VEL_Z_MAX 5

	param set MIS_TAKEOFF_ALT 50

	param set NAV_LOITER_RAD 30

	param set PWM_MAIN_REV1 1
	param set PWM_MAIN_REV2 1
	param set PWM_MIN 900
	param set PWM_MAX 2100
fi

set MIXER caipi
set PWM_OUT 1234
