<!-- this is the biplan equiped with  Lisa/L#XXX, aspirin IMU and asctec V2 controllers -->

<airframe name="booz2_a8">

  <servos>
    <servo name="FRONT"   no="0" min="0" neutral="0" max="255"/>
    <servo name="BACK"    no="1" min="0" neutral="0" max="255"/>
    <servo name="LEFT"    no="2" min="0" neutral="0" max="255"/>
    <servo name="RIGHT"   no="3" min="0" neutral="0" max="255"/>
  </servos>

  <commands>
    <axis name="PITCH"  failsafe_value="0"/>
    <axis name="ROLL"   failsafe_value="0"/>
    <axis name="YAW"    failsafe_value="0"/>
    <axis name="THRUST" failsafe_value="0"/>
  </commands>


  <section name="SUPERVISION" prefix="SUPERVISION_">
    <define name="MIN_MOTOR" value="3"/>
    <define name="MAX_MOTOR" value="200"/>
    <define name="TRIM_A" value="0"/>
    <define name="TRIM_E" value="0"/>
    <define name="TRIM_R" value="0"/>
    <define name="NB_MOTOR" value="4"/>
    <define name="SCALE" value="256"/>
    <define name="ROLL_COEF"   value="{  0  ,    0,  256, -256 }"/>
    <define name="PITCH_COEF"  value="{  256, -256,    0,    0 }"/>
    <define name="YAW_COEF"    value="{  256,  256, -256, -256 }"/>
    <define name="THRUST_COEF" value="{  256,  256,  256,  256 }"/>
  </section>

  <!-- this is my crista -->
 <!--
 <section name="IMU" prefix="IMU_">

    <define name="GYRO_P_SIGN" value="-1"/>
    <define name="GYRO_Q_SIGN" value="-1"/>
    <define name="GYRO_R_SIGN" value=" 1"/>

    <define name="GYRO_P_NEUTRAL" value="31288"/>
    <define name="GYRO_Q_NEUTRAL" value="32593"/>
    <define name="GYRO_R_NEUTRAL" value="32709"/>

    <define name="GYRO_P_SENS" value=" 0.943560" integer="16"/>
    <define name="GYRO_Q_SENS" value=" 0.926199" integer="16"/>
    <define name="GYRO_R_SENS" value=" 0.931912" integer="16"/>


    <define name="ACCEL_X_SIGN" value="1"/>
    <define name="ACCEL_Y_SIGN" value="1"/>
    <define name="ACCEL_Z_SIGN" value="1"/>

    <define name="ACCEL_X_NEUTRAL" value="32857"/>
    <define name="ACCEL_Y_NEUTRAL" value="32429"/>
    <define name="ACCEL_Z_NEUTRAL" value="32593"/>

    <define name="ACCEL_X_SENS" value="-2.58273701242" integer="16"/>
    <define name="ACCEL_Y_SENS" value="-2.54076215332" integer="16"/>
    <define name="ACCEL_Z_SENS" value="-2.57633620646" integer="16"/>


    <define name="MAG_X_SIGN" value="-43"/>
    <define name="MAG_Y_SIGN" value=" 49"/>
    <define name="MAG_Z_SIGN" value="-66"/>

    <define name="MAG_X_NEUTRAL" value="-43"/>
    <define name="MAG_Y_NEUTRAL" value=" 49"/>
    <define name="MAG_Z_NEUTRAL" value="-66"/>

    <define name="MAG_X_SENS" value=" 5.32718104135" integer="16"/>
    <define name="MAG_Y_SENS" value="-4.87857821202" integer="16"/>
    <define name="MAG_Z_SENS" value="-3.11986612709" integer="16"/>


    <define name="BODY_TO_IMU_PHI"   value="0." unit="deg"/>
    <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
    <define name="BODY_TO_IMU_PSI"   value="45." unit="deg"/>

    <define name="GYRO_P_CHAN" value="0"/>
    <define name="GYRO_Q_CHAN" value="4"/>
    <define name="GYRO_R_CHAN" value="1"/>
    <define name="ACCEL_X_CHAN" value="5"/>
    <define name="ACCEL_Y_CHAN" value="2"/>
    <define name="ACCEL_Z_CHAN" value="6"/>

  </section>
-->


<!-- booz2

  <section name="IMU" prefix="IMU_">

    <define name="GYRO_P_NEUTRAL" value="31948"/>
    <define name="GYRO_Q_NEUTRAL" value="31834"/>
    <define name="GYRO_R_NEUTRAL" value="32687"/>

    <define name="GYRO_P_SENS" value=" 1.101357422" integer="16"/>
    <define name="GYRO_Q_SENS" value=" 1.122670898" integer="16"/>
    <define name="GYRO_R_SENS" value=" 1.104890137" integer="16"/>


    <define name="ACCEL_X_SENS" value=" 2.58273701242" integer="16"/>
    <define name="ACCEL_Y_SENS" value=" 2.54076215332" integer="16"/>
    <define name="ACCEL_Z_SENS" value=" 2.57633620646" integer="16"/>

    <define name="ACCEL_X_NEUTRAL" value="32857"/>
    <define name="ACCEL_Y_NEUTRAL" value="32429"/>
    <define name="ACCEL_Z_NEUTRAL" value="32593"/>

    <define name="MAG_X_SENS" value=" 5.32718104135" integer="16"/>
    <define name="MAG_Y_SENS" value=" 4.87857821202" integer="16"/>
    <define name="MAG_Z_SENS" value=" 3.11986612709" integer="16"/>

    <define name="MAG_X_NEUTRAL" value="-43"/>
    <define name="MAG_Y_NEUTRAL" value=" 49"/>
    <define name="MAG_Z_NEUTRAL" value="-66"/>

    <define name="BODY_TO_IMU_PHI"   value="0." unit="deg"/>
    <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
    <define name="BODY_TO_IMU_PSI"   value="45." unit="deg"/>

  </section>
-->

<!-- aspirin -->
 <section name="IMU" prefix="IMU_">

    <define name="GYRO_P_SIGN" value="-1"/>
    <define name="GYRO_Q_SIGN" value="-1"/>
    <define name="GYRO_R_SIGN" value=" 1"/>

    <define name="GYRO_P_NEUTRAL" value="186"/>
    <define name="GYRO_Q_NEUTRAL" value="-21"/>
    <define name="GYRO_R_NEUTRAL" value="25"/>

    <define name="GYRO_P_SENS" value=" 5." integer="16"/>
    <define name="GYRO_Q_SENS" value=" 5." integer="16"/>
    <define name="GYRO_R_SENS" value=" 5." integer="16"/>


    <define name="ACCEL_X_SIGN" value="1"/>
    <define name="ACCEL_Y_SIGN" value="1"/>
    <define name="ACCEL_Z_SIGN" value="1"/>

    <define name="ACCEL_X_NEUTRAL" value="32857"/>
    <define name="ACCEL_Y_NEUTRAL" value="32429"/>
    <define name="ACCEL_Z_NEUTRAL" value="32593"/>

    <define name="ACCEL_X_SENS" value="-2.58273701242" integer="16"/>
    <define name="ACCEL_Y_SENS" value="-2.54076215332" integer="16"/>
    <define name="ACCEL_Z_SENS" value="-2.57633620646" integer="16"/>


    <define name="MAG_X_SIGN" value="1"/>
    <define name="MAG_Y_SIGN" value="1"/>
    <define name="MAG_Z_SIGN" value="1"/>

    <define name="MAG_X_NEUTRAL" value="-43"/>
    <define name="MAG_Y_NEUTRAL" value=" 49"/>
    <define name="MAG_Z_NEUTRAL" value="-66"/>

    <define name="MAG_X_SENS" value=" 5.32718104135" integer="16"/>
    <define name="MAG_Y_SENS" value="-4.87857821202" integer="16"/>
    <define name="MAG_Z_SENS" value="-3.11986612709" integer="16"/>


    <define name="BODY_TO_IMU_PHI"   value="0." unit="deg"/>
    <define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
    <define name="BODY_TO_IMU_PSI"   value="45." unit="deg"/>

    <define name="GYRO_P_CHAN" value="0"/>
    <define name="GYRO_Q_CHAN" value="4"/>
    <define name="GYRO_R_CHAN" value="1"/>
    <define name="ACCEL_X_CHAN" value="5"/>
    <define name="ACCEL_Y_CHAN" value="2"/>
    <define name="ACCEL_Z_CHAN" value="6"/>

  </section>


 <section name="BAT">
   <define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
 </section>


  <firmware name="lisa_passthrough">

    <target name="stm_passthrough"        board="lisa_l_1.0"		processor="stm32" >
    </target>
    <subsystem name="radio_control" type="spektrum">
      <configure name="RADIO_CONTROL_SPEKTRUM_MODEL"
             value="\\\"subsystems/radio_control/spektrum_dx7se.h\\\""/>
    </subsystem>
    <subsystem name="imu" type="b2_v1.1"/>


    <target name="overo_test_passthrough" board="lisa_l_1.0" 		processor="omap" >
      <configure name="HOST"          value="A7"/>
      <configure name="USER"          value=""/>
      <configure name="TARGET_DIR"    value="~"/>
      <configure name="PERIODIC_FREQ" value="512"/>
    </target>

  </firmware>

  <firmware name="lisa_test_progs">
    <target name="test_telemetry" board="lisa_l_1.0">
      <configure name="MODEM_PORT" value="UART2"/>
    </target>
    <target name="test_baro"      board="lisa_l_1.0"/>
    <target name="test_spektrum"  board="lisa_l_1.0"/>
  </firmware>

</airframe>
