Files
paparazzi/conf/flight_plans/versatile.xml
T
Gautier Hattenberger 363dec8693 Autopilot refactor (#2009)
* [autopilot] refactor autopilot API for both firmwares

With this, fixedwing and rotorcraft are mostly using the same interface
for the autopilot. Some specific code and messages handling are still
firmware dependent.
A large part of the autopilot logic of the fixedwing is moved from
main_ap to autopilot_static.
More getter/setter functions are provided.

* [autopilot] update the rest of the system and the conf

for using the refactored autopilot API

* [autopilot] fix some errors from CI servers

* [actuators] use dummy actuators module to prevent autoloading

* Rename Bart_heliDD_INDI.xml to tudelft_bs_helidd_indi.xml

* Rename Bart_heliDD_pid.xml to tudelft_bs_helidd_pid.xml

* Delete tudelft_course2016_bebop_colorfilter.xml

* Delete tudelft_course2016_bebop_avoider.xml

* [actuators] don't autoload actuators when set to 'none'

* [gcs] autodetect firmware for strip mode button
2017-02-19 11:45:57 +01:00

189 lines
7.9 KiB
XML

<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">
<flight_plan alt="260" ground_alt="185" lat0="43.4622" lon0="1.2729" max_dist_from_home="1500" name="Versatile" qfu="270" security_height="25" home_mode_height="50">
<header>
#include "subsystems/datalink/datalink.h"
</header>
<waypoints>
<waypoint name="HOME" x="0" y="0"/>
<waypoint name="STDBY" x="20" y="80"/>
<waypoint name="1" x="44.8" y="102.2"/>
<waypoint name="2" x="-63.5" y="122.9"/>
<waypoint name="MOB" x="-11.5" y="-21.2"/>
<waypoint name="S1" x="-151.6" y="80.4"/>
<waypoint name="S2" x="180.1" y="214.9"/>
<waypoint alt="215.0" name="AF" x="200" y="-10"/>
<waypoint alt="185.0" name="TD" x="80.0" y="20.0"/>
<waypoint name="BASELEG" x="26.9" y="-23.0"/>
<waypoint name="_1" x="-100" y="0"/>
<waypoint name="_2" x="-100" y="200"/>
<waypoint name="_3" x="100" y="200"/>
<waypoint name="_4" x="100" y="0"/>
<waypoint name="CLIMB" x="-122.5" y="35.4"/>
</waypoints>
<sectors>
<sector name="Square">
<corner name="_1"/>
<corner name="_2"/>
<corner name="_3"/>
<corner name="_4"/>
</sector>
</sectors>
<variables>
<variable var="roll_step" init="15." min="0." max="50." step="1.0"/>
</variables>
<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()"/>
<!--call_once fun="NavSetAltitudeReferenceHere()"/-->
</block>
<block name="Holding point">
<set value="1" var="autopilot.kill_throttle"/>
<attitude roll="0" throttle="0" vmode="throttle"/>
</block>
<block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff (wp CLIMB)">
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
<set value="0" var="autopilot.kill_throttle"/>
<go wp="CLIMB"/>
</block>
<block name="Standby" strip_button="Standby" strip_icon="home.png">
<circle radius="nav_radius" wp="STDBY"/>
</block>
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png" group="extra_pattern">
<call_once fun="nav_line_setup()"/>
<call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
</block>
<block name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png">
<eight center="1" radius="nav_radius" turn_around="2"/>
</block>
<block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png">
<oval p1="1" p2="2" radius="nav_radius"/>
</block>
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png">
<call_once fun="NavSetWaypointHere(WP_MOB)"/>
<circle radius="100" wp="MOB"/>
</block>
<block name="Auto pitch (circle wp 1)">
<circle pitch="auto" radius="75" throttle="0.7" wp="1"/>
</block>
<block name="Climb 75% throttle">
<circle pitch="10" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="throttle" wp="1"/>
</block>
<block name="Climb 0m/s">
<circle climb="0" radius="nav_radius" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
</block>
<block name="Climb 1m/s">
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-GetAltRef())/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
</block>
<block name="Climb nav_climb m/s">
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="climb" wp="1"/>
</block>
<block name="Circle 0% throttle">
<circle pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="GetAltRef()+50 > GetPosAlt()" vmode="throttle" wp="1"/>
<deroute block="Standby"/>
</block>
<block name="Oval 0% throttle">
<oval p1="1" p2="2" pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="GetAltRef()+50 > GetPosAlt()" vmode="throttle"/>
<deroute block="Standby"/>
</block>
<block name="Route 1-2">
<go approaching_time="0" from="1" hmode="route" wp="2"/>
</block>
<block name="Stack wp 2">
<circle radius="75" wp="2"/>
</block>
<block name="Route 2-1">
<go approaching_time="0" from="2" hmode="route" wp="1"/>
</block>
<block name="Stack wp 1">
<circle radius="75" wp="1"/>
</block>
<block name="Glide 1-2">
<go from="1" hmode="route" vmode="glide" wp="2"/>
<deroute block="Standby"/>
</block>
<block name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png">
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
</block>
<block name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png">
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
<deroute block="land"/>
</block>
<block name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png">
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
<deroute block="land"/>
</block>
<block name="land">
<call_once fun="nav_compute_baseleg(WP_AF, WP_TD, WP_BASELEG, nav_radius)"/>
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="BASELEG"/>
<set value="V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 10 > fabs(GetPosAlt() - WaypointAlt(WP_BASELEG))" wp="BASELEG"/>
</block>
<block name="final">
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
</block>
<block name="flare">
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
</block>
<block name="Steps roll -10, +10">
<while cond="TRUE">
<attitude alt="250" roll="10.0" until=" stage_time > 6" vmode="alt"/>
<attitude alt="250" roll="-10.0" until="stage_time > 6" vmode="alt"/>
</while>
</block>
<block name="Steps roll -20, +20">
<while cond="TRUE">
<attitude alt="250" roll="20.0" until=" stage_time > 3" vmode="alt"/>
<attitude alt="250" roll="-20.0" until="stage_time > 3" vmode="alt"/>
</while>
</block>
<block name="Steps roll from var">
<while cond="TRUE">
<attitude alt="250" roll="roll_step" until=" stage_time > 3" vmode="alt"/>
<attitude alt="250" roll="-roll_step" until="stage_time > 3" vmode="alt"/>
</while>
</block>
<block name="Steps pitch -10, +10">
<while cond="TRUE">
<attitude alt="250" pitch="10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
<attitude alt="250" pitch="-10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
</while>
</block>
<block name="Heading 30">
<heading alt="GetAltRef()+50" course="30" until="FALSE"/>
</block>
<block name="For loop (circles wp 1)">
<for from="0" to="3" var="i">
<circle radius="DEFAULT_CIRCLE_RADIUS+ $i*10" wp="1" until="NavCircleCount() > 1"/>
</for>
<deroute block="Standby"/>
</block>
<block name="Test datalink (go to wp 2)">
<exception cond="datalink_time > 22" deroute="Standby"/>
<go from="STDBY" hmode="route" wp="2"/>
<go from="2" hmode="route" wp="STDBY"/>
</block>
<block name="Fly in Square">
<exception cond="! InsideSquare(GetPosX(), GetPosY())" deroute="Come back wp 1"/>
<attitude alt="GetAltRef()+75" roll="0" vmode="alt"/>
</block>
<block name="Come back wp 1">
<exception cond="InsideSquare(GetPosX(), GetPosY())" deroute="Fly in Square"/>
<go wp="1"/>
<deroute block="Fly in Square"/>
</block>
</blocks>
</flight_plan>