<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">

<flight_plan alt="100" ground_alt="0" lat0="38.9159" lon0="-95.3207" max_dist_from_home="1500" name="KalScott" security_height="25">
  <header>
</header>
  <waypoints>
    <waypoint name="HOME" x="0" y="0"/>
    <waypoint name="CIRCLE" x="0" y="5"/>
    <waypoint name="1" x="-100" y="105"/>
    <waypoint name="2" x="100" y="105"/>
    <waypoint name="3" x="100" y="-95"/>
    <waypoint name="CLIMB" x="0" y="100"/>
  </waypoints>
  <exceptions/>
  <blocks>
    <block name="Wait GPS">
      <set value="1" var="autopilot.kill_throttle"/>
      <while cond="!GpsFixValid()"/>
    </block>
    <block name="Geo init">
      <while cond="LessThan(NavBlockTime(), 10)"/>
      <call_once fun="NavSetGroundReferenceHere()"/>
    </block>
    <block name="Holding point">
      <set value="1" var="autopilot.kill_throttle"/>
      <attitude roll="0" throttle="0" vmode="throttle"/>
    </block>
    <block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
      <exception cond="GetPosAlt() > GetAltRef()+25" deroute="Circle"/>
      <set value="0" var="autopilot.kill_throttle"/>
      <set value="0" var="autopilot.flight_time"/>
      <go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
    </block>
    <block name="Circle" strip_button="Circle" strip_icon="home.png">
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="NavCircleCount() > 2"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="NavCircleCount() > 2"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+400" until="NavCircleCount() > 2"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="NavCircleCount() > 2"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="GetAltRef()+205 > GetPosAlt()"/>
      <circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="NavCircleCount() > 2"/>
      <deroute block="Circle"/>
    </block>
   <block name="Racetrack E-W" strip_button="Racetrack E-W" strip_icon="oval.png">
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+400" until="nav_oval_count > 2"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="GetAltRef()+205 > GetPosAlt()"/>
      <oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
      <deroute block="Racetrack E-W"/>
    </block>
    <block name="Racetrack N-S" strip_button="Racetrack N-S" strip_icon="oval.png">
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+400" until="nav_oval_count > 2"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="GetAltRef()+305 > GetPosAlt()"/>
      <oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
      <deroute block="Racetrack N-S"/>
    </block>
  </blocks>
</flight_plan>
