New bungee launch function added

This commit is contained in:
OSAM-UAV Team
2008-12-04 21:48:12 +00:00
parent e2a59d60c3
commit a213f57be7
2 changed files with 18 additions and 4 deletions
+6 -3
View File
@@ -17,14 +17,14 @@
<!ELEMENT exceptions (exception*)> <!ELEMENT exceptions (exception*)>
<!ELEMENT blocks (block+)> <!ELEMENT blocks (block+)>
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval|home)*> <!ELEMENT block (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|bungeetakeoff|for|return|eight|oval|home)*>
<!ELEMENT include (arg|with)*> <!ELEMENT include (arg|with)*>
<!ELEMENT arg EMPTY> <!ELEMENT arg EMPTY>
<!ELEMENT with EMPTY> <!ELEMENT with EMPTY>
<!ELEMENT while (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval)*> <!ELEMENT while (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|bungeetakeoff|for|return|eight|oval)*>
<!ELEMENT for (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval)*> <!ELEMENT for (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|bungeetakeoff|for|return|eight|oval)*>
<!ELEMENT exception EMPTY> <!ELEMENT exception EMPTY>
<!ELEMENT heading EMPTY> <!ELEMENT heading EMPTY>
<!ELEMENT attitude EMPTY> <!ELEMENT attitude EMPTY>
@@ -37,6 +37,7 @@
<!ELEMENT eight EMPTY> <!ELEMENT eight EMPTY>
<!ELEMENT oval EMPTY> <!ELEMENT oval EMPTY>
<!ELEMENT survey_rectangle EMPTY> <!ELEMENT survey_rectangle EMPTY>
<!ELEMENT bungeetakeoff EMPTY>
<!ELEMENT deroute EMPTY> <!ELEMENT deroute EMPTY>
<!ELEMENT stay EMPTY> <!ELEMENT stay EMPTY>
<!ELEMENT follow EMPTY> <!ELEMENT follow EMPTY>
@@ -174,6 +175,8 @@ orientation CDATA #IMPLIED
wp1 CDATA #REQUIRED wp1 CDATA #REQUIRED
wp2 CDATA #REQUIRED> wp2 CDATA #REQUIRED>
<!ATTLIST bungeetakeoff
BungeeWP CDATA #REQUIRED>
<!ATTLIST stay <!ATTLIST stay
wp CDATA #REQUIRED wp CDATA #REQUIRED
+12 -1
View File
@@ -232,7 +232,7 @@ let rec index_stage = fun x ->
| "heading" | "attitude" | "go" | "stay" | "xyz" | "set" | "circle" -> | "heading" | "attitude" | "go" | "stay" | "xyz" | "set" | "circle" ->
incr stage; incr stage;
Xml.Element (Xml.tag x, Xml.attribs x@["no", soi !stage], Xml.children x) Xml.Element (Xml.tag x, Xml.attribs x@["no", soi !stage], Xml.children x)
| "survey_rectangle" | "eight" | "oval"-> | "bungeetakeoff"| "survey_rectangle" | "eight" | "oval"->
incr stage; incr stage; incr stage; incr stage;
Xml.Element (Xml.tag x, Xml.attribs x@["no", soi !stage], Xml.children x) Xml.Element (Xml.tag x, Xml.attribs x@["no", soi !stage], Xml.children x)
| "exception" -> | "exception" ->
@@ -440,6 +440,17 @@ let rec print_stage = fun index_of_waypoints x ->
stage (); stage ();
lprintf "NavSurveyRectangle(%s, %s);\n" wp1 wp2; lprintf "NavSurveyRectangle(%s, %s);\n" wp1 wp2;
lprintf "break;\n" lprintf "break;\n"
| "bungeetakeoff" ->
let bwp = get_index_waypoint (ExtXml.attrib x "BungeeWP") index_of_waypoints in
stage ();
lprintf "if (! (InitializeBungeeTakeoff(%s)))\n" bwp;
lprintf " NextStageAndBreak();\n";
lprintf "break;\n";
left ();
stage ();
lprintf "if (! (BungeeTakeoff()))\n";
lprintf " NextStageAndBreak();\n";
lprintf "break;\n"
| _s -> failwith "Unreachable" | _s -> failwith "Unreachable"
end; end;
left () left ()