-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
rotorcraft_survey_mission.xml
116 lines (111 loc) · 4.5 KB
/
rotorcraft_survey_mission.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE procedure SYSTEM "../flight_plan.dtd">
<procedure>
<header>
#include "autopilot.h"
#include "subsystems/electrical.h"
#define LINE_START_FUNCTION dc_Survey(dc_distance_interval);
#define LINE_STOP_FUNCTION {dc_autoshoot = DC_AUTOSHOOT_STOP;}
</header>
<exceptions>
<exception cond="electrical.bat_low && (exception_flag[0] == 0)" deroute="Standby" exec="check_exception_flag(0)"/>
<exception cond="electrical.bat_critical && (exception_flag[1] == 0)" deroute="land_here" exec="check_exception_flag(1)"/>
</exceptions>
<blocks>
<block name="Wait GPS">
<call fun="NavKillThrottle()"/>
<while cond="!GpsFixValid()"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 10)"/>
<call fun="NavSetGroundReferenceHere()"/>
</block>
<block name="holding_point">
<call fun="NavKillThrottle()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block name="Start Engine">
<call fun="NavResurrect()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<exception cond="stateGetPositionEnu_f()->z > 2.0" deroute="Standby"/>
<call fun="NavSetWaypointHere(WP_CLIMB)"/>
<stay climb="nav_climb_vspeed" vmode="climb" wp="CLIMB"/>
</block>
<block name="Standby" strip_button="Standby" strip_icon="home.png">
<stay wp="STDBY"/>
</block>
<block name="LookRobot" strip_button="LookRobot" strip_icon="home.png">
<stay wp="FC"/>
</block>
<block name="visualflare">
<exception cond="NavDetectGround()" deroute="holding_point"/>
<exception cond="!nav_is_in_flight()" deroute="landed"/>
<call fun="NavStartDetectGround()"/>
<stay climb="nav_descend_vspeed" vmode="climb" wp="CAM"/>
</block>
<block name="stay_p1">
<stay wp="p1"/>
</block>
<block name="go_p2">
<go wp="p2"/>
<deroute block="stay_p1"/>
</block>
<block name="line_p1_p2">
<go from="p1" hmode="route" wp="p2"/>
<stay until="stage_time>10" wp="p2"/>
<go from="p2" hmode="route" wp="p1"/>
<deroute block="stay_p1"/>
</block>
<block name="race">
<go from="p1" hmode="route" wp="p2"/>
<go from="p2" hmode="route" wp="p3"/>
<go from="p3" hmode="route" wp="p4"/>
<go from="p4" hmode="route" wp="p1"/>
<deroute block="race"/>
</block>
<block name="raceline">
<go from="raceA" hmode="route" wp="raceB"/>
<go from="raceB" hmode="route" wp="raceA"/>
<deroute block="raceline"/>
</block>
<block group="extra_pattern" name="Survey S1-S2 NS" strip_button="Svy-NS" strip_icon="survey.png">
<call fun="nav_survey_rectangle_rotorcraft_setup(WP_S1, WP_S2, sweep, NS)"/>
<deroute block="Survey RECTANGLE RUN"/>
</block>
<block group="extra_pattern" name="Survey S1-S2 EW" strip_button="Svy-LO" strip_icon="survey_we.png">
<call fun="nav_survey_rectangle_rotorcraft_setup(WP_S1, WP_S2, sweep, WE)"/>
<deroute block="Survey RECTANGLE RUN"/>
</block>
<block group="extra_pattern" name="Survey RECTANGLE RUN" strip_button="Svy CONT">
<exception cond="rectangle_survey_sweep_num >= 1" deroute="Standby"/>
<call fun="nav_survey_rectangle_rotorcraft_run(WP_S1, WP_S2)"/>
</block>
<block group="extra_pattern" name="Survey Poly" strip_button="Svy-P">
<call fun="nav_survey_poly_setup_towards(WP_S1, 4, sweep, WP_S4)"/>
<deroute block="Survey Poly RUN"/>
</block>
<block group="extra_pattern" name="Survey Poly RUN" strip_button="Svy-P CONT">
<exception cond="PolySurveySweepNum >= 10" deroute="Standby"/>
<call fun="nav_survey_poly_run()"/>
</block>
<block name="circle CV" pre_call="nav_set_heading_towards_waypoint(WP_CAM)">
<circle radius="nav_radius" wp="CAM"/>
</block>
<block name="land_here" strip_button="Land Here" strip_icon="land-right.png">
<call fun="NavSetWaypointHere(WP_TD)"/>
</block>
<block name="land">
<go wp="TD"/>
</block>
<block name="flare">
<exception cond="NavDetectGround()" deroute="holding_point"/>
<exception cond="!nav_is_in_flight()" deroute="landed"/>
<call fun="NavStartDetectGround()"/>
<stay climb="nav_descend_vspeed" vmode="climb" wp="TD"/>
</block>
<block name="landed">
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
</blocks>
</procedure>