Thanks Pascal
Makes sense why it wasn't working then. I'll ditch that idea for now.
Is there a way of including xml's in a flight plan? I don't actually
need the arguments and the position etc for the routines i want add so
just including an XML is what i was after
Todd
------------------------------------------------------------------------
*From:* Pascal Brisset <address@hidden>
*To:* address@hidden
*Sent:* Thursday, 27 August, 2009 2:24:12 AM
*Subject:* Re: [Paparazzi-devel] Procedures
Hi Todd,
this feature has not been updated and tested ... for years. Some remarks:
- you file should start with
<!DOCTYPE procedure SYSTEM "flight_plan.dtd">
- <header> is currently not allowed (according to the dtd) in a procedure
- the alt attribute of a waypoint must be a constant number.
Anyway, it won't work :-(
Currently, when a procedure is included, all the waypoints name of the
procedure are prefixed with the name of the procedure by the
preprocessing tool. So in your case, if I include your file with
<include name="drop" procedure="proc_drop.xml" x="-100" y="150"
rotate="0">
<arg name="alt" value="ground_alt+100"/>
</include>
the TARGET waypoint would be renamed into drop.TARGET. This renaming
is needed if you want to include several times the same procedure (
with different arguments). But, you are referencing directly the
waypoint name from some C code (NavSetWaypointHere(WP_TARGET)) and the
procedure preprocessor is not able to look at this C code (to replace
WP_TARGET by WP_drop_TARGET).
So ... I don't know.
This preprocessor was written at a time when few C code was included
in flight plans. Now it is common, and there is no way to preprocess
it. A solution here would be to restrict procedure includes to one
single instance and get rid of the waypoint prefixing.
It probably requires deeper thinking
--Pascal
Todd Sandercock wrote:
> Hi all
> i am just looking for some feedback on anyone that has got any
procedures to work properly. I have been working on some routines for
payload dropping and i wanted to put them in a procedure so that i
could use the same code over many flight plans. I am not sure how
limited procedures are but this is what i have written
>
> Thanks for any help
> Todd
>
> <procedure>
> <header>
> #include "datalink.h"
> #include "bomb.h"
> </header>
> <param name="alt" default_value="ground_alt+50"/>
> <param name="radius" default_value="75"/>
> <waypoints>
> <waypoint alt="alt" name="TARGET" x="0" y="0"/>
> <waypoint alt="alt" name="START" x="0" y="-100"/>
> <waypoint name="RELEASE" x="0" y="-50"/>
> <waypoint name="BLEG" x="100" y="-100"/>
> <waypoint alt="alt+50" name="BCLIMB" x="0" y="100"/>
> <waypoint alt="alt+50" name="BFEIGHT" x="100" y="0"/>
> </waypoints>
> <blocks>
> <block name="bombloiter" strip_button="B Loiter">
> <call fun="NavSetWaypointHere(WP_TARGET)"/>
> <eight center="WP_TARGET" radius="radius" turn_around="WP_BEIGHT"/>
> </block>
> <block name="bombhere" strip_button="B Here">
> <call fun="NavSetWaypointHere(WP_TARGET)"/>
> </block>
> <block name="bomb" strip_button="Bomb">
> <!--<set value="WaypointX(WP_TARGET)" var="WaypointX(WP_START)"/>
> <set value="WaypointY(WP_TARGET) - 100" var="WaypointY(WP_START)"/>
> <set value="WaypointX(WP_TARGET)" var="WaypointX(WP_CLIMB)"/>
> <set value="WaypointY(WP_TARGET) + 100" var="WaypointY(WP_CLIMB)"/>
> <set value="BombComputeApproach(WP_TARGET, WP_START,
nav_radius)" var="unit"/>-->
> <circle radius="nav_radius"
until="NavQdrCloseTo(DegOfRad(bomb_start_qdr)-10)" wp="BLEG"/>
> </block>
> <block name="align">
> <exception cond="BombUpdateRelease(WP_TARGET)" deroute="end"/>
> <go approaching_time="bomb_trigger_delay" from="START"
hmode="route" wp="RELEASE"/>
> </block>
> <block name="shoot">
> <set value="BombShoot()" var="unit"/>
> <go from="RELEASE" hmode="route" wp="BCLIMB"/>
> <set value="BombCloseHatch()" var="unit"/>
> <deroute block="end"/>
> </block>
> <block name="close">
> <set value="BombCloseHatch()" var="unit"/>
> <deroute block="end"/>
> </block>
> </blocks>
> </procedure>
>
> ------------------------------------------------------------------------
> Find local businesses and services in your area with Yahoo!7 Local.
Get started
<%20http://au.rd.yahoo.com/search/local/mailtagline/*http://local.yahoo.com.au>.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Paparazzi-devel mailing list
> address@hidden <mailto:address@hidden>
> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>
_______________________________________________
Paparazzi-devel mailing list
address@hidden <mailto:address@hidden>
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
------------------------------------------------------------------------
Find local businesses and services in your area with Yahoo!7 Local.
Get started
<%20http://au.rd.yahoo.com/search/local/mailtagline/*http://local.yahoo.com.au>.
------------------------------------------------------------------------
_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel