<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">

<flight_plan alt="450" ground_alt="400" lat0="43.4624" lon0="1.2727" max_dist_from_home="1000" name="Generic" qfu="270" security_height="25">
  <waypoints>
    <waypoint name="HOME" x="0" y="0"/>
    <waypoint name="1" x="200" y="0"/>
    <waypoint name="2" x="0" y="200"/>
    <waypoint name="S1" x="-200" y="-200"/>
    <waypoint name="S2" x="300" y="400"/>
  </waypoints>
  <blocks>
	  <block name="Wait GPS">
		  <set value="1" var="kill_throttle"/>
		  <while cond="!GpsFixValid()"/>
	  </block>
	  <block name="Geo init">
		  <while cond="LessThan(NavBlockTime(), 10)"/>
		  <call fun="NavSetGroundReferenceHere()"/>
    </block>
    <block name="circlehome">
      <circle radius="75" wp="HOME"/>
    </block>
    <block name="circle left home">
      <circle radius="-75" wp="HOME"/>
    </block>
    <block name="climb 75">
      <circle radius="50+(estimator_z-ground_alt)/2" wp="1" throttle="0.75" pitch="15" vmode="throttle" until="10>PowerVoltage()"/>
    </block>
    <block name="stack 1">
      <circle radius="estimator_z/2" wp="1"/>
    </block>
    <block name="descent 0" strip_button="Descent">
      <circle radius="estimator_z/2" wp="1" throttle="0.0" pitch="-15" vmode="throttle"/>
    </block>
    <block name="route12">
      <go approaching_time="0" from="1" hmode="route" wp="2"/>
      <deroute block="stack 2"/>
    </block>
    <block name="route21">
      <go approaching_time="0" from="2" hmode="route" wp="1"/>
      <deroute block="stack 1"/>
    </block>
    <block name="stack 2">
      <circle radius="75" wp="2"/>
    </block>
    <block name="survey">
      <survey_rectangle grid="150" wp1="S1" wp2="S2"/>
    </block>
  </blocks>
</flight_plan>
