<configuration time_of_day="1242218293.02" data_file="09_05_13__14_38_13.data">
  <conf>
    <aircraft name="FUN1" ac_id="51" airframe="airframes/funjetgfi1.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/lyr.xml" settings="settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Longyearbyen Airport" LON0="15.483833" MAX_DIST_FROM_HOME="1700" GROUND_ALT="30" SECURITY_HEIGHT="60" ALT="130" QFU="40" LAT0="78.245241">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="5.0" NAME="HOME" X="15.0"/>
          <waypoint Y="150.3" NAME="TOWER" X="261.8"/>
          <waypoint Y="240" NAME="1" X="-130"/>
          <waypoint Y="1130.0" NAME="2" X="-260."/>
          <waypoint Y="304.8" NAME="S1" X="-561.6"/>
          <waypoint Y="1117.0" NAME="S2" X="88.8"/>
          <waypoint Y="-90.3" NAME="MOB" X="39.9"/>
          <waypoint Y="75" NAME="CR" X="0.1" ALT="131.0"/>
          <waypoint Y="40.4" NAME="START" X="279.6" ALT="100.0"/>
          <waypoint Y="-90.3" NAME="_BASELEG" X="39.9" ALT="130.0"/>
          <waypoint Y="132.3" NAME="AF" X="-158.7" ALT="130.0"/>
          <waypoint Y="61.9" NAME="TD" X="94.9" ALT="20.0"/>
          <waypoint Y="210" NAME="PROF_LAND" X="-100"/>
          <waypoint Y="1100" NAME="PROF_SEA" X="-230"/>
        </waypoints>
        <exceptions>
          <exception COND="estimator_z > 2000" DEROUTE="wait"/>
          <exception COND="datalink_time > 30" DEROUTE="wait"/>
          <exception COND="10 > PowerVoltage()" DEROUTE="wait"/>
        </exceptions>
        <blocks>
          <block NAME="start">
            <attitude THROTTLE="0.7" ROLL="0" PITCH="20" UNTIL="(estimator_flight_time > 3)" VMODE="throttle"/>
            <go WP="START"/>
          </block>
          <block STRIP_BUTTON="wait" NAME="wait">
            <circle WP="CR" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Down" STRIP_ICON="downdown.png" NAME="down">
            <set VAR="lateral_mode" VALUE="LATERAL_MODE_ROLL"/>
            <set VAR="v_ctl_mode" VALUE="V_CTL_MODE_MANUAL"/>
            <set VAR="h_ctl_disabled" VALUE="TRUE"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="(-0.6*MAX_PPRZ)"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="(0.9*MAX_PPRZ)"/>
            <while COND="estimator_z > ground_alt + 220"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
          </block>
          <block STRIP_BUTTON="DownEnd" STRIP_ICON="downdownend.png" NAME="down_end">
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
            <while COND="1.> stage_time"/>
            <set VAR="h_ctl_disabled" VALUE="FALSE"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) NS" STRIP_ICON="survey.png" NAME="Survey S1-S2 NS">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) WE" STRIP_ICON="survey_we.png" NAME="Survey S1-S2 WE">
            <survey_rectangle ORIENTATION="WE" WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Circle here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Up Land" STRIP_ICON="up_profile_l.png" NAME="profile_up land">
            <circle WP="PROF_LAND" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Land" STRIP_ICON="down_profile_l.png" NAME="profile_down land">
            <circle THROTTLE="0" WP="PROF_LAND" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Profile Up Sea" STRIP_ICON="up_profile_s.png" NAME="profile_up sea">
            <circle WP="PROF_SEA" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Sea" STRIP_ICON="down_profile_s.png" NAME="profile_down sea">
            <circle THROTTLE="0" WP="PROF_SEA" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10) && 20 > fabs(estimator_z - WaypointAlt(WP__BASELEG))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="FunJet GFI 1 Tiny 1.1">
        <servos>
          <servo NEUTRAL="1550" MAX="1900" NAME="THROTTLE" NO="2" MIN="1550"/>
          <servo NEUTRAL="1000" MAX="2000" NAME="LIGHT" NO="1" MIN="1000"/>
          <servo NEUTRAL="1432" MAX="1100" NAME="AILEVON_RIGHT" NO="5" MIN="1900"/>
          <servo NEUTRAL="1546" MAX="1900" NAME="AILEVON_LEFT" NO="6" MIN="1100"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
          <axis NAME="HATCH" FAILSAFE_VALUE="0"/>
          <axis NAME="LIGHT" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
          <set COMMAND="LIGHT" VALUE="@GAIN1"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="-0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="THROTTLE"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
          <set VALUE="@LIGHT" SERVO="LIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_0"/>
          <define NAME="IR2" VALUE="ADC_1"/>
          <define NAME="IR_TOP" VALUE="ADC_2"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="1"/>
          <define NAME="DEFAULT_CONTRAST" VALUE="200"/>
          <define NAME="RAD_OF_IR_CONTRAST" VALUE="0.75"/>
          <linear COEFF1="0.7" NAME="RollOfIrs" ARITY="2" COEFF2="-0.7"/>
          <linear COEFF1="0.7" NAME="PitchOfIrs" ARITY="2" COEFF2="0.7"/>
          <linear COEFF1="-1" NAME="TopOfIr" ARITY="1"/>
          <define NAME="RAD_OF_IR_MAX_VALUE" VALUE="0.0045"/>
          <define NAME="RAD_OF_IR_MIN_VALUE" VALUE="0.00075"/>
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="1.3"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1.3"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1."/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define NAME="ADC_CHANNEL_VSUPPLY" VALUE="AdcBank1(6)"/>
          <define NAME="VoltageOfAdc(adc)" VALUE="(0.01787109375*adc)"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="XBEE_INIT" VALUE="\"ATPL2\\rATRN1\\rATTT80\\r\""/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="LIGHT_PIN_1" VALUE="3"/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10.0"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.024"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.011"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.03"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.80"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.7"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="8300."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
          <define NAME="ROLL_RATE_MODE_DEFAULT" VALUE="0"/>
          <define UNIT="rad/s/rad" NAME="ROLL_RATE_SETPOINT_PGAIN" VALUE="-5."/>
          <define NAME="ROLL_RATE_MAX_SETPOINT" VALUE="10"/>
          <define NAME="LO_THROTTLE_ROLL_RATE_PGAIN" VALUE="1000."/>
          <define NAME="HI_THROTTLE_ROLL_RATE_PGAIN" VALUE="1000."/>
          <define NAME="ROLL_RATE_IGAIN" VALUE="0."/>
          <define NAME="ROLL_RATE_DGAIN" VALUE="0."/>
          <define NAME="ROLL_RATE_SUM_NB_SAMPLES" VALUE="64"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.8"/>
          <define NAME="CLIMB_PITCH" VALUE="0.22"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.0"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.25"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="DATALINK" PREFIX="DATALINK_">
          <define NAME="DEVICE_TYPE" VALUE="XBEE"/>
          <define NAME="DEVICE_ADDRESS" VALUE="...."/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=\&quot;tiny_1_1.h\&quot; -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4015_MAT_hw.h\&quot; -DSERVOS_4015_MAT
ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
#TRANSPARENT ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600
#TRANSPARENT ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DGPS_LED=2 -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400
ap.srcs += gps_ubx.c gps.c
ap.CFLAGS += -DINFRARED
# -DALT_KALMAN
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM -DWIND_INFO -DWIND_INFO_RET
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c latlong.c nav_survey_rectangle.c nav_line.c
#ap.srcs += traffic_info.c
ap.srcs += i2c.c arm7/i2c_hw.c dpicco.c
ap.CFLAGS += -DDPICCO
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += bomb.c
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Hack to use the same tuning file than slayer1
ap.CFLAGS += -DUSE_GPIO
ap.srcs += $(SRC_ARCH)/gpio.c
#ap.CFLAGS += -DTELEMETRY_MODE_FBW=1 -DTELEMETRY_MODE_AP=1
# Harware In The Loop
#ap.CFLAGS += -DHITL
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny_1_1.h\&quot; -DAGR_CLIMB -DH_CTL_RATE_LOOP -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_survey_rectangle.c nav_line.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="FUN4" ac_id="54" airframe="airframes/funjetgfi4.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/lyr.xml" settings="settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Longyearbyen Airport" LON0="15.483833" MAX_DIST_FROM_HOME="1700" GROUND_ALT="30" SECURITY_HEIGHT="60" ALT="130" QFU="40" LAT0="78.245241">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="5.0" NAME="HOME" X="15.0"/>
          <waypoint Y="150.3" NAME="TOWER" X="261.8"/>
          <waypoint Y="240" NAME="1" X="-130"/>
          <waypoint Y="1130.0" NAME="2" X="-260."/>
          <waypoint Y="304.8" NAME="S1" X="-561.6"/>
          <waypoint Y="1117.0" NAME="S2" X="88.8"/>
          <waypoint Y="-90.3" NAME="MOB" X="39.9"/>
          <waypoint Y="75" NAME="CR" X="0.1" ALT="131.0"/>
          <waypoint Y="40.4" NAME="START" X="279.6" ALT="100.0"/>
          <waypoint Y="-90.3" NAME="_BASELEG" X="39.9" ALT="130.0"/>
          <waypoint Y="132.3" NAME="AF" X="-158.7" ALT="130.0"/>
          <waypoint Y="61.9" NAME="TD" X="94.9" ALT="20.0"/>
          <waypoint Y="210" NAME="PROF_LAND" X="-100"/>
          <waypoint Y="1100" NAME="PROF_SEA" X="-230"/>
        </waypoints>
        <exceptions>
          <exception COND="estimator_z > 2000" DEROUTE="wait"/>
          <exception COND="datalink_time > 30" DEROUTE="wait"/>
          <exception COND="10 > PowerVoltage()" DEROUTE="wait"/>
        </exceptions>
        <blocks>
          <block NAME="start">
            <attitude THROTTLE="0.7" ROLL="0" PITCH="20" UNTIL="(estimator_flight_time > 3)" VMODE="throttle"/>
            <go WP="START"/>
          </block>
          <block STRIP_BUTTON="wait" NAME="wait">
            <circle WP="CR" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Down" STRIP_ICON="downdown.png" NAME="down">
            <set VAR="lateral_mode" VALUE="LATERAL_MODE_ROLL"/>
            <set VAR="v_ctl_mode" VALUE="V_CTL_MODE_MANUAL"/>
            <set VAR="h_ctl_disabled" VALUE="TRUE"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="(-0.6*MAX_PPRZ)"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="(0.9*MAX_PPRZ)"/>
            <while COND="estimator_z > ground_alt + 220"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
          </block>
          <block STRIP_BUTTON="DownEnd" STRIP_ICON="downdownend.png" NAME="down_end">
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
            <while COND="1.> stage_time"/>
            <set VAR="h_ctl_disabled" VALUE="FALSE"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) NS" STRIP_ICON="survey.png" NAME="Survey S1-S2 NS">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) WE" STRIP_ICON="survey_we.png" NAME="Survey S1-S2 WE">
            <survey_rectangle ORIENTATION="WE" WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Circle here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Up Land" STRIP_ICON="up_profile_l.png" NAME="profile_up land">
            <circle WP="PROF_LAND" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Land" STRIP_ICON="down_profile_l.png" NAME="profile_down land">
            <circle THROTTLE="0" WP="PROF_LAND" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Profile Up Sea" STRIP_ICON="up_profile_s.png" NAME="profile_up sea">
            <circle WP="PROF_SEA" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Sea" STRIP_ICON="down_profile_s.png" NAME="profile_down sea">
            <circle THROTTLE="0" WP="PROF_SEA" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10) && 20 > fabs(estimator_z - WaypointAlt(WP__BASELEG))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Funjet GFI 4 Tiny 2.1">
        <servos>
          <servo NEUTRAL="1550" MAX="2000" NAME="MOTOR" NO="0" MIN="1550"/>
          <servo NEUTRAL="1516" MAX="1100" NAME="AILEVON_LEFT" NO="2" MIN="1900"/>
          <servo NEUTRAL="1549" MAX="1900" NAME="AILEVON_RIGHT" NO="6" MIN="1120"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="MOTOR"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_1"/>
          <define NAME="IR2" VALUE="ADC_2"/>
          <define NAME="IR_TOP" VALUE="ADC_0"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="1.3"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1.3"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR1_SIGN" VALUE="-1"/>
          <define NAME="IR2_SIGN" VALUE="1"/>
          <define NAME="TOP_SIGN" VALUE="1"/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="1"/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
          <define NAME="VoltageOfAdc(adc)" VALUE="(0.02454*adc)"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="MIN_CIRCLE_RADIUS" VALUE="50."/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.024"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.012"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.03"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.8"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.7"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="7600."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.8"/>
          <define NAME="CLIMB_PITCH" VALUE="0.3"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.05"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.25"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="DATALINK" PREFIX="DATALINK_">
          <define NAME="DEVICE_TYPE" VALUE="XBEE"/>
          <define NAME="DEVICE_ADDRESS" VALUE="...."/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>CONFIG = \&quot;tiny_2_1.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4017_hw.h\&quot; -DSERVOS_4017
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
#TRANSPARENT
#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600
#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
# -DGPS_LED=2
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
ap.srcs += nav_line.c
ap.srcs += nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3  -DSCK_PIN=2
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="FUN5" ac_id="34" airframe="airframes/funjetgfi5.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/lyr.xml" settings="settings/switchlight.xml settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Longyearbyen Airport" LON0="15.483833" MAX_DIST_FROM_HOME="1700" GROUND_ALT="30" SECURITY_HEIGHT="60" ALT="130" QFU="40" LAT0="78.245241">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="5.0" NAME="HOME" X="15.0"/>
          <waypoint Y="150.3" NAME="TOWER" X="261.8"/>
          <waypoint Y="240" NAME="1" X="-130"/>
          <waypoint Y="1130.0" NAME="2" X="-260."/>
          <waypoint Y="304.8" NAME="S1" X="-561.6"/>
          <waypoint Y="1117.0" NAME="S2" X="88.8"/>
          <waypoint Y="-90.3" NAME="MOB" X="39.9"/>
          <waypoint Y="75" NAME="CR" X="0.1" ALT="131.0"/>
          <waypoint Y="40.4" NAME="START" X="279.6" ALT="100.0"/>
          <waypoint Y="-90.3" NAME="_BASELEG" X="39.9" ALT="130.0"/>
          <waypoint Y="132.3" NAME="AF" X="-158.7" ALT="130.0"/>
          <waypoint Y="61.9" NAME="TD" X="94.9" ALT="20.0"/>
          <waypoint Y="210" NAME="PROF_LAND" X="-100"/>
          <waypoint Y="1100" NAME="PROF_SEA" X="-230"/>
        </waypoints>
        <exceptions>
          <exception COND="estimator_z > 2000" DEROUTE="wait"/>
          <exception COND="datalink_time > 30" DEROUTE="wait"/>
          <exception COND="10 > PowerVoltage()" DEROUTE="wait"/>
        </exceptions>
        <blocks>
          <block NAME="start">
            <attitude THROTTLE="0.7" ROLL="0" PITCH="20" UNTIL="(estimator_flight_time > 3)" VMODE="throttle"/>
            <go WP="START"/>
          </block>
          <block STRIP_BUTTON="wait" NAME="wait">
            <circle WP="CR" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Down" STRIP_ICON="downdown.png" NAME="down">
            <set VAR="lateral_mode" VALUE="LATERAL_MODE_ROLL"/>
            <set VAR="v_ctl_mode" VALUE="V_CTL_MODE_MANUAL"/>
            <set VAR="h_ctl_disabled" VALUE="TRUE"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="(-0.6*MAX_PPRZ)"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="(0.9*MAX_PPRZ)"/>
            <while COND="estimator_z > ground_alt + 220"/>
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
          </block>
          <block STRIP_BUTTON="DownEnd" STRIP_ICON="downdownend.png" NAME="down_end">
            <set VAR="h_ctl_aileron_setpoint" VALUE="0"/>
            <set VAR="h_ctl_elevator_setpoint" VALUE="0"/>
            <while COND="1.> stage_time"/>
            <set VAR="h_ctl_disabled" VALUE="FALSE"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) NS" STRIP_ICON="survey.png" NAME="Survey S1-S2 NS">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2) WE" STRIP_ICON="survey_we.png" NAME="Survey S1-S2 WE">
            <survey_rectangle ORIENTATION="WE" WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Circle here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Up Land" STRIP_ICON="up_profile_l.png" NAME="profile_up land">
            <circle WP="PROF_LAND" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Land" STRIP_ICON="down_profile_l.png" NAME="profile_down land">
            <circle THROTTLE="0" WP="PROF_LAND" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Profile Up Sea" STRIP_ICON="up_profile_s.png" NAME="profile_up sea">
            <circle WP="PROF_SEA" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Profile Down Sea" STRIP_ICON="down_profile_s.png" NAME="profile_down sea">
            <circle THROTTLE="0" WP="PROF_SEA" PITCH="RadOfDeg(-10)" RADIUS="nav_radius" VMODE="throttle" UNTIL="(ground_alt+100 > estimator_z)"/>
            <deroute BLOCK="wait"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10) && 20 > fabs(estimator_z - WaypointAlt(WP__BASELEG))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Funjet GFI 5 K61">
        <servos>
          <servo NEUTRAL="1000" MAX="2000" NAME="MOTOR" NO="0" MIN="1000"/>
          <servo NEUTRAL="1627" MAX="1100" NAME="AILEVON_LEFT" NO="2" MIN="1900"/>
          <servo NEUTRAL="1511" MAX="1900" NAME="AILEVON_RIGHT" NO="6" MIN="1100"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="MOTOR"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_1"/>
          <define NAME="IR2" VALUE="ADC_2"/>
          <define NAME="IR_TOP" VALUE="ADC_0"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="-1"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1.5"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR1_SIGN" VALUE="1"/>
          <define NAME="IR2_SIGN" VALUE="-1"/>
          <define NAME="TOP_SIGN" VALUE="-1"/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="0"/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
          <define NAME="VoltageOfAdc(adc)" VALUE="(0.02454*adc)"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="MIN_CIRCLE_RADIUS" VALUE="50."/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.06"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.023"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.06"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.8"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.62"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="6600."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.9"/>
          <define NAME="CLIMB_PITCH" VALUE="0.35"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.05"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.35"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="DATALINK" PREFIX="DATALINK_">
          <define NAME="DEVICE_TYPE" VALUE="XBEE"/>
          <define NAME="DEVICE_ADDRESS" VALUE="...."/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>CONFIG = \&quot;tiny_2_1.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4017_hw.h\&quot; -DSERVOS_4017
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
#TRANSPARENT
#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600
#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
# -DGPS_LED=2
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
ap.srcs += nav_line.c
ap.srcs += nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3  -DSCK_PIN=2
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="FUN7" ac_id="57" airframe="airframes/microjet6.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/basic.xml" settings="settings/switchlight.xml settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Basic" LON0="1.27289" MAX_DIST_FROM_HOME="1500" GROUND_ALT="0" SECURITY_HEIGHT="25" ALT="75" LAT0="43.46223">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="0" NAME="HOME" X="0"/>
          <waypoint Y="100.1" NAME="STDBY" X="49.5"/>
          <waypoint Y="189.9" NAME="1" X="10.1"/>
          <waypoint Y="139.1" NAME="2" X="132.3"/>
          <waypoint Y="-11.6" NAME="MOB" X="137.0"/>
          <waypoint Y="69.6" NAME="S1" X="-119.2"/>
          <waypoint Y="209.5" NAME="S2" X="274.4"/>
          <waypoint Y="45.1" NAME="AF" X="177.4" ALT="30.0"/>
          <waypoint Y="57.0" NAME="TD" X="28.8" ALT="0.0"/>
          <waypoint Y="-13.8" NAME="_BASELEG" X="168.8"/>
          <waypoint Y="162.3" NAME="CLIMB" X="-114.5"/>
        </waypoints>
        <exceptions/>
        <blocks>
          <block NAME="Wait GPS">
            <set VAR="kill_throttle" VALUE="1"/>
            <while COND="!GpsFixValid()"/>
          </block>
          <block NAME="Geo init">
            <while COND="LessThan(NavBlockTime(), 10)"/>
            <call FUN="NavSetGroundReferenceHere()"/>
          </block>
          <block NAME="Holding point">
            <set VAR="kill_throttle" VALUE="1"/>
            <attitude THROTTLE="0" ROLL="0" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Takeoff (wp CLIMB)" STRIP_ICON="takeoff.png" NAME="Takeoff">
            <exception COND="estimator_z > ground_alt+25" DEROUTE="Standby"/>
            <set VAR="kill_throttle" VALUE="0"/>
            <set VAR="estimator_flight_time" VALUE="0"/>
            <go THROTTLE="1.0" WP="CLIMB" PITCH="15" FROM="HOME" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Standby" STRIP_ICON="home.png" NAME="Standby">
            <circle WP="STDBY" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Figure 8 (wp 1-2)" STRIP_ICON="eight.png" NAME="Figure 8 around wp 1">
            <eight CENTER="1" TURN_AROUND="2" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Turn around here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <exception COND="datalink_time > 22" DEROUTE="Standby"/>
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2)" STRIP_ICON="survey.png" NAME="Survey S1-S2">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Microjet6 Tiny 1.1">
        <servos>
          <servo NEUTRAL="1000" MAX="2000" NAME="GAZ" NO="0" MIN="1000"/>
          <servo NEUTRAL="1000" MAX="2000" NAME="HATCH" NO="2" MIN="1000"/>
          <servo NEUTRAL="1518" MAX="2025" NAME="AILEVON_LEFT" NO="6" MIN="1075"/>
          <servo NEUTRAL="1595" MAX="975" NAME="AILEVON_RIGHT" NO="3" MIN="1975"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
          <axis NAME="HATCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
          <set COMMAND="HATCH" VALUE="@GAIN1"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.4"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.7"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="GAZ"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
          <set VALUE="@HATCH" SERVO="HATCH"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.6"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_0"/>
          <define NAME="IR2" VALUE="ADC_1"/>
          <define NAME="IR_TOP" VALUE="ADC_6"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
          <define NAME="GYRO_ROLL" VALUE="ADC_4"/>
          <define NAME="GYRO_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR2_SIGN" VALUE="-1"/>
          <define NAME="TOP_SIGN" VALUE="-1"/>
          <define NAME="LATERAL_CORRECTION" VALUE="1."/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1."/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1."/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="4."/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="2"/>
          <define NAME="CORRECTION_UP" VALUE="1.0"/>
          <define NAME="CORRECTION_DOWN" VALUE="1.0"/>
          <define NAME="CORRECTION_LEFT" VALUE="1.4"/>
          <define NAME="CORRECTION_RIGHT" VALUE="1.4"/>
        </section>
        <section NAME="GYRO" PREFIX="GYRO_">
          <define NAME="ADC_ROLL_NEUTRAL" VALUE="500"/>
          <define NAME="ADC_TEMP_NEUTRAL" VALUE="476"/>
          <define NAME="ADC_TEMP_SLOPE" VALUE="0"/>
          <define NAME="ROLL_SCALE" VALUE="0.44"/>
          <define NAME="ROLL_DIRECTION" VALUE="1."/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="LOW_BATTERY" VALUE="9.3"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="13."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="TRUE"/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="80."/>
          <define NAME="GLIDE_AIRSPEED" VALUE="10"/>
          <define NAME="GLIDE_VSPEED" VALUE="3."/>
          <define UNIT="deg" NAME="GLIDE_PITCH" VALUE="45"/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="11.1"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.03"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.32"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.25"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.65"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="1500"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-4000"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.15"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.01"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.1"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.05"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.075"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW_LIMITER" VALUE="10"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.55"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.6"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="5000."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-12500."/>
          <define NAME="PITCH_DGAIN" VALUE="1.5"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1250"/>
          <define NAME="ROLL_RATE_MODE_DEFAULT" VALUE="1"/>
          <define UNIT="rad/s/rad" NAME="ROLL_RATE_SETPOINT_PGAIN" VALUE="-10."/>
          <define NAME="ROLL_RATE_MAX_SETPOINT" VALUE="10"/>
          <define NAME="LO_THROTTLE_ROLL_RATE_PGAIN" VALUE="3000."/>
          <define NAME="HI_THROTTLE_ROLL_RATE_PGAIN" VALUE="3000."/>
          <define NAME="ROLL_RATE_IGAIN" VALUE="0."/>
          <define NAME="ROLL_RATE_DGAIN" VALUE="0."/>
          <define NAME="ROLL_RATE_SUM_NB_SAMPLES" VALUE="64"/>
          <define NAME="ROLL_SLEW" VALUE="0.1"/>
          <define NAME="SIMPLE_ROLL_PGAIN" VALUE="-15000"/>
          <define NAME="SIMPLE_ROLL_DGAIN" VALUE="-3000"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
          <define NAME="NAV_GROUND_SPEED_PGAIN" VALUE="-0.015"/>
          <define NAME="NAV_FOLLOW_PGAIN" VALUE="-0.05"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="20"/>
          <define NAME="BLEND_END" VALUE="10"/>
          <define NAME="CLIMB_THROTTLE" VALUE="1.00"/>
          <define NAME="CLIMB_PITCH" VALUE="0.3"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.1"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.25"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="1"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <makefile>include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=\&quot;tiny_1_1.h\&quot; -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4015_MAT_hw.h\&quot; -DSERVOS_4015_MAT
ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
# API mode
# ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600
# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
# transparent 
ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B9600
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_6
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c nav_survey_rectangle.c
ap.CFLAGS += -DGYRO -DADXRS150
ap.srcs += gyro.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
ap.srcs += nav_line.c
# Harware In The Loop
#ap.CFLAGS += -DHITL
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DUSE_BARO_MS5534A
sim.srcs += nav_survey_rectangle.c $(SRC_ARCH)/sim_baro.c bomb.c nav_line.c</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="FUN8" ac_id="58" airframe="airframes/roofbox.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/basic.xml" settings="settings/switchlight.xml settings/tuning.xml" gui_color="#f55ed59510d6">
      <flight_plan NAME="Basic" LON0="1.27289" MAX_DIST_FROM_HOME="1500" GROUND_ALT="0" SECURITY_HEIGHT="25" ALT="75" LAT0="43.46223">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="0" NAME="HOME" X="0"/>
          <waypoint Y="100.1" NAME="STDBY" X="49.5"/>
          <waypoint Y="189.9" NAME="1" X="10.1"/>
          <waypoint Y="139.1" NAME="2" X="132.3"/>
          <waypoint Y="-11.6" NAME="MOB" X="137.0"/>
          <waypoint Y="69.6" NAME="S1" X="-119.2"/>
          <waypoint Y="209.5" NAME="S2" X="274.4"/>
          <waypoint Y="45.1" NAME="AF" X="177.4" ALT="30.0"/>
          <waypoint Y="57.0" NAME="TD" X="28.8" ALT="0.0"/>
          <waypoint Y="-13.8" NAME="_BASELEG" X="168.8"/>
          <waypoint Y="162.3" NAME="CLIMB" X="-114.5"/>
        </waypoints>
        <exceptions/>
        <blocks>
          <block NAME="Wait GPS">
            <set VAR="kill_throttle" VALUE="1"/>
            <while COND="!GpsFixValid()"/>
          </block>
          <block NAME="Geo init">
            <while COND="LessThan(NavBlockTime(), 10)"/>
            <call FUN="NavSetGroundReferenceHere()"/>
          </block>
          <block NAME="Holding point">
            <set VAR="kill_throttle" VALUE="1"/>
            <attitude THROTTLE="0" ROLL="0" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Takeoff (wp CLIMB)" STRIP_ICON="takeoff.png" NAME="Takeoff">
            <exception COND="estimator_z > ground_alt+25" DEROUTE="Standby"/>
            <set VAR="kill_throttle" VALUE="0"/>
            <set VAR="estimator_flight_time" VALUE="0"/>
            <go THROTTLE="1.0" WP="CLIMB" PITCH="15" FROM="HOME" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Standby" STRIP_ICON="home.png" NAME="Standby">
            <circle WP="STDBY" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Figure 8 (wp 1-2)" STRIP_ICON="eight.png" NAME="Figure 8 around wp 1">
            <eight CENTER="1" TURN_AROUND="2" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Turn around here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <exception COND="datalink_time > 22" DEROUTE="Standby"/>
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2)" STRIP_ICON="survey.png" NAME="Survey S1-S2">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Bluetooth test">
        <servos>
          <servo NEUTRAL="1000" MAX="2000" NAME="MOTOR" NO="0" MIN="1000"/>
          <servo NEUTRAL="1563" MAX="1100" NAME="AILEVON_LEFT" NO="2" MIN="1900"/>
          <servo NEUTRAL="1489" MAX="1900" NAME="AILEVON_RIGHT" NO="6" MIN="1100"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="MOTOR"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_1"/>
          <define NAME="IR2" VALUE="ADC_2"/>
          <define NAME="IR_TOP" VALUE="ADC_0"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="-1"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1.5"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR1_SIGN" VALUE="1"/>
          <define NAME="IR2_SIGN" VALUE="-1"/>
          <define NAME="TOP_SIGN" VALUE="-1"/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="0"/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
          <define NAME="VoltageOfAdc(adc)" VALUE="(0.02454*adc)"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="MIN_CIRCLE_RADIUS" VALUE="50."/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.06"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.023"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.06"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.8"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.62"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="6600."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.9"/>
          <define NAME="CLIMB_PITCH" VALUE="0.35"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.05"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.35"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>CONFIG = \&quot;tiny_2_1.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4017_hw.h\&quot; -DSERVOS_4017
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
#XBee
#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
#TRANSPARENT
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B115200
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
# -DGPS_LED=2
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
ap.srcs += nav_line.c
ap.srcs += nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3  -DSCK_PIN=2
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="FUNT" ac_id="60" airframe="airframes/roofbox.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/basic.xml" settings="settings/switchlight.xml settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Basic" LON0="1.27289" MAX_DIST_FROM_HOME="1500" GROUND_ALT="0" SECURITY_HEIGHT="25" ALT="75" LAT0="43.46223">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="0" NAME="HOME" X="0"/>
          <waypoint Y="100.1" NAME="STDBY" X="49.5"/>
          <waypoint Y="189.9" NAME="1" X="10.1"/>
          <waypoint Y="139.1" NAME="2" X="132.3"/>
          <waypoint Y="-11.6" NAME="MOB" X="137.0"/>
          <waypoint Y="69.6" NAME="S1" X="-119.2"/>
          <waypoint Y="209.5" NAME="S2" X="274.4"/>
          <waypoint Y="45.1" NAME="AF" X="177.4" ALT="30.0"/>
          <waypoint Y="57.0" NAME="TD" X="28.8" ALT="0.0"/>
          <waypoint Y="-13.8" NAME="_BASELEG" X="168.8"/>
          <waypoint Y="162.3" NAME="CLIMB" X="-114.5"/>
        </waypoints>
        <exceptions/>
        <blocks>
          <block NAME="Wait GPS">
            <set VAR="kill_throttle" VALUE="1"/>
            <while COND="!GpsFixValid()"/>
          </block>
          <block NAME="Geo init">
            <while COND="LessThan(NavBlockTime(), 10)"/>
            <call FUN="NavSetGroundReferenceHere()"/>
          </block>
          <block NAME="Holding point">
            <set VAR="kill_throttle" VALUE="1"/>
            <attitude THROTTLE="0" ROLL="0" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Takeoff (wp CLIMB)" STRIP_ICON="takeoff.png" NAME="Takeoff">
            <exception COND="estimator_z > ground_alt+25" DEROUTE="Standby"/>
            <set VAR="kill_throttle" VALUE="0"/>
            <set VAR="estimator_flight_time" VALUE="0"/>
            <go THROTTLE="1.0" WP="CLIMB" PITCH="15" FROM="HOME" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Standby" STRIP_ICON="home.png" NAME="Standby">
            <circle WP="STDBY" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Figure 8 (wp 1-2)" STRIP_ICON="eight.png" NAME="Figure 8 around wp 1">
            <eight CENTER="1" TURN_AROUND="2" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Turn around here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <exception COND="datalink_time > 22" DEROUTE="Standby"/>
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2)" STRIP_ICON="survey.png" NAME="Survey S1-S2">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Bluetooth test">
        <servos>
          <servo NEUTRAL="1000" MAX="2000" NAME="MOTOR" NO="0" MIN="1000"/>
          <servo NEUTRAL="1563" MAX="1100" NAME="AILEVON_LEFT" NO="2" MIN="1900"/>
          <servo NEUTRAL="1489" MAX="1900" NAME="AILEVON_RIGHT" NO="6" MIN="1100"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="MOTOR"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_1"/>
          <define NAME="IR2" VALUE="ADC_2"/>
          <define NAME="IR_TOP" VALUE="ADC_0"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="-1"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1.5"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR1_SIGN" VALUE="1"/>
          <define NAME="IR2_SIGN" VALUE="-1"/>
          <define NAME="TOP_SIGN" VALUE="-1"/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="0"/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
          <define NAME="VoltageOfAdc(adc)" VALUE="(0.02454*adc)"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="MIN_CIRCLE_RADIUS" VALUE="50."/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.06"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.023"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.06"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.8"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.62"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="6600."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.9"/>
          <define NAME="CLIMB_PITCH" VALUE="0.35"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.05"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.35"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>CONFIG = \&quot;tiny_2_1.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4017_hw.h\&quot; -DSERVOS_4017
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
#XBee
#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B57600
#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c
#TRANSPARENT
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B115200
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
# -DGPS_LED=2
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
ap.srcs += nav_line.c
ap.srcs += nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3  -DSCK_PIN=2
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="HITLUSB" ac_id="61" airframe="airframes/usb_test.xml" radio="radios/mc24.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/basic.xml" settings="settings/switchlight.xml settings/tuning.xml" gui_color="#f684f5e811f8">
      <flight_plan NAME="Basic" LON0="1.27289" MAX_DIST_FROM_HOME="1500" GROUND_ALT="0" SECURITY_HEIGHT="25" ALT="75" LAT0="43.46223">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="0" NAME="HOME" X="0"/>
          <waypoint Y="100.1" NAME="STDBY" X="49.5"/>
          <waypoint Y="189.9" NAME="1" X="10.1"/>
          <waypoint Y="139.1" NAME="2" X="132.3"/>
          <waypoint Y="-11.6" NAME="MOB" X="137.0"/>
          <waypoint Y="69.6" NAME="S1" X="-119.2"/>
          <waypoint Y="209.5" NAME="S2" X="274.4"/>
          <waypoint Y="45.1" NAME="AF" X="177.4" ALT="30.0"/>
          <waypoint Y="57.0" NAME="TD" X="28.8" ALT="0.0"/>
          <waypoint Y="-13.8" NAME="_BASELEG" X="168.8"/>
          <waypoint Y="162.3" NAME="CLIMB" X="-114.5"/>
        </waypoints>
        <exceptions/>
        <blocks>
          <block NAME="Wait GPS">
            <set VAR="kill_throttle" VALUE="1"/>
            <while COND="!GpsFixValid()"/>
          </block>
          <block NAME="Geo init">
            <while COND="LessThan(NavBlockTime(), 10)"/>
            <call FUN="NavSetGroundReferenceHere()"/>
          </block>
          <block NAME="Holding point">
            <set VAR="kill_throttle" VALUE="1"/>
            <attitude THROTTLE="0" ROLL="0" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Takeoff (wp CLIMB)" STRIP_ICON="takeoff.png" NAME="Takeoff">
            <exception COND="estimator_z > ground_alt+25" DEROUTE="Standby"/>
            <set VAR="kill_throttle" VALUE="0"/>
            <set VAR="estimator_flight_time" VALUE="0"/>
            <go THROTTLE="1.0" WP="CLIMB" PITCH="15" FROM="HOME" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Standby" STRIP_ICON="home.png" NAME="Standby">
            <circle WP="STDBY" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Figure 8 (wp 1-2)" STRIP_ICON="eight.png" NAME="Figure 8 around wp 1">
            <eight CENTER="1" TURN_AROUND="2" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Turn around here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <exception COND="datalink_time > 22" DEROUTE="Standby"/>
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2)" STRIP_ICON="survey.png" NAME="Survey S1-S2">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="USB serial test">
        <servos>
          <servo NEUTRAL="1550" MAX="2000" NAME="MOTOR" NO="0" MIN="1550"/>
          <servo NEUTRAL="1516" MAX="1100" NAME="AILEVON_LEFT" NO="2" MIN="1900"/>
          <servo NEUTRAL="1549" MAX="1900" NAME="AILEVON_RIGHT" NO="6" MIN="1120"/>
        </servos>
        <commands>
          <axis NAME="THROTTLE" FAILSAFE_VALUE="0"/>
          <axis NAME="ROLL" FAILSAFE_VALUE="0"/>
          <axis NAME="PITCH" FAILSAFE_VALUE="0"/>
        </commands>
        <rc_commands>
          <set COMMAND="THROTTLE" VALUE="@THROTTLE"/>
          <set COMMAND="ROLL" VALUE="@ROLL"/>
          <set COMMAND="PITCH" VALUE="@PITCH"/>
        </rc_commands>
        <section NAME="MIXER">
          <define NAME="AILEVON_AILERON_RATE" VALUE="0.45"/>
          <define NAME="AILEVON_ELEVATOR_RATE" VALUE="0.8"/>
        </section>
        <command_laws>
          <let VAR="aileron" VALUE="@ROLL  * AILEVON_AILERON_RATE"/>
          <let VAR="elevator" VALUE="@PITCH * AILEVON_ELEVATOR_RATE"/>
          <set VALUE="@THROTTLE" SERVO="MOTOR"/>
          <set VALUE="$elevator + $aileron" SERVO="AILEVON_LEFT"/>
          <set VALUE="$elevator - $aileron" SERVO="AILEVON_RIGHT"/>
        </command_laws>
        <section NAME="AUTO1" PREFIX="AUTO1_">
          <define NAME="MAX_ROLL" VALUE="0.85"/>
          <define NAME="MAX_PITCH" VALUE="0.6"/>
        </section>
        <section NAME="adc" PREFIX="ADC_CHANNEL_">
          <define NAME="IR1" VALUE="ADC_1"/>
          <define NAME="IR2" VALUE="ADC_2"/>
          <define NAME="IR_TOP" VALUE="ADC_0"/>
          <define NAME="IR_NB_SAMPLES" VALUE="16"/>
        </section>
        <section NAME="INFRARED" PREFIX="IR_">
          <define NAME="ADC_IR1_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_IR2_NEUTRAL" VALUE="512"/>
          <define NAME="ADC_TOP_NEUTRAL" VALUE="512"/>
          <define NAME="CORRECTION_UP" VALUE="1."/>
          <define NAME="CORRECTION_DOWN" VALUE="1."/>
          <define NAME="CORRECTION_LEFT" VALUE="1."/>
          <define NAME="CORRECTION_RIGHT" VALUE="1."/>
          <define NAME="LATERAL_CORRECTION" VALUE="1.3"/>
          <define NAME="LONGITUDINAL_CORRECTION" VALUE="1.3"/>
          <define NAME="VERTICAL_CORRECTION" VALUE="1"/>
          <define NAME="HORIZ_SENSOR_TILTED" VALUE="1"/>
          <define NAME="IR1_SIGN" VALUE="-1"/>
          <define NAME="IR2_SIGN" VALUE="1"/>
          <define NAME="TOP_SIGN" VALUE="1"/>
          <define UNIT="deg" NAME="ROLL_NEUTRAL_DEFAULT" VALUE="0"/>
          <define UNIT="deg" NAME="PITCH_NEUTRAL_DEFAULT" VALUE="1"/>
        </section>
        <section NAME="BAT">
          <define NAME="MILLIAMP_PER_PERCENT" VALUE="0.86"/>
          <define UNIT="V" NAME="CATASTROPHIC_BAT_LEVEL" VALUE="9.3"/>
        </section>
        <section NAME="MISC">
          <define UNIT="m/s" NAME="NOMINAL_AIRSPEED" VALUE="15."/>
          <define UNIT="s" NAME="CARROT" VALUE="5."/>
          <define NAME="KILL_MODE_DISTANCE" VALUE="(1.5*MAX_DIST_FROM_HOME)"/>
          <define UNIT="Hz" NAME="CONTROL_RATE" VALUE="60"/>
          <define NAME="ALT_KALMAN_ENABLED" VALUE="FALSE"/>
          <define NAME="TRIGGER_DELAY" VALUE="1."/>
          <define NAME="DEFAULT_CIRCLE_RADIUS" VALUE="120."/>
          <define NAME="MIN_CIRCLE_RADIUS" VALUE="50."/>
        </section>
        <section NAME="VERTICAL CONTROL" PREFIX="V_CTL_">
          <define UNIT="volt" NAME="POWER_CTL_BAT_NOMINAL" VALUE="10"/>
          <define NAME="ALTITUDE_PGAIN" VALUE="-0.024"/>
          <define NAME="ALTITUDE_MAX_CLIMB" VALUE="2."/>
          <define NAME="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" VALUE="0.45"/>
          <define NAME="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" VALUE="0.35"/>
          <define NAME="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" VALUE="0.80"/>
          <define NAME="AUTO_THROTTLE_LOITER_TRIM" VALUE="50"/>
          <define NAME="AUTO_THROTTLE_DASH_TRIM" VALUE="-60"/>
          <define UNIT="%/(m/s)" NAME="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" VALUE="0.2"/>
          <define NAME="AUTO_THROTTLE_PGAIN" VALUE="-0.012"/>
          <define NAME="AUTO_THROTTLE_IGAIN" VALUE="0.01"/>
          <define NAME="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" VALUE="0.05"/>
          <define NAME="AUTO_PITCH_PGAIN" VALUE="-0.03"/>
          <define NAME="AUTO_PITCH_IGAIN" VALUE="0.0"/>
          <define NAME="AUTO_PITCH_MAX_PITCH" VALUE="0.35"/>
          <define NAME="AUTO_PITCH_MIN_PITCH" VALUE="-0.35"/>
          <define NAME="THROTTLE_SLEW" VALUE="0.1"/>
        </section>
        <section NAME="HORIZONTAL CONTROL" PREFIX="H_CTL_">
          <define NAME="COURSE_PGAIN" VALUE="-0.8"/>
          <define UNIT="radians" NAME="ROLL_MAX_SETPOINT" VALUE="0.7"/>
          <define UNIT="radians" NAME="PITCH_MAX_SETPOINT" VALUE="0.5"/>
          <define UNIT="radians" NAME="PITCH_MIN_SETPOINT" VALUE="-0.5"/>
          <define NAME="ROLL_PGAIN" VALUE="7600."/>
          <define NAME="AILERON_OF_THROTTLE" VALUE="0.0"/>
          <define NAME="PITCH_PGAIN" VALUE="-5500."/>
          <define NAME="PITCH_DGAIN" VALUE="0.4"/>
          <define NAME="ELEVATOR_OF_ROLL" VALUE="1200"/>
        </section>
        <section NAME="NAV">
          <define NAME="NAV_PITCH" VALUE="0."/>
          <define NAME="NAV_GLIDE_PITCH_TRIM" VALUE="0"/>
        </section>
        <section NAME="AGGRESSIVE" PREFIX="AGR_">
          <define NAME="BLEND_START" VALUE="50"/>
          <define NAME="BLEND_END" VALUE="15"/>
          <define NAME="CLIMB_THROTTLE" VALUE="0.8"/>
          <define NAME="CLIMB_PITCH" VALUE="0.3"/>
          <define NAME="DESCENT_THROTTLE" VALUE="0.05"/>
          <define NAME="DESCENT_PITCH" VALUE="-0.25"/>
          <define NAME="CLIMB_NAV_RATIO" VALUE="0.8"/>
          <define NAME="DESCENT_NAV_RATIO" VALUE="1.0"/>
        </section>
        <section NAME="FAILSAFE" PREFIX="FAILSAFE_">
          <define UNIT="s" NAME="DELAY_WITHOUT_GPS" VALUE="2"/>
          <define UNIT="%" NAME="DEFAULT_THROTTLE" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_ROLL" VALUE="0.3"/>
          <define UNIT="rad" NAME="DEFAULT_PITCH" VALUE="0.5"/>
          <define UNIT="m" NAME="HOME_RADIUS" VALUE="100"/>
        </section>
        <section NAME="SIMU">
          <define NAME="YAW_RESPONSE_FACTOR" VALUE="0.5"/>
        </section>
        <makefile>CONFIG = \&quot;tiny_2_1_1_usb.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS +=  -DFBW -DAP -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c main.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\&quot;servos_4017_hw.h\&quot; -DSERVOS_4017
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c  
#TRANSPARENT
#ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600
#ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
#USB
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=UsbS -DDOWNLINK_AP_DEVICE=UsbS -DUSE_USB_SERIAL -DPPRZ_UART=UsbS -DDATALINK=PPRZ
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/usb_ser_hw.c datalink.c pprz_transport.c
ap.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
ap.CFLAGS += -DINTER_MCU
ap.srcs += inter_mcu.c 
ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2
ap.srcs += $(SRC_ARCH)/adc_hw.c
ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG
# -DGPS_LED=2
ap.srcs += gps_ubx.c gps.c latlong.c
ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET
ap.srcs += infrared.c estimator.c
ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c
ap.srcs += nav_line.c
ap.srcs += nav_survey_rectangle.c
ap.srcs += humid_sht.c
ap.CFLAGS += -DUSE_HUMID_SHT -DDAT_PIN=3  -DSCK_PIN=2
ap.srcs += baro_scp.c
ap.CFLAGS += -DUSE_BARO_SCP
ap.srcs += joystick.c
ap.CFLAGS += -DUSE_JOYSTICK
# Config for SITL simulation
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DCONFIG=\&quot;tiny.h\&quot; -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
sim.srcs += nav_line.c nav_survey_rectangle.c
sim.srcs += joystick.c
sim.CFLAGS += -DUSE_JOYSTICK</makefile>
      </airframe>
      <radio DATA_MAX="2200" SYNC_MAX="15000" NAME="mc24" DATA_MIN="800" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1096" MAX="1900" FUNCTION="THROTTLE" MIN="1096" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="1900" FUNCTION="ROLL" MIN="1096" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="1096" FUNCTION="PITCH" MIN="1900" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1500" MAX="1900" FUNCTION="YAW" MIN="1096" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH1" MIN="1096" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1500" MAX="1900" FUNCTION="GAIN1" MIN="1096" AVERAGE="1"/>
        <channel CTL="F" NEUTRAL="1500" MAX="1900" FUNCTION="CALIB" MIN="1096" AVERAGE="0"/>
        <channel CTL="H" NEUTRAL="1500" MAX="2025" FUNCTION="MODE" MIN="966" AVERAGE="1"/>
        <channel CTL="I" NEUTRAL="1500" MAX="1900" FUNCTION="SWITCH2" MIN="1096" AVERAGE="1"/>
      </radio>
    </aircraft>
    <aircraft name="MYAC" ac_id="55" airframe="airframes/logger_sd.xml" radio="radios/cockpitSX.xml" telemetry="telemetry/default.xml" flight_plan="flight_plans/basic.xml" settings="settings/basic.xml" gui_color="blue">
      <flight_plan NAME="Basic" LON0="1.27289" MAX_DIST_FROM_HOME="1500" GROUND_ALT="0" SECURITY_HEIGHT="25" ALT="75" LAT0="43.46223">
        <header>#include &quot;nav_line.h&quot;
#include &quot;datalink.h&quot;</header>
        <waypoints>
          <waypoint Y="0" NAME="HOME" X="0"/>
          <waypoint Y="100.1" NAME="STDBY" X="49.5"/>
          <waypoint Y="189.9" NAME="1" X="10.1"/>
          <waypoint Y="139.1" NAME="2" X="132.3"/>
          <waypoint Y="-11.6" NAME="MOB" X="137.0"/>
          <waypoint Y="69.6" NAME="S1" X="-119.2"/>
          <waypoint Y="209.5" NAME="S2" X="274.4"/>
          <waypoint Y="45.1" NAME="AF" X="177.4" ALT="30.0"/>
          <waypoint Y="57.0" NAME="TD" X="28.8" ALT="0.0"/>
          <waypoint Y="-13.8" NAME="_BASELEG" X="168.8"/>
          <waypoint Y="162.3" NAME="CLIMB" X="-114.5"/>
        </waypoints>
        <exceptions/>
        <blocks>
          <block NAME="Wait GPS">
            <set VAR="kill_throttle" VALUE="1"/>
            <while COND="!GpsFixValid()"/>
          </block>
          <block NAME="Geo init">
            <while COND="LessThan(NavBlockTime(), 10)"/>
            <call FUN="NavSetGroundReferenceHere()"/>
          </block>
          <block NAME="Holding point">
            <set VAR="kill_throttle" VALUE="1"/>
            <attitude THROTTLE="0" ROLL="0" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Takeoff (wp CLIMB)" STRIP_ICON="takeoff.png" NAME="Takeoff">
            <exception COND="estimator_z > ground_alt+25" DEROUTE="Standby"/>
            <set VAR="kill_throttle" VALUE="0"/>
            <set VAR="estimator_flight_time" VALUE="0"/>
            <go THROTTLE="1.0" WP="CLIMB" PITCH="15" FROM="HOME" VMODE="throttle"/>
          </block>
          <block STRIP_BUTTON="Standby" STRIP_ICON="home.png" NAME="Standby">
            <circle WP="STDBY" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Figure 8 (wp 1-2)" STRIP_ICON="eight.png" NAME="Figure 8 around wp 1">
            <eight CENTER="1" TURN_AROUND="2" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Oval (wp 1-2)" STRIP_ICON="oval.png" NAME="Oval 1-2">
            <oval RADIUS="nav_radius" P2="2" P1="1"/>
          </block>
          <block STRIP_BUTTON="Turn around here" STRIP_ICON="mob.png" NAME="MOB">
            <call FUN="NavSetWaypointHere(WP_MOB)"/>
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <circle WP="MOB" RADIUS="nav_radius"/>
          </block>
          <block STRIP_BUTTON="Line (wp 1-2)" STRIP_ICON="line.png" NAME="Line 1-2">
            <exception COND="datalink_time > 22" DEROUTE="Standby"/>
            <call FUN="nav_line_init()"/>
            <call FUN="nav_line(WP_1, WP_2, nav_radius)"/>
          </block>
          <block STRIP_BUTTON="Survey (wp S1-S2)" STRIP_ICON="survey.png" NAME="Survey S1-S2">
            <survey_rectangle WP2="S2" GRID="150" WP1="S1"/>
          </block>
          <block STRIP_BUTTON="Land right (wp AF-TD)" STRIP_ICON="land-right.png" NAME="Land Right AF-TD">
            <set VAR="nav_radius" VALUE="DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block STRIP_BUTTON="Land left (wp AF-TD)" STRIP_ICON="land-left.png" NAME="Land Left AF-TD">
            <set VAR="nav_radius" VALUE="-DEFAULT_CIRCLE_RADIUS"/>
            <deroute BLOCK="land"/>
          </block>
          <block NAME="land">
            <call FUN="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="NavCircleCount() > 0.5"/>
            <circle WP="_BASELEG" RADIUS="nav_radius" UNTIL="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))"/>
          </block>
          <block NAME="final">
            <exception COND="ground_alt + 10 > estimator_z" DEROUTE="flare"/>
            <go WP="TD" FROM="AF" HMODE="route" VMODE="glide"/>
          </block>
          <block NAME="flare">
            <go APPROACHING_TIME="0" THROTTLE="0.0" WP="TD" FROM="AF" HMODE="route" VMODE="throttle"/>
            <attitude THROTTLE="0.0" ROLL="0.0" UNTIL="FALSE" VMODE="throttle"/>
          </block>
        </blocks>
      </flight_plan>
      <airframe NAME="Logger">
        <makefile>CONFIG = \&quot;tiny_2_1_1_usb.h\&quot;
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS += -DCONFIG=$(CONFIG) -DLED -DSYS_TIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_logger.c
ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600
# -DUSE_UART1_RX_ONLY
ap.srcs += $(SRC_ARCH)/uart_hw.c
#efsl
ap.CFLAGS += -I $(SRC_ARCH)/efsl/inc -I $(SRC_ARCH)/efsl/conf
ap.srcs += $(SRC_ARCH)/efsl/src/efs.c $(SRC_ARCH)/efsl/src/plibc.c 
ap.srcs += $(SRC_ARCH)/efsl/src/disc.c $(SRC_ARCH)/efsl/src/partition.c 
ap.srcs += $(SRC_ARCH)/efsl/src/time.c $(SRC_ARCH)/efsl/src/fs.c 
ap.srcs += $(SRC_ARCH)/efsl/src/fat.c $(SRC_ARCH)/efsl/src/file.c
ap.srcs += $(SRC_ARCH)/efsl/src/dir.c $(SRC_ARCH)/efsl/src/ls.c 
ap.srcs += $(SRC_ARCH)/efsl/src/mkfs.c $(SRC_ARCH)/efsl/src/debug.c
ap.srcs += $(SRC_ARCH)/efsl/src/ioman.c $(SRC_ARCH)/efsl/src/ui.c
ap.srcs += $(SRC_ARCH)/efsl/src/extract.c 
ap.srcs += $(SRC_ARCH)/efsl/src/interfaces/lpc2000_spi.c 
ap.srcs += $(SRC_ARCH)/efsl/src/interfaces/sd.c
#ap.srcs += $(SRC_ARCH)/efsl/src/interfaces/lpc2000_dbg_printf.c
#usb mass storage
ap.CFLAGS += -DUSE_USB_MSC
ap.CFLAGS += -I $(SRC_ARCH)/lpcusb -I $(SRC_ARCH)/lpcusb/examples
ap.srcs += $(SRC_ARCH)/usb_msc_hw.c
ap.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
ap.srcs += $(SRC_ARCH)/lpcusb/examples/msc_bot.c $(SRC_ARCH)/lpcusb/examples/msc_scsi.c $(SRC_ARCH)/lpcusb/examples/blockdev_sd.c $(SRC_ARCH)/lpcusb/examples/lpc2000_spi.c</makefile>
      </airframe>
      <radio DATA_MAX="2100" SYNC_MAX="15000" NAME="cockpitSX (easy)" DATA_MIN="900" SYNC_MIN="5000">
        <channel CTL="D" NEUTRAL="1500" MAX="2050" FUNCTION="ROLL" MIN="950" AVERAGE="0"/>
        <channel CTL="C" NEUTRAL="1500" MAX="950" FUNCTION="PITCH" MIN="2050" AVERAGE="0"/>
        <channel CTL="B" NEUTRAL="1500" MAX="950" FUNCTION="YAW" MIN="2050" AVERAGE="0"/>
        <channel CTL="A" NEUTRAL="1223" MAX="2050" FUNCTION="THROTTLE" MIN="1223" AVERAGE="0"/>
        <channel CTL="G" NEUTRAL="1500" MAX="950" FUNCTION="UNUSED" MIN="2050" AVERAGE="1"/>
        <channel CTL="E" NEUTRAL="1496" MAX="948" FUNCTION="GAIN1" MIN="2050" AVERAGE="1"/>
        <channel CTL="PHAUX2" NEUTRAL="1500" MAX="948" FUNCTION="MODE" MIN="2050" AVERAGE="1"/>
      </radio>
    </aircraft>
  </conf>
  <protocol>
    <class NAME="telemetry">
      <message NAME="BOOT" ID="1">
        <field NAME="version" TYPE="uint16"/>
      </message>
      <message NAME="ALIVE" ID="2">
        <field NAME="md5sum" TYPE="uint8[]"/>
      </message>
      <message NAME="PONG" ID="3"/>
      <message NAME="TAKEOFF" ID="4">
        <field NAME="cpu_time" TYPE="uint16" UNIT="s"/>
      </message>
      <message NAME="DebugChao" ID="5">
        <field NAME="int16_1" TYPE="int16" UNIT="deg"/>
        <field NAME="int16_2" TYPE="int16" UNIT="deg"/>
        <field NAME="int16_3" TYPE="int16" UNIT="deg"/>
        <field NAME="int32_1" TYPE="int32" UNIT="deg"/>
        <field NAME="int32_2" TYPE="int32" UNIT="deg"/>
        <field NAME="int32_3" TYPE="int32" UNIT="deg"/>
      </message>
      <message NAME="ATTITUDE" ID="6">
        <field NAME="phi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.3"/>
        <field NAME="psi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.3"/>
        <field NAME="theta" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.3"/>
      </message>
      <message NAME="IR_SENSORS" ID="7">
        <field NAME="ir1" TYPE="int16"/>
        <field NAME="ir2" TYPE="int16"/>
        <field NAME="longitudinal" TYPE="int16"/>
        <field NAME="lateral" TYPE="int16"/>
        <field NAME="vertical" TYPE="int16"/>
      </message>
      <message NAME="GPS" ID="8">
        <field NAME="mode" TYPE="uint8" UNIT="byte_mask"/>
        <field NAME="utm_east" TYPE="int32" UNIT="cm"/>
        <field NAME="utm_north" TYPE="int32" UNIT="cm"/>
        <field NAME="course" TYPE="int16" UNIT="decideg"/>
        <field NAME="alt" TYPE="int32" UNIT="cm"/>
        <field NAME="speed" TYPE="uint16" UNIT="cm/s"/>
        <field NAME="climb" TYPE="int16" UNIT="cm/s"/>
        <field NAME="itow" TYPE="uint32" UNIT="ms"/>
        <field NAME="utm_zone" TYPE="uint8"/>
        <field NAME="gps_nb_err" TYPE="uint8"/>
      </message>
      <message NAME="NAVIGATION_REF" ID="9">
        <field NAME="utm_east" TYPE="int32" UNIT="m"/>
        <field NAME="utm_north" TYPE="int32" UNIT="m"/>
        <field NAME="utm_zone" TYPE="uint8"/>
      </message>
      <message NAME="NAVIGATION" ID="10">
        <field NAME="cur_block" TYPE="uint8"/>
        <field NAME="cur_stage" TYPE="uint8"/>
        <field NAME="pos_x" TYPE="int16" UNIT="m"/>
        <field NAME="pos_y" TYPE="int16" UNIT="m"/>
        <field NAME="dist2_wp" TYPE="float" UNIT="m^2" FORMAT="%.1f"/>
        <field NAME="dist2_home" TYPE="float" UNIT="m^2" FORMAT="%.1f"/>
      </message>
      <message NAME="PPRZ_MODE" ID="11">
        <field NAME="ap_mode" TYPE="uint8" VALUES="MANUAL|AUTO1|AUTO2|HOME|NOGPS|FAILSAFE"/>
        <field NAME="ap_gaz" TYPE="uint8" VALUES="MANUAL|AUTO_THROTTLE|AUTO_CLIMB|AUTO_ALT"/>
        <field NAME="ap_lateral" TYPE="uint8" VALUES="MANUAL|ROLL_RATE|ROLL|COURSE"/>
        <field NAME="ap_horizontal" TYPE="uint8" VALUES="WAYPOINT|ROUTE|CIRCLE"/>
        <field NAME="if_calib_mode" TYPE="uint8" VALUES="NONE|DOWN|UP"/>
        <field NAME="mcu1_status" TYPE="uint8" VALUES="LOST|OK|REALLY_LOST"/>
      </message>
      <message NAME="BAT" ID="12">
        <field NAME="throttle" TYPE="int16" UNIT="pprz"/>
        <field NAME="voltage" TYPE="uint8" ALT_UNIT="V" UNIT="1e-1V" ALT_UNIT_COEF="0.1"/>
        <field NAME="flight_time" TYPE="uint16" UNIT="s"/>
        <field NAME="kill_auto_throttle" TYPE="uint8" UNIT="bool"/>
        <field NAME="block_time" TYPE="uint16" UNIT="s"/>
        <field NAME="stage_time" TYPE="uint16" UNIT="s"/>
        <field NAME="energy" TYPE="uint16" UNIT="mAh"/>
      </message>
      <message NAME="DEBUG_MCU_LINK" ID="13">
        <field NAME="i2c_nb_err" TYPE="uint8"/>
        <field NAME="i2c_mcu1_nb_err" TYPE="uint8"/>
        <field NAME="ppm_rate" TYPE="uint8"/>
      </message>
      <message NAME="CALIBRATION" ID="14">
        <field NAME="climb_sum_err" TYPE="float" FORMAT="%.1f"/>
        <field NAME="climb_gaz_submode" TYPE="uint8"/>
      </message>
      <message NAME="SETTINGS" ID="15">
        <field NAME="slider_1_val" TYPE="float"/>
        <field NAME="slider_2_val" TYPE="float"/>
      </message>
      <message NAME="DESIRED" ID="16">
        <field NAME="roll" TYPE="float" ALT_UNIT="deg" UNIT="rad" FORMAT="%.2f" ALT_UNIT_COEF="57.3"/>
        <field NAME="pitch" TYPE="float" ALT_UNIT="deg" UNIT="rad" FORMAT="%.2f" ALT_UNIT_COEF="57.3"/>
        <field NAME="course" TYPE="float" ALT_UNIT="deg" UNIT="rad" FORMAT="%.1f" ALT_UNIT_COEF="57.3"/>
        <field NAME="x" TYPE="float" UNIT="m" FORMAT="%.0f"/>
        <field NAME="y" TYPE="float" UNIT="m" FORMAT="%.0f"/>
        <field NAME="altitude" TYPE="float" UNIT="m" FORMAT="%.0f"/>
        <field NAME="climb" TYPE="float" UNIT="m/s" FORMAT="%.1f"/>
      </message>
      <message NAME="GPS_SOL" ID="17">
        <field NAME="Pacc" TYPE="uint32" UNIT="cm"/>
        <field NAME="Sacc" TYPE="uint32" UNIT="cm"/>
        <field NAME="PDOP" TYPE="uint16" UNIT="cm"/>
        <field NAME="numSV" TYPE="uint8"/>
      </message>
      <message NAME="ADC_GENERIC" ID="18">
        <field NAME="val1" TYPE="uint16"/>
        <field NAME="val2" TYPE="uint16"/>
      </message>
      <message NAME="CAM" ID="20">
        <field NAME="phi" TYPE="int8" UNIT="deg"/>
        <field NAME="theta" TYPE="int8" UNIT="deg"/>
        <field NAME="target_x" TYPE="int16" UNIT="m"/>
        <field NAME="target_y" TYPE="int16" UNIT="m"/>
      </message>
      <message NAME="CIRCLE" ID="21">
        <field NAME="center_east" TYPE="int16" UNIT="m"/>
        <field NAME="center_north" TYPE="int16" UNIT="m"/>
        <field NAME="radius" TYPE="int16" UNIT="m"/>
      </message>
      <message NAME="SEGMENT" ID="22">
        <field NAME="segment_east_1" TYPE="int16" UNIT="m"/>
        <field NAME="segment_north_1" TYPE="int16" UNIT="m"/>
        <field NAME="segment_east_2" TYPE="int16" UNIT="m"/>
        <field NAME="segment_north_2" TYPE="int16" UNIT="m"/>
      </message>
      <message NAME="DOWNLINK_STATUS" ID="23">
        <field NAME="run_time" TYPE="uint32" UNIT="s"/>
        <field NAME="rx_bytes" TYPE="uint32"/>
        <field NAME="rx_msgs" TYPE="uint32"/>
        <field NAME="rx_err" TYPE="uint32"/>
        <field NAME="rx_bytes_rate" TYPE="float" FORMAT="%.1f"/>
        <field NAME="rx_msgs_rate" TYPE="float" FORMAT="%.1f"/>
        <field NAME="ping_time" TYPE="float" UNIT="ms" FORMAT="%.2f"/>
      </message>
      <message NAME="MODEM_STATUS" ID="24">
        <field NAME="detected" TYPE="uint8"/>
        <field NAME="valim" TYPE="float" FORMAT="%.1f"/>
        <field NAME="cd" TYPE="uint8"/>
        <field NAME="nb_byte" TYPE="uint32"/>
        <field NAME="nb_msg" TYPE="uint32"/>
        <field NAME="nb_err" TYPE="uint32"/>
      </message>
      <message NAME="SVINFO" ID="25">
        <field NAME="chn" TYPE="uint8"/>
        <field NAME="SVID" TYPE="uint8"/>
        <field NAME="Flags" TYPE="uint8"/>
        <field NAME="QI" TYPE="int8"/>
        <field NAME="CNO" TYPE="uint8" UNIT="dbHz"/>
        <field NAME="Elev" TYPE="int8" UNIT="deg"/>
        <field NAME="Azim" TYPE="int16" UNIT="deg"/>
      </message>
      <message NAME="SURVEY" ID="27">
        <field NAME="east" TYPE="float" UNIT="m"/>
        <field NAME="north" TYPE="float" UNIT="m"/>
        <field NAME="west" TYPE="float" UNIT="m"/>
        <field NAME="south" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="WC_RSSI" ID="28">
        <field NAME="raw_level" TYPE="uint8"/>
      </message>
      <message NAME="RANGEFINDER" ID="29">
        <field NAME="range" TYPE="uint16" UNIT="cm"/>
        <field NAME="z_dot" TYPE="float" UNIT="m/s"/>
        <field NAME="z_dot_sum_err" TYPE="float" UNIT="m/s"/>
        <field NAME="z_dot_setpoint" TYPE="float" UNIT="m/s"/>
        <field NAME="z_sum_err" TYPE="float" UNIT="m/s"/>
        <field NAME="z_setpoint" TYPE="float" UNIT="m"/>
        <field NAME="flying" TYPE="uint8" UNIT="bool"/>
      </message>
      <message NAME="DOWNLINK" ID="30">
        <field NAME="nb_ovrn" TYPE="uint8"/>
        <field NAME="rate" TYPE="uint16" UNIT="bytes/s"/>
        <field NAME="nb_msgs" TYPE="uint16"/>
      </message>
      <message NAME="DL_VALUE" ID="31">
        <field NAME="index" TYPE="uint8"/>
        <field NAME="value" TYPE="float"/>
      </message>
      <message NAME="MARK" ID="32">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="lat" TYPE="float" UNIT="deg"/>
        <field NAME="long" TYPE="float" UNIT="deg"/>
      </message>
      <message NAME="WP_MOVED" ID="35">
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="utm_east" TYPE="float" UNIT="m"/>
        <field NAME="utm_north" TYPE="float" UNIT="m"/>
        <field NAME="alt" TYPE="float" UNIT="m"/>
        <field NAME="utm_zone" TYPE="uint8"/>
      </message>
      <message NAME="GYRO_RATES" ID="36">
        <field NAME="roll_adc" TYPE="int16"/>
        <field NAME="roll" TYPE="float" UNIT="rad/s"/>
        <field NAME="pitch" TYPE="float" UNIT="rad/s"/>
      </message>
      <message NAME="SPEED_LOOP" ID="40">
        <field NAME="ve_set_point" TYPE="float" UNIT="m/s"/>
        <field NAME="ve" TYPE="float" UNIT="m/s"/>
        <field NAME="vn_set_point" TYPE="float" UNIT="m/s"/>
        <field NAME="vn" TYPE="float" UNIT="m/s"/>
        <field NAME="north_sp" TYPE="float" UNIT="rad"/>
        <field NAME="east_sp" TYPE="float" UNIT="rad"/>
      </message>
      <message NAME="ALT_KALMAN" ID="41">
        <field NAME="p00" TYPE="float"/>
        <field NAME="p01" TYPE="float"/>
        <field NAME="p10" TYPE="float"/>
        <field NAME="p11" TYPE="float"/>
      </message>
      <message NAME="ESTIMATOR" ID="42">
        <field NAME="z" TYPE="float" UNIT="m"/>
        <field NAME="z_dot" TYPE="float" UNIT="m/s"/>
      </message>
      <message NAME="TUNE_ROLL" ID="43">
        <field NAME="p" TYPE="float"/>
        <field NAME="phi" TYPE="float"/>
        <field NAME="phi_sp" TYPE="float"/>
      </message>
      <message NAME="BARO_MS5534A" ID="44">
        <field NAME="pressure" TYPE="uint32" UNIT="P"/>
        <field NAME="temp" TYPE="uint16" UNIT="dC"/>
        <field NAME="alt" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="AIRSPEED" ID="45">
        <field NAME="adc" TYPE="uint16"/>
        <field NAME="airspeed" TYPE="float"/>
      </message>
      <message NAME="BARO_WORDS" ID="46">
        <field NAME="w1" TYPE="uint16"/>
        <field NAME="w2" TYPE="uint16"/>
        <field NAME="w3" TYPE="uint16"/>
        <field NAME="w4" TYPE="uint16"/>
      </message>
      <message NAME="WP_MOVED_LLA" ID="47">
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="lat" TYPE="int32" UNIT="degres"/>
        <field NAME="lon" TYPE="int32" UNIT="degres"/>
        <field NAME="alt" TYPE="int32" UNIT="cm"/>
      </message>
      <message NAME="WP_MOVED_LTP" ID="49">
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="x" TYPE="int32" UNIT="2^8m"/>
        <field NAME="y" TYPE="int32" UNIT="2^8m"/>
        <field NAME="z" TYPE="int32" UNIT="2^8m"/>
      </message>
      <message NAME="CHRONO" ID="48">
        <field NAME="tag" TYPE="uint8"/>
        <field NAME="time" TYPE="uint32" UNIT="us"/>
      </message>
      <message NAME="PPM" ID="100">
        <field NAME="ppm_rate" TYPE="uint8"/>
        <field NAME="values" TYPE="uint16[]" UNIT="ticks"/>
      </message>
      <message NAME="RC" ID="101">
        <field NAME="values" TYPE="int16[]" UNIT="pprz" FORMAT="%d"/>
      </message>
      <message NAME="COMMANDS" ID="102">
        <field NAME="values" TYPE="int16[]" UNIT="ticks"/>
      </message>
      <message NAME="FBW_STATUS" ID="103">
        <field NAME="rc_status" TYPE="uint8" VALUES="OK|LOST|REALLY_LOST"/>
        <field NAME="mode" TYPE="uint8" VALUES="MANUAL|AUTO|FAILSAFE"/>
        <field NAME="vsupply" TYPE="uint8" UNIT="decivolt"/>
      </message>
      <message NAME="ADC" ID="104">
        <field NAME="mcu" TYPE="uint8" VALUES="FBW|AP"/>
        <field NAME="values" TYPE="uint16[]" UNIT="none"/>
      </message>
      <message NAME="ACTUATORS" ID="105">
        <field NAME="values" TYPE="uint16[]" UNIT="none"/>
      </message>
      <message NAME="DC_SHOT" ID="110">
        <field NAME="utm_east" TYPE="int32" UNIT="cm"/>
        <field NAME="utm_north" TYPE="int32" UNIT="cm"/>
        <field NAME="utm_zone" TYPE="uint8"/>
        <field NAME="course" TYPE="int16" UNIT="decideg"/>
        <field NAME="z" TYPE="float" UNIT="m"/>
        <field NAME="phi" TYPE="int16" UNIT="deg"/>
        <field NAME="theta" TYPE="int16" UNIT="deg"/>
      </message>
      <message NAME="TCAS_TA" ID="120">
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message NAME="TCAS_RA" ID="121">
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message NAME="TCAS_DEBUG" ID="122">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="tau" TYPE="float"/>
      </message>
      <message NAME="IMU_GYRO" ID="200">
        <field NAME="gp" TYPE="float" ALT_UNIT="deg/s" UNIT="rad/s" ALT_UNIT_COEF="57.29578"/>
        <field NAME="gq" TYPE="float" ALT_UNIT="deg/s" UNIT="rad/s" ALT_UNIT_COEF="57.29578"/>
        <field NAME="gr" TYPE="float" ALT_UNIT="deg/s" UNIT="rad/s" ALT_UNIT_COEF="57.29578"/>
      </message>
      <message NAME="IMU_MAG" ID="201">
        <field NAME="mx" TYPE="float"/>
        <field NAME="my" TYPE="float"/>
        <field NAME="mz" TYPE="float"/>
      </message>
      <message NAME="IMU_ACCEL" ID="202">
        <field NAME="ax" TYPE="float" UNIT="m/s-2"/>
        <field NAME="ay" TYPE="float" UNIT="m/s-2"/>
        <field NAME="az" TYPE="float" UNIT="m/s-2"/>
      </message>
      <message NAME="IMU_GYRO_RAW" ID="203">
        <field NAME="gp" TYPE="uint16" UNIT="adc"/>
        <field NAME="gq" TYPE="uint16" UNIT="adc"/>
        <field NAME="gr" TYPE="uint16" UNIT="adc"/>
      </message>
      <message NAME="IMU_ACCEL_RAW" ID="204">
        <field NAME="ax" TYPE="uint16" UNIT="adc"/>
        <field NAME="ay" TYPE="uint16" UNIT="adc"/>
        <field NAME="az" TYPE="uint16" UNIT="adc"/>
      </message>
      <message NAME="IMU_MAG_RAW" ID="205">
        <field NAME="mx" TYPE="int16" UNIT="adc"/>
        <field NAME="my" TYPE="int16" UNIT="adc"/>
        <field NAME="mz" TYPE="int16" UNIT="adc"/>
      </message>
      <message NAME="IMU_GYRO_RAW_AVG" ID="206">
        <field NAME="gp" TYPE="uint16" UNIT="adc"/>
        <field NAME="gq" TYPE="uint16" UNIT="adc"/>
        <field NAME="gr" TYPE="uint16" UNIT="adc"/>
        <field NAME="vgp" TYPE="float" UNIT="adc" FORMAT="%.0f"/>
        <field NAME="vgq" TYPE="float" UNIT="adc" FORMAT="%.0f"/>
        <field NAME="vgr" TYPE="float" UNIT="adc" FORMAT="%.0f"/>
      </message>
      <message NAME="IMU_ACCEL_RAW_AVG" ID="207">
        <field NAME="ax" TYPE="uint16" UNIT="adc"/>
        <field NAME="ay" TYPE="uint16" UNIT="adc"/>
        <field NAME="az" TYPE="uint16" UNIT="adc"/>
        <field NAME="vax" TYPE="float" UNIT="adc"/>
        <field NAME="vay" TYPE="float" UNIT="adc"/>
        <field NAME="vaz" TYPE="float" UNIT="adc"/>
      </message>
      <message NAME="IMU_MAG_RAW_AVG" ID="208">
        <field NAME="mx" TYPE="int16" UNIT="adc"/>
        <field NAME="my" TYPE="int16" UNIT="adc"/>
        <field NAME="mz" TYPE="int16" UNIT="adc"/>
        <field NAME="vmx" TYPE="float" UNIT="adc"/>
        <field NAME="vmy" TYPE="float" UNIT="adc"/>
        <field NAME="vmz" TYPE="float" UNIT="adc"/>
      </message>
      <message NAME="IMU_GYRO_LP" ID="209">
        <field NAME="gp" TYPE="float" UNIT="rad/s"/>
        <field NAME="gq" TYPE="float" UNIT="rad/s"/>
        <field NAME="gr" TYPE="float" UNIT="rad/s"/>
      </message>
      <message NAME="IMU_PRESSURE" ID="210">
        <field NAME="p" TYPE="float" UNIT="pascal"/>
      </message>
      <message NAME="IMU_DEBUG" ID="211">
        <field NAME="max1167_status" TYPE="uint8"/>
        <field NAME="micromag_status" TYPE="uint8"/>
        <field NAME="imu_v3_sensors_micromag_timeout" TYPE="uint8"/>
        <field NAME="imu_v3_sensors_micromag_nb_reset" TYPE="uint8"/>
      </message>
      <message NAME="IMU_TURNTABLE" ID="220">
        <field NAME="omega" TYPE="float" ALT_UNIT="deg/s" UNIT="rad/s" ALT_UNIT_COEF="57.29578"/>
      </message>
      <message NAME="TIME" ID="227">
        <field NAME="t" TYPE="uint32"/>
      </message>
      <message NAME="QUAD_INS" ID="228">
        <field NAME="msg_id" TYPE="uint8"/>
        <field NAME="msg_len" TYPE="uint8"/>
        <field NAME="msg_status" TYPE="uint8"/>
        <field NAME="msg_time_stamp" TYPE="uint16"/>
      </message>
      <message NAME="QUAD_STATUS" ID="229">
        <field NAME="rc_status" TYPE="uint8" VALUES="OK|LOST|REALLY_LOST"/>
        <field NAME="ap_mode" TYPE="uint8" VALUES="FAILSAFE|KILL|RATE|ATTITUDE|NAV"/>
        <field NAME="vsupply" TYPE="uint8" UNIT="decivolt"/>
        <field NAME="cpu_time" TYPE="uint16" UNIT="s"/>
      </message>
      <message NAME="BOOZ_STATUS" ID="231">
        <field NAME="link_imu_nb_err" TYPE="uint32"/>
        <field NAME="blmc_nb_err" TYPE="uint8"/>
        <field NAME="rc_status" TYPE="uint8" VALUES="OK|LOST|REALLY_LOST"/>
        <field NAME="gps_status" TYPE="uint8" VALUES="NO_FIX|NA|NA|3Dfix"/>
        <field NAME="ap_mode" TYPE="uint8" VALUES="FAILSAFE|KILL|RATE_DIRECT|ATTITUDE_DIRECT|RATE_RC_CLIMB|ATTITUDE_RC_CLIMB|RATE_Z_HOLD|ATTITUDE_Z_HOLD|HOVER_DIRECT|HOVER_Z_HOLD|NAV"/>
        <field NAME="ap_in_flight" TYPE="uint8" VALUES="ON_GROUND|IN_FLIGHT"/>
        <field NAME="ap_motors_on" TYPE="uint8" VALUES="MOTORS_OFF|MOTORS_ON"/>
        <field NAME="ap_h_mode" TYPE="uint8" VALUES="KILL|RATE|ATTITUDE|HOVER|NAV"/>
        <field NAME="ap_v_mode" TYPE="uint8" VALUES="KILL|RC_DIRECT|RC_CLIMB|CLIMB|HOVER"/>
        <field NAME="vsupply" TYPE="uint8" UNIT="decivolt"/>
        <field NAME="cpu_time" TYPE="uint16" UNIT="s"/>
      </message>
      <message NAME="BOOZ_SIM_RPMS" ID="239">
        <field NAME="front" TYPE="float" UNIT="RPM"/>
        <field NAME="back" TYPE="float" UNIT="RPM"/>
        <field NAME="right" TYPE="float" UNIT="RPM"/>
        <field NAME="left" TYPE="float" UNIT="RPM"/>
      </message>
      <message NAME="BOOZ_SIM_SPEED_POS" ID="240">
        <field NAME="xd" TYPE="float" UNIT="m/s"/>
        <field NAME="yd" TYPE="float" UNIT="m/s"/>
        <field NAME="zd" TYPE="float" UNIT="m/s"/>
        <field NAME="x" TYPE="float" UNIT="m"/>
        <field NAME="y" TYPE="float" UNIT="m"/>
        <field NAME="z" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="BOOZ_SIM_RATE_ATTITUDE" ID="241">
        <field NAME="p" TYPE="float" UNIT="degres/s"/>
        <field NAME="q" TYPE="float" UNIT="degres/s"/>
        <field NAME="r" TYPE="float" UNIT="degres/s"/>
        <field NAME="phi" TYPE="float" UNIT="degres"/>
        <field NAME="theta" TYPE="float" UNIT="degres"/>
        <field NAME="psi" TYPE="float" UNIT="degres"/>
      </message>
      <message NAME="BOOZ_SIM_GYRO_BIAS" ID="242">
        <field NAME="bp" TYPE="float" UNIT="degres/s"/>
        <field NAME="bq" TYPE="float" UNIT="degres/s"/>
        <field NAME="br" TYPE="float" UNIT="degres/s"/>
      </message>
      <message NAME="BOOZ_SIM_RANGE_METER" ID="243">
        <field NAME="dist" TYPE="float" UNIT="adc"/>
      </message>
      <message NAME="BOOZ_SIM_WIND" ID="244">
        <field NAME="vx" TYPE="float" UNIT="m/s"/>
        <field NAME="vy" TYPE="float" UNIT="m/s"/>
        <field NAME="vz" TYPE="float" UNIT="m/s"/>
      </message>
      <message NAME="BOOZ_DEBUG_FOO" ID="245">
        <field NAME="ami_stat" TYPE="uint8"/>
      </message>
      <message NAME="BOOZ_MAX1167_ERR" ID="246">
        <field NAME="erno" TYPE="uint8"/>
      </message>
      <message NAME="BOOZ_ERROR" ID="247">
        <field NAME="module" TYPE="uint8"/>
        <field NAME="errno" TYPE="uint8"/>
      </message>
      <message NAME="BOOZ_SIM_ACCEL_LTP" ID="248">
        <field NAME="xdd" TYPE="float" UNIT="m/s2"/>
        <field NAME="ydd" TYPE="float" UNIT="m/s2"/>
        <field NAME="zdd" TYPE="float" UNIT="m/s2"/>
      </message>
      <message NAME="VF_UPDATE" ID="76">
        <field NAME="baro" TYPE="float" UNIT="m"/>
        <field NAME="range_meter" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="VF_PREDICT" ID="77">
        <field NAME="accel" TYPE="float" UNIT="m/s/s"/>
      </message>
      <message NAME="CROSS_TRACK_ERROR" ID="80">
        <field NAME="cross_track_error" TYPE="float" UNIT="m"/>
        <field NAME="cte_int" TYPE="float"/>
      </message>
      <message NAME="ESTIMATOR_COMP_FILTER" ID="81">
        <field NAME="gyro_hp_last_out" TYPE="float"/>
        <field NAME="gyro_int" TYPE="float"/>
        <field NAME="gps_lp_last_out" TYPE="float"/>
        <field NAME="ir_lp_last_out" TYPE="float"/>
      </message>
      <message NAME="FORMATION_SLOT_TM" ID="82">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="mode" TYPE="uint8"/>
        <field NAME="slot_east" TYPE="float" UNIT="m" FORMAT="%.1f"/>
        <field NAME="slot_north" TYPE="float" UNIT="m" FORMAT="%.1f"/>
        <field NAME="slot_alt" TYPE="float" UNIT="m" FORMAT="%.1f"/>
      </message>
      <message NAME="FORMATION_STATUS_TM" ID="83">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="leader_id" TYPE="uint8"/>
        <field NAME="status" TYPE="uint8"/>
      </message>
      <message NAME="WIND_INFO_RET" ID="87">
        <field NAME="east" TYPE="float" UNIT="m/s"/>
        <field NAME="north" TYPE="float" UNIT="m/s"/>
        <field NAME="airspeed" TYPE="float" UNIT="m/s"/>
      </message>
      <message NAME="SCP_STATUS" ID="88">
        <field NAME="press" TYPE="uint32"/>
        <field NAME="temp" TYPE="int16"/>
      </message>
      <message NAME="SHT_STATUS" ID="89">
        <field NAME="ihumid" TYPE="uint16"/>
        <field NAME="itemp" TYPE="uint16"/>
        <field NAME="humid" TYPE="float"/>
        <field NAME="temp" TYPE="float"/>
      </message>
      <message NAME="ENOSE_STATUS" ID="90">
        <field NAME="val1" TYPE="uint16"/>
        <field NAME="val2" TYPE="uint16"/>
        <field NAME="val3" TYPE="uint16"/>
        <field NAME="PID" TYPE="uint16"/>
        <field NAME="heat" TYPE="uint8[]"/>
      </message>
      <message NAME="DPICCO_STATUS" ID="91">
        <field NAME="humid" TYPE="uint16"/>
        <field NAME="temp" TYPE="uint16"/>
        <field NAME="fhumid" TYPE="float"/>
        <field NAME="ftemp" TYPE="float"/>
      </message>
      <message NAME="ANTENNA_DEBUG" ID="92">
        <field NAME="mag_xraw" TYPE="int32"/>
        <field NAME="mag_yraw" TYPE="int32"/>
        <field NAME="mag_xcal" TYPE="float"/>
        <field NAME="mag_ycal" TYPE="float"/>
        <field NAME="mag_heading" TYPE="float"/>
        <field NAME="mag_magnitude" TYPE="float"/>
        <field NAME="mag_temp" TYPE="float"/>
        <field NAME="mag_distor" TYPE="uint8"/>
        <field NAME="mag_cal_status" TYPE="uint8"/>
      </message>
      <message NAME="ANTENNA_STATUS" ID="93">
        <field NAME="azim_sp" TYPE="float"/>
        <field NAME="elev_sp" TYPE="float"/>
        <field NAME="id_sp" TYPE="uint8"/>
        <field NAME="mode" TYPE="uint8"/>
      </message>
      <message NAME="MOTOR_BENCH_STATUS" ID="94">
        <field NAME="time_ticks" TYPE="uint32"/>
        <field NAME="throttle" TYPE="float" FORMAT="%.3f"/>
        <field NAME="rpm" TYPE="float"/>
        <field NAME="current" TYPE="float"/>
        <field NAME="thrust" TYPE="float"/>
        <field NAME="torque" TYPE="float"/>
        <field NAME="time_s" TYPE="uint16"/>
        <field NAME="mode" TYPE="uint8"/>
      </message>
      <message NAME="MOTOR_BENCH_STATIC" ID="95">
        <field NAME="av_rpm" TYPE="float"/>
        <field NAME="av_thrust" TYPE="float"/>
        <field NAME="av_current" TYPE="float"/>
        <field NAME="throttle" TYPE="uint16"/>
      </message>
      <message NAME="BOOZ2_STABILIZATION" ID="130">
        <field NAME="pd_ref" TYPE="float"/>
        <field NAME="qd_ref" TYPE="float"/>
        <field NAME="rd_ref" TYPE="float"/>
        <field NAME="p_est" TYPE="float"/>
        <field NAME="p_ref" TYPE="float"/>
        <field NAME="q_est" TYPE="float"/>
        <field NAME="q_ref" TYPE="float"/>
        <field NAME="r_est" TYPE="float"/>
        <field NAME="r_ref" TYPE="float"/>
        <field NAME="phi_est" TYPE="float"/>
        <field NAME="phi_ref" TYPE="float"/>
        <field NAME="phi_sp" TYPE="float"/>
        <field NAME="theta_est" TYPE="float"/>
        <field NAME="theta_ref" TYPE="float"/>
        <field NAME="theta_sp" TYPE="float"/>
        <field NAME="psi_est" TYPE="float"/>
        <field NAME="psi_ref" TYPE="float"/>
        <field NAME="psi_sp" TYPE="float"/>
        <field NAME="cmd_a" TYPE="int32"/>
        <field NAME="cmd_e" TYPE="int32"/>
        <field NAME="cmd_r" TYPE="int32"/>
        <field NAME="cmd_t" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_GYRO" ID="131">
        <field NAME="gp" TYPE="int32" ALT_UNIT="deg/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="gq" TYPE="int32" ALT_UNIT="deg/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="gr" TYPE="int32" ALT_UNIT="deg/s" ALT_UNIT_COEF="0.0139882"/>
      </message>
      <message NAME="BOOZ2_ACCEL" ID="132">
        <field NAME="ax" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="ay" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="az" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
      </message>
      <message NAME="BOOZ2_MAG" ID="133">
        <field NAME="mx" TYPE="int32" ALT_UNIT="1" ALT_UNIT_COEF="0.0004883"/>
        <field NAME="my" TYPE="int32" ALT_UNIT="1" ALT_UNIT_COEF="0.0004883"/>
        <field NAME="mz" TYPE="int32" ALT_UNIT="1" ALT_UNIT_COEF="0.0004883"/>
      </message>
      <message NAME="BOOZ2_FILTER" ID="134">
        <field NAME="phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="measure_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="measure_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="measure_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="corrected_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="corrected_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="corrected_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000273"/>
        <field NAME="correction_phi" TYPE="int32"/>
        <field NAME="correction_theta" TYPE="int32"/>
        <field NAME="correction_psi" TYPE="int32"/>
        <field NAME="bp" TYPE="int32"/>
        <field NAME="bq" TYPE="int32"/>
        <field NAME="br" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FILTER2" ID="135">
        <field NAME="px" TYPE="int32"/>
        <field NAME="py" TYPE="int32"/>
        <field NAME="pz" TYPE="int32"/>
        <field NAME="gsx" TYPE="int32"/>
        <field NAME="gsy" TYPE="int32"/>
        <field NAME="gsz" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_RATE_LOOP" ID="136">
        <field NAME="gp" TYPE="int32"/>
        <field NAME="gq" TYPE="int32"/>
        <field NAME="gr" TYPE="int32"/>
        <field NAME="spp" TYPE="int32"/>
        <field NAME="spq" TYPE="int32"/>
        <field NAME="spr" TYPE="int32"/>
        <field NAME="delta_a" TYPE="int32"/>
        <field NAME="delta_e" TYPE="int32"/>
        <field NAME="delta_r" TYPE="int32"/>
        <field NAME="delta_t" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FILTER_ALIGNER" ID="137">
        <field NAME="lp_gp" TYPE="int32"/>
        <field NAME="lp_gq" TYPE="int32"/>
        <field NAME="lp_gr" TYPE="int32"/>
        <field NAME="gp" TYPE="int32"/>
        <field NAME="gq" TYPE="int32"/>
        <field NAME="gr" TYPE="int32"/>
        <field NAME="noise" TYPE="int32"/>
        <field NAME="cnt" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FILTER_Q" ID="138">
        <field NAME="qi" TYPE="int32"/>
        <field NAME="qx" TYPE="int32"/>
        <field NAME="qy" TYPE="int32"/>
        <field NAME="qz" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FILTER_COR" ID="139">
        <field NAME="mphi" TYPE="int32"/>
        <field NAME="mtheta" TYPE="int32"/>
        <field NAME="mpsi" TYPE="int32"/>
        <field NAME="qi" TYPE="int32"/>
        <field NAME="qx" TYPE="int32"/>
        <field NAME="qy" TYPE="int32"/>
        <field NAME="qz" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_STAB_ATTITUDE" ID="140">
        <field NAME="m_p" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_q" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_r" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="sp_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="sp_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="sp_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="sum_err_phi" TYPE="int32"/>
        <field NAME="sum_err_theta" TYPE="int32"/>
        <field NAME="sum_err_psi" TYPE="int32"/>
        <field NAME="delta_a" TYPE="int32"/>
        <field NAME="delta_e" TYPE="int32"/>
        <field NAME="delta_r" TYPE="int32"/>
        <field NAME="delta_t" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_STAB_ATTITUDE_REF" ID="141">
        <field NAME="pd" TYPE="int32" ALT_UNIT="degres/s2" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="qd" TYPE="int32" ALT_UNIT="degres/s2" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="rd" TYPE="int32" ALT_UNIT="degres/s2" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="p" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0008743"/>
        <field NAME="q" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0008743"/>
        <field NAME="r" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0008743"/>
        <field NAME="phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
      </message>
      <message NAME="BOOZ2_STAB_ATTITUDE_HS_ROLL" ID="142">
        <field NAME="phi_ref" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0000546"/>
        <field NAME="p_ref" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0008743"/>
        <field NAME="pd_ref" TYPE="int32" ALT_UNIT="degres/s2" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="m_p" TYPE="int32" ALT_UNIT="degres/s" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="sum_err_phi" TYPE="int32"/>
        <field NAME="delta_a" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_CMD" ID="143">
        <field NAME="cmd_roll" TYPE="int32"/>
        <field NAME="cmd_pitch" TYPE="int32"/>
        <field NAME="cmd_yaw" TYPE="int32"/>
        <field NAME="cmd_thrust" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_GUIDANCE" ID="144">
        <field NAME="pos_n" TYPE="int32"/>
        <field NAME="pos_e" TYPE="int32"/>
        <field NAME="sp_pos_n" TYPE="int32"/>
        <field NAME="sp_pos_e" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_VERT_LOOP" ID="145">
        <field NAME="z_sp" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="zd_sp" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="est_z" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="est_zd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="est_zdd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="ref_z" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="ref_zd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="ref_zdd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="adp_inv_m" TYPE="int32" ALT_UNIT="foo" ALT_UNIT_COEF="0.0000038"/>
        <field NAME="adp_cov" TYPE="int32" ALT_UNIT="foo" ALT_UNIT_COEF="0.0000038"/>
        <field NAME="adp_meas" TYPE="int32" ALT_UNIT="foo" ALT_UNIT_COEF="0.0000038"/>
        <field NAME="sum_err" TYPE="int32"/>
        <field NAME="ff_cmd" TYPE="int32"/>
        <field NAME="fb_cmd" TYPE="int32"/>
        <field NAME="delta_t" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_HOVER_LOOP" ID="146">
        <field NAME="sp_x" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="sp_y" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="est_x" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="est_y" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="est_xd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="est_yd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="err_x" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="err_y" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="err_xd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="err_yd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="err_sum_x" TYPE="int32"/>
        <field NAME="err_sum_y" TYPE="int32"/>
        <field NAME="cmd_x" TYPE="int32"/>
        <field NAME="cmd_y" TYPE="int32"/>
        <field NAME="cmd_phi" TYPE="int32"/>
        <field NAME="cmd_theta" TYPE="int32"/>
        <field NAME="cmd_psi" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FP" ID="147">
        <field NAME="east" TYPE="int32"/>
        <field NAME="north" TYPE="int32"/>
        <field NAME="up" TYPE="int32"/>
        <field NAME="veast" TYPE="int32"/>
        <field NAME="vnorth" TYPE="int32"/>
        <field NAME="vup" TYPE="int32"/>
        <field NAME="phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="carrot_east" TYPE="int32"/>
        <field NAME="carrot_north" TYPE="int32"/>
        <field NAME="carrot_up" TYPE="int32"/>
        <field NAME="carrot_psi" TYPE="int32"/>
        <field NAME="thrust" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_FMS_INFO" ID="148">
        <field NAME="tbd" TYPE="float"/>
      </message>
      <message NAME="BOOZ2_NAV_REF" ID="149">
        <field NAME="x" TYPE="int32" UNIT="cm"/>
        <field NAME="y" TYPE="int32" UNIT="cm"/>
        <field NAME="z" TYPE="int32" UNIT="cm"/>
      </message>
      <message NAME="BOOZ2_TUNE_HOVER" ID="150">
        <field NAME="rc_roll" TYPE="int16" ALT_UNIT="-100/100" ALT_UNIT_COEF="0.01041670"/>
        <field NAME="rc_pitch" TYPE="int16" ALT_UNIT="-100/100" ALT_UNIT_COEF="0.01041670"/>
        <field NAME="rc_yaw" TYPE="int16" ALT_UNIT="-100/100" ALT_UNIT_COEF="0.01041670"/>
        <field NAME="cmd_roll" TYPE="int32"/>
        <field NAME="cmd_pitch" TYPE="int32"/>
        <field NAME="cmd_yaw" TYPE="int32"/>
        <field NAME="cmd_thrust" TYPE="int32"/>
        <field NAME="imu_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="imu_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="imu_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
      </message>
      <message NAME="BOOZ2_INS" ID="151">
        <field NAME="baro_alt" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="ins_z" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039063"/>
        <field NAME="ins_zd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019"/>
        <field NAME="ins_zdd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
      </message>
      <message NAME="BOOZ2_INS2" ID="152">
        <field NAME="xdd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="ydd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="zdd" TYPE="int32" ALT_UNIT="m/s2" ALT_UNIT_COEF="0.0009766"/>
        <field NAME="xd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
        <field NAME="yd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
        <field NAME="zd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
        <field NAME="x" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039"/>
        <field NAME="y" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039"/>
        <field NAME="z" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.0039"/>
      </message>
      <message NAME="BOOZ2_INS3" ID="153">
        <field NAME="gps_x_ned" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.00390625"/>
        <field NAME="gps_y_ned" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.00390625"/>
        <field NAME="gps_z_ned" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.00390625"/>
        <field NAME="gps_xd_ned" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
        <field NAME="gps_yd_ned" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
        <field NAME="gps_zd_ned" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.0000019073"/>
      </message>
      <message NAME="BOOZ2_INS_REF" ID="154">
        <field NAME="lpt_ecef_x0" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="lpt_ecef_y0" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="lpt_ecef_z0" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="lpt_lat0" TYPE="int32" ALT_UNIT="deg" ALT_UNIT_COEF="0.0000001"/>
        <field NAME="lpt_lon0" TYPE="int32" ALT_UNIT="deg" ALT_UNIT_COEF="0.0000001"/>
        <field NAME="lpt_alt0" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="baro_qfe" TYPE="int32"/>
      </message>
      <message NAME="BOOZ2_GPS" ID="155">
        <field NAME="ecef_x" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="ecef_y" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="ecef_z" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="ecef_xd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.01"/>
        <field NAME="ecef_yd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.01"/>
        <field NAME="ecef_zd" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.01"/>
        <field NAME="pacc" TYPE="int32" ALT_UNIT="m" ALT_UNIT_COEF="0.01"/>
        <field NAME="sacc" TYPE="int32" ALT_UNIT="m/s" ALT_UNIT_COEF="0.01"/>
        <field NAME="pdop" TYPE="uint16"/>
        <field NAME="numsv" TYPE="uint8"/>
        <field NAME="fix" TYPE="uint8"/>
      </message>
      <message NAME="BOOZ2_AHRS_EULER" ID="156">
        <field NAME="imu_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="imu_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="imu_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_phi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_theta" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
        <field NAME="body_psi" TYPE="int32" ALT_UNIT="degres" ALT_UNIT_COEF="0.0139882"/>
      </message>
      <message NAME="BOOZ2_AHRS_QUAT" ID="157">
        <field NAME="imu_qi" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="imu_qx" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="imu_qy" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="imu_qz" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="body_qi" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="body_qx" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="body_qy" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
        <field NAME="body_qz" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000305"/>
      </message>
      <message NAME="BOOZ2_AHRS_RMAT" ID="158">
        <field NAME="imu_m00" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m01" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m02" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m10" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m11" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m12" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m20" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m21" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="imu_m22" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m00" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m01" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m02" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m10" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m11" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m12" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m20" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m21" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
        <field NAME="body_m22" TYPE="int32" ALT_UNIT="" ALT_UNIT_COEF="0.0000610"/>
      </message>
      <message NAME="BOOZ2_NAV_STATUS" ID="159">
        <field NAME="block_time" TYPE="uint16" UNIT="s"/>
        <field NAME="stage_time" TYPE="uint16" UNIT="s"/>
        <field NAME="cur_block" TYPE="uint8"/>
        <field NAME="cur_stage" TYPE="uint8"/>
        <field NAME="horizontal_mode" TYPE="uint8"/>
      </message>
      <message NAME="AHRS_EULER" ID="160">
        <field NAME="phi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
        <field NAME="theta" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
        <field NAME="psi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
      </message>
      <message NAME="AHRS_MEASUREMENT_EULER" ID="161">
        <field NAME="phi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
        <field NAME="theta" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
        <field NAME="psi" TYPE="float" ALT_UNIT="deg" UNIT="rad" ALT_UNIT_COEF="57.29578"/>
      </message>
      <message NAME="WT" ID="175">
        <field NAME="rpm" TYPE="float"/>
      </message>
      <message NAME="CSC_CAN_DEBUG" ID="176">
        <field NAME="err_nb" TYPE="uint32"/>
        <field NAME="err_code" TYPE="uint32"/>
      </message>
      <message NAME="CSC_CAN_MSG" ID="177">
        <field NAME="frame" TYPE="uint32"/>
        <field NAME="id" TYPE="uint32"/>
        <field NAME="data_a" TYPE="uint32"/>
        <field NAME="data_b" TYPE="uint32"/>
      </message>
      <message NAME="FMS_TIME" ID="180">
        <field NAME="tv_sec" TYPE="uint32"/>
        <field NAME="tv_nsec" TYPE="uint32"/>
        <field NAME="delay_ns" TYPE="uint32"/>
      </message>
      <message NAME="WHIRLY_CONTROL" ID="181">
        <field NAME="whirly_timestamp" TYPE="float"/>
        <field NAME="sp_pitch_1" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="meas_pitch_1" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="sp_pitch_2" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="meas_pitch_2" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="ele_1" TYPE="int16"/>
        <field NAME="ele_2" TYPE="int16"/>
        <field NAME="flap_1" TYPE="int16"/>
        <field NAME="flap_2" TYPE="int16"/>
        <field NAME="xsens1_seq" TYPE="uint16"/>
        <field NAME="xsens2_seq" TYPE="uint16"/>
        <field NAME="csc1_loops" TYPE="uint32"/>
        <field NAME="csc1_msgs" TYPE="uint32"/>
        <field NAME="csc2_loops" TYPE="uint32"/>
        <field NAME="csc2_msgs" TYPE="uint32"/>
      </message>
      <message NAME="WHIRLY_ESTIMATOR" ID="182">
        <field NAME="whirly_timestamp" TYPE="float"/>
        <field NAME="phi_1" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="theta_1" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="psi_1" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="phi_2" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="theta_2" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="psi_2" TYPE="float" ALT_UNIT="deg" ALT_UNIT_COEF="57.29578"/>
        <field NAME="euler_1_error_nb" TYPE="uint32"/>
        <field NAME="euler_2_error_nb" TYPE="uint32"/>
        <field NAME="psi_mag_1_error_nb" TYPE="uint32"/>
        <field NAME="psi_mag_2_error_nb" TYPE="uint32"/>
        <field NAME="gyro1x_lp" TYPE="float"/>
        <field NAME="gyro1y_lp" TYPE="float"/>
        <field NAME="gyro1z_lp" TYPE="float"/>
      </message>
      <message NAME="WHIRLY_MOTORCONTROL" ID="183">
        <field NAME="rpm1" TYPE="uint16"/>
        <field NAME="rpm2" TYPE="uint16"/>
        <field NAME="fault1" TYPE="uint16"/>
        <field NAME="fault2" TYPE="uint16"/>
      </message>
      <message NAME="WHIRLY_ERRORCOUNTER" ID="184">
        <field NAME="xsens1_error_ck" TYPE="uint32"/>
        <field NAME="xsens2_error_ck" TYPE="uint32"/>
        <field NAME="xsens1_error_mid" TYPE="uint32"/>
        <field NAME="xsens2_error_mid" TYPE="uint32"/>
        <field NAME="xsens1_error_seq" TYPE="uint32"/>
        <field NAME="xsens2_error_seq" TYPE="uint32"/>
      </message>
      <message NAME="WHIRLY_IMU" ID="185">
        <field NAME="whirly_timestamp" TYPE="float"/>
        <field NAME="p1_gyro_p" TYPE="float"/>
        <field NAME="p1_gyro_r" TYPE="float"/>
        <field NAME="p1_gyro_y" TYPE="float"/>
        <field NAME="p1_accel_x" TYPE="float"/>
        <field NAME="p1_accel_y" TYPE="float"/>
        <field NAME="p1_accel_z" TYPE="float"/>
        <field NAME="p1_mag_x" TYPE="float"/>
        <field NAME="p1_mag_y" TYPE="float"/>
        <field NAME="p1_mag_z" TYPE="float"/>
        <field NAME="p2_gyro_p" TYPE="float"/>
        <field NAME="p2_gyro_r" TYPE="float"/>
        <field NAME="p2_gyro_y" TYPE="float"/>
        <field NAME="p2_accel_x" TYPE="float"/>
        <field NAME="p2_accel_y" TYPE="float"/>
        <field NAME="p2_accel_z" TYPE="float"/>
        <field NAME="p2_mag_x" TYPE="float"/>
        <field NAME="p2_mag_y" TYPE="float"/>
        <field NAME="p2_mag_z" TYPE="float"/>
      </message>
      <message NAME="WHIRLY_IMU_RAW" ID="186">
        <field NAME="whirly_timestamp" TYPE="float"/>
        <field NAME="p1_gyro_p_raw" TYPE="uint16"/>
        <field NAME="p1_gyro_r_raw" TYPE="uint16"/>
        <field NAME="p1_gyro_y_raw" TYPE="uint16"/>
        <field NAME="p1_accel_x_raw" TYPE="uint16"/>
        <field NAME="p1_accel_y_raw" TYPE="uint16"/>
        <field NAME="p1_accel_z_raw" TYPE="uint16"/>
        <field NAME="p1_mag_x_raw" TYPE="uint16"/>
        <field NAME="p1_mag_y_raw" TYPE="uint16"/>
        <field NAME="p1_mag_z_raw" TYPE="uint16"/>
        <field NAME="p2_gyro_p_raw" TYPE="uint16"/>
        <field NAME="p2_gyro_r_raw" TYPE="uint16"/>
        <field NAME="p2_gyro_y_raw" TYPE="uint16"/>
        <field NAME="p2_accel_x_raw" TYPE="uint16"/>
        <field NAME="p2_accel_y_raw" TYPE="uint16"/>
        <field NAME="p2_accel_z_raw" TYPE="uint16"/>
        <field NAME="p2_mag_x_raw" TYPE="uint16"/>
        <field NAME="p2_mag_y_raw" TYPE="uint16"/>
        <field NAME="p2_mag_z_raw" TYPE="uint16"/>
      </message>
    </class>
    <class NAME="datalink">
      <message LINK="broadcasted" NAME="ACINFO" ID="1">
        <field NAME="course" TYPE="int16" UNIT="decideg"/>
        <field NAME="utm_east" TYPE="int32" UNIT="cm"/>
        <field NAME="utm_north" TYPE="int32" UNIT="cm"/>
        <field NAME="alt" TYPE="int32" UNIT="cm"/>
        <field NAME="itow" TYPE="uint32" UNIT="ms"/>
        <field NAME="speed" TYPE="uint16" UNIT="cm/s"/>
        <field NAME="climb" TYPE="int16" UNIT="cm/s"/>
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message LINK="forwarded" NAME="MOVE_WP" ID="2">
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="lat" TYPE="int32" UNIT="e-7deg"/>
        <field NAME="lon" TYPE="int32" UNIT="e-7deg"/>
        <field NAME="alt" TYPE="int32" UNIT="cm"/>
      </message>
      <message LINK="forwarded" NAME="WIND_INFO" ID="3">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="pad0" TYPE="uint8"/>
        <field NAME="east" TYPE="float" UNIT="m/s"/>
        <field NAME="north" TYPE="float" UNIT="m/s"/>
        <field NAME="airspeed" TYPE="float" UNIT="m/s"/>
      </message>
      <message LINK="forwarded" NAME="SETTING" ID="4">
        <field NAME="index" TYPE="uint8"/>
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="value" TYPE="float"/>
      </message>
      <message LINK="forwarded" NAME="BLOCK" ID="5">
        <field NAME="block_id" TYPE="uint8"/>
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message LINK="forwarded" NAME="HITL_UBX" ID="6">
        <field NAME="class" TYPE="uint8"/>
        <field NAME="id" TYPE="uint8"/>
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="ubx_payload" TYPE="uint8[]"/>
      </message>
      <message LINK="forwarded" NAME="HITL_INFRARED" ID="7">
        <field NAME="roll" TYPE="int16"/>
        <field NAME="pitch" TYPE="int16"/>
        <field NAME="top" TYPE="int16"/>
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message NAME="PING" ID="8"/>
      <message LINK="broadcasted" NAME="FORMATION_SLOT" ID="9">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="mode" TYPE="uint8"/>
        <field NAME="slot_east" TYPE="float" UNIT="m" FORMAT="%.1f"/>
        <field NAME="slot_north" TYPE="float" UNIT="m" FORMAT="%.1f"/>
        <field NAME="slot_alt" TYPE="float" UNIT="m" FORMAT="%.1f"/>
      </message>
      <message LINK="broadcasted" NAME="FORMATION_STATUS" ID="10">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="leader_id" TYPE="uint8"/>
        <field NAME="status" TYPE="uint8"/>
      </message>
      <message LINK="forwarded" NAME="JOYSTICK_RAW" ID="11">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="roll" TYPE="int8"/>
        <field NAME="pitch" TYPE="int8"/>
        <field NAME="throttle" TYPE="int8"/>
      </message>
      <message LINK="forwarded" NAME="COMMANDS_RAW" ID="12">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="commands" TYPE="int8[]"/>
      </message>
      <message LINK="forwarded" NAME="DGPS_RAW" ID="13">
        <field NAME="ac_id" TYPE="uint8"/>
        <field NAME="length" TYPE="uint8"/>
        <field NAME="rtcm" TYPE="uint8[]"/>
      </message>
      <message LINK="forwarded" NAME="BOOZ2_FMS_COMMAND" ID="149">
        <field NAME="h_mode" TYPE="uint8" VALUES="RATE|ATTITUDE|SPEED|POS"/>
        <field NAME="v_mode" TYPE="uint8" VALUES="DIRECT|CLIMB|HEIGHT"/>
        <field NAME="v_sp" TYPE="int32"/>
        <field NAME="h_sp_1" TYPE="int32"/>
        <field NAME="h_sp_2" TYPE="int32"/>
        <field NAME="h_sp_3" TYPE="int32"/>
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message NAME="SET_ACTUATOR" ID="100">
        <field NAME="value" TYPE="uint16"/>
        <field NAME="no" TYPE="uint8"/>
        <field NAME="ac_id" TYPE="uint8"/>
      </message>
      <message NAME="CSC_SERVO_CMD" ID="101">
        <field NAME="servo_1" TYPE="uint16"/>
        <field NAME="servo_2" TYPE="uint16"/>
        <field NAME="servo_3" TYPE="uint16"/>
        <field NAME="servo_4" TYPE="uint16"/>
      </message>
    </class>
    <class NAME="ground">
      <message NAME="NEW_AIRCRAFT" ID="1">
        <field NAME="ac_id" TYPE="string"/>
      </message>
      <message NAME="AIRCRAFT_DIE" ID="2">
        <field NAME="ac_id" TYPE="string"/>
      </message>
      <message NAME="AIRCRAFTS" ID="3">
        <field NAME="ac_list" TYPE="string" FORMAT="csv"/>
      </message>
      <message NAME="AIRCRAFTS_REQ" ID="4"/>
      <message NAME="SELECTED" ID="5">
        <field NAME="aircraft_id" TYPE="string"/>
      </message>
      <message NAME="SELECTED_REQ" ID="6"/>
      <message NAME="WIND_CLEAR" ID="7">
        <field NAME="ac_id" TYPE="string"/>
      </message>
      <message NAME="WIND" ID="8">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="dir" TYPE="float" UNIT="deg_wind"/>
        <field NAME="wspeed" TYPE="float" UNIT="m/s"/>
        <field NAME="mean_aspeed" TYPE="float" UNIT="m/s"/>
        <field NAME="stddev" TYPE="float" UNIT="m/s"/>
      </message>
      <message NAME="CONFIG_REQ" ID="9">
        <field NAME="ac_id" TYPE="string"/>
      </message>
      <message NAME="CONFIG" ID="10">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="flight_plan" TYPE="string" UNIT="url"/>
        <field NAME="airframe" TYPE="string" UNIT="url"/>
        <field NAME="radio" TYPE="string" UNIT="url"/>
        <field NAME="settings" TYPE="string" UNIT="url"/>
        <field NAME="default_gui_color" TYPE="string"/>
        <field NAME="ac_name" TYPE="string"/>
      </message>
      <message NAME="FLIGHT_PARAM" ID="11">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="roll" TYPE="float" UNIT="deg"/>
        <field NAME="pitch" TYPE="float" UNIT="deg"/>
        <field NAME="heading" TYPE="float" UNIT="deg"/>
        <field NAME="lat" TYPE="float" UNIT="deg"/>
        <field NAME="long" TYPE="float" UNIT="deg"/>
        <field NAME="speed" TYPE="float" UNIT="m/s"/>
        <field NAME="course" TYPE="float" UNIT="deg" FORMAT="%.1f"/>
        <field NAME="alt" TYPE="float" UNIT="m"/>
        <field NAME="climb" TYPE="float" UNIT="m/s"/>
        <field NAME="agl" TYPE="float" UNIT="m"/>
        <field NAME="unix_time" TYPE="float" UNIT="s (Unix time)"/>
        <field NAME="itow" TYPE="uint32" UNIT="ms"/>
      </message>
      <message NAME="AP_STATUS" ID="12">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="ap_mode" TYPE="string" VALUES="MANUAL|AUTO1|AUTO2|HOME|FAILSAFE"/>
        <field NAME="lat_mode" TYPE="string" VALUES="MANUAL|ROLL_RATE|ROLL|COURSE"/>
        <field NAME="horiz_mode" TYPE="string" VALUES="WAYPOINT|ROUTE|CIRCLE"/>
        <field NAME="gaz_mode" TYPE="string" VALUES="MANUAL|THROTTLE|CLIMB|ALT"/>
        <field NAME="gps_mode" TYPE="string" VALUES="NOFIX|DRO|2D|3D|GPSDRO"/>
        <field NAME="kill_mode" TYPE="string" VALUES="OFF|ON"/>
        <field NAME="flight_time" TYPE="uint32"/>
      </message>
      <message NAME="NAV_STATUS" ID="13">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="cur_block" TYPE="uint8"/>
        <field NAME="cur_stage" TYPE="uint8"/>
        <field NAME="block_time" TYPE="uint32"/>
        <field NAME="stage_time" TYPE="uint32"/>
        <field NAME="target_lat" TYPE="float" UNIT="deg"/>
        <field NAME="target_long" TYPE="float" UNIT="deg"/>
        <field NAME="target_climb" TYPE="float" UNIT="m/s"/>
        <field NAME="target_alt" TYPE="float" UNIT="m"/>
        <field NAME="target_course" TYPE="float" UNIT="deg"/>
        <field NAME="dist_to_wp" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="CAM_STATUS" ID="14">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="cam_lat" TYPE="float" UNIT="deg"/>
        <field NAME="cam_long" TYPE="float" UNIT="deg"/>
        <field NAME="cam_target_lat" TYPE="float" UNIT="deg"/>
        <field NAME="cam_target_long" TYPE="float" UNIT="deg"/>
      </message>
      <message NAME="ENGINE_STATUS" ID="15">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="throttle" TYPE="float" UNIT="%" FORMAT="%.1f"/>
        <field NAME="throttle_accu" TYPE="float" FORMAT="%.1f"/>
        <field NAME="rpm" TYPE="float" UNIT="rpm" FORMAT="%.1f"/>
        <field NAME="temp" TYPE="float" UNIT="celcius"/>
        <field NAME="bat" TYPE="float" UNIT="V"/>
        <field NAME="amp" TYPE="float" UNIT="A"/>
        <field NAME="energy" TYPE="uint16" UNIT="Wh"/>
      </message>
      <message NAME="SVSINFO" ID="16">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="pacc" TYPE="uint16" UNIT="cm"/>
        <field NAME="svid" TYPE="string" FORMAT="csv"/>
        <field NAME="flags" TYPE="string" FORMAT="csv"/>
        <field NAME="qi" TYPE="string" FORMAT="csv" VALUES="IDLE|SEARCH|SEARCH|UNUSABLE|CODELOCK|CARRIERLOCK|CARRIERLOCK|RECEIVING"/>
        <field NAME="cno" TYPE="string" UNIT="dbHz" FORMAT="csv"/>
        <field NAME="elev" TYPE="string" UNIT="deg" FORMAT="csv"/>
        <field NAME="azim" TYPE="string" UNIT="deg" FORMAT="csv"/>
        <field NAME="msg_age" TYPE="string" UNIT="s" FORMAT="csv"/>
      </message>
      <message NAME="FLY_BY_WIRE" ID="17">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="rc_status" TYPE="string" VALUES="OK|LOST|REALLY_LOST"/>
        <field NAME="rc_mode" TYPE="string" VALUES="MANUAL|AUTO|FAILSAFE"/>
      </message>
      <message NAME="INFLIGH_CALIB" ID="19">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="if_mode" TYPE="string" VALUES="OFF|DOWN|UP"/>
        <field NAME="if_value1" TYPE="float"/>
        <field NAME="if_value2" TYPE="float"/>
      </message>
      <message NAME="WORLD_ENV" ID="20">
        <field NAME="wind_east" TYPE="float" UNIT="m/s" FORMAT="%.1f"/>
        <field NAME="wind_north" TYPE="float" UNIT="m/s" FORMAT="%.1f"/>
        <field NAME="ir_contrast" TYPE="float"/>
        <field NAME="time_scale" TYPE="float"/>
        <field NAME="gps_availability" TYPE="uint8" VALUES="OFF|ON"/>
      </message>
      <message NAME="WORLD_ENV_REQ" ID="21"/>
      <message NAME="CIRCLE_STATUS" ID="22">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="circle_lat" TYPE="float" UNIT="deg"/>
        <field NAME="circle_long" TYPE="float" UNIT="deg"/>
        <field NAME="radius" TYPE="int16" UNIT="m"/>
      </message>
      <message NAME="SEGMENT_STATUS" ID="23">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="segment1_lat" TYPE="float" UNIT="deg"/>
        <field NAME="segment1_long" TYPE="float" UNIT="deg"/>
        <field NAME="segment2_lat" TYPE="float" UNIT="deg"/>
        <field NAME="segment2_long" TYPE="float" UNIT="deg"/>
      </message>
      <message NAME="MOVE_WAYPOINT" ID="24">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="lat" TYPE="float" UNIT="deg"/>
        <field NAME="long" TYPE="float" UNIT="deg"/>
        <field NAME="alt" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="DL_SETTING" ID="26">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="index" TYPE="uint8"/>
        <field NAME="value" TYPE="float"/>
      </message>
      <message NAME="JUMP_TO_BLOCK" ID="27">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="block_id" TYPE="uint8"/>
      </message>
      <message NAME="DL_VALUES" ID="28">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="values" TYPE="string" FORMAT="csv"/>
      </message>
      <message NAME="RAW_DATALINK" ID="29">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="message" TYPE="string" FORMAT=";sv"/>
      </message>
      <message NAME="WAYPOINT_MOVED" ID="30">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="wp_id" TYPE="uint8"/>
        <field NAME="lat" TYPE="float" UNIT="deg"/>
        <field NAME="long" TYPE="float" UNIT="deg"/>
        <field NAME="alt" TYPE="float" UNIT="m"/>
      </message>
      <message NAME="SURVEY_STATUS" ID="31">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="east_long" TYPE="float" UNIT="deg"/>
        <field NAME="north_lat" TYPE="float" UNIT="deg"/>
        <field NAME="west_long" TYPE="float" UNIT="deg"/>
        <field NAME="south_lat" TYPE="float" UNIT="deg"/>
      </message>
      <message NAME="TELEMETRY_STATUS" ID="32">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="time_since_last_msg" TYPE="float" UNIT="s"/>
      </message>
      <message NAME="TELEMETRY_ERROR" ID="33">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="message" TYPE="string"/>
      </message>
      <message NAME="PLUMES" ID="100">
        <field NAME="ids" TYPE="string" FORMAT="csv"/>
        <field NAME="lats" TYPE="string" FORMAT="csv"/>
        <field NAME="longs" TYPE="string" FORMAT="csv"/>
        <field NAME="values" TYPE="string" FORMAT="csv"/>
      </message>
    </class>
    <class NAME="alert">
      <message NAME="BAT_LOW" ID="1">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="level" TYPE="string" VALUES="CATASTROPHIC|CRITIC|WARNING"/>
        <field NAME="value" TYPE="float"/>
      </message>
      <message NAME="AIR_PROX" ID="2">
        <field NAME="ac_id" TYPE="string"/>
        <field NAME="level" TYPE="string" VALUES="CATASTROPHIC|CRITIC|WARNING"/>
      </message>
    </class>
    <class NAME="DIA">
      <message NAME="NAV_INFO" ID="1">
        <field NAME="unix_time" TYPE="float"/>
        <field NAME="lat" TYPE="float" UNIT="deg"/>
        <field NAME="long" TYPE="float" UNIT="deg"/>
        <field NAME="alt" TYPE="uint16" UNIT="m"/>
        <field NAME="course" TYPE="uint16" UNIT="deg"/>
        <field NAME="speed" TYPE="uint16" UNIT="cm/s"/>
        <field NAME="cam_roll" TYPE="int16" UNIT="deg"/>
        <field NAME="cam_pitch" TYPE="int16" UNIT="deg"/>
      </message>
    </class>
  </protocol>
</configuration>
