http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&user=HectoPascal&feedformat=atomPaparazziUAV - User contributions [en]2024-03-28T12:13:16ZUser contributionsMediaWiki 1.37.1http://wiki.paparazziuav.org/w/index.php?title=GCS&diff=6403GCS2010-04-21T07:49:01Z<p>HectoPascal: /* Video Plugin */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The height Above Ground Level (AGL) displays the ground altitude of the mouse near the geographic position in the top right hand corner. The [http://srtm.usgs.gov/ SRTM] option must be enabled in the ''Nav'' menu. The height information comes from SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) and must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/]. For example: http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N47E016.hgt.zip is for 47 deg North latitude and 16 deg East longitude.<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame or from the menu.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video -layout appropriate_layout.xml</tt><br />
Note that a <tt>plugin</tt> widget must be specified in the used layout:<br />
<tt> <widget size="300" name="plugin"/></tt><br />
<br />
The <tt>-plugin</tt> option is another way to use the plugin widget: the X subwindow id is given to the provided command:<br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "mplayer video_stream -wid " -layout appropriate_layout.xml</tt><br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "cvlc video_stream --drawable-xid=" -layout appropriate_layout.xml</tt><br />
The <tt>--vout-event=3</tt> option can be used for vlc to disable mouse and keyboard events handling<br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a string of text. Clicking on it allows the user to change its type (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can be moved by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used later by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
===Video===<br />
A video stream can be rendered in a <tt>video_plugin</tt> papget, using the mplayer player:<br />
<papget type="video_plugin" display="mplayer" x="300" y="250"><br />
<property name="video_feed" value="my video source"/><br />
<property name="width" VALUE="320"/><br />
<property name="height" VALUE="240"/><br />
</papget><br />
or any video player which takes in option the X window id :<br />
<papget type="video_plugin" display="plugin" x="300" y="250"><br />
<property name="command" value="cvlc video_source --drawable-xid="/><br />
<property NAME="width" VALUE="320"/><br />
<property NAME="height" VALUE="240"/><br />
</papget><br />
<br />
===Development===<br />
Graphical appearence of papgets is defined in <tt>sw/lib/ocaml/papget_renderer.ml</tt>. A renderer must implement the Papget_renderer.t class type interface (<tt>canvas_text</tt> is probably the simpler example) and listed in the <tt>renderers</tt> list to be available<br />
in the edit popup box.<br />
<br />
The XML configuration is parsed in <tt>sw/ground_segment/cockpit/papgets.ml</tt>: a new created papget identifier must listed here.<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=6401GCS2010-04-19T13:30:32Z<p>HectoPascal: /* Video */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The height Above Ground Level (AGL) displays the ground altitude of the mouse near the geographic position in the top right hand corner. The [http://srtm.usgs.gov/ SRTM] option must be enabled in the ''Nav'' menu. The height information comes from SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) and must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/]. For example: http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N47E016.hgt.zip is for 47 deg North latitude and 16 deg East longitude.<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame or from the menu.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video -layout appropriate_layout.xml</tt><br />
Note that a <tt>plugin</tt> widget must be specified in the used layout:<br />
<tt> <widget size="300" name="plugin"/></tt><br />
<br />
The <tt>-plugin</tt> option is another way to use the plugin widget: the X subwindow id is given to the provided command:<br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "mplayer video_stream -wid " -layout appropriate_layout.xml</tt><br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "cvlc video_stream --drawable-xid=" -layout appropriate_layout.xml</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a string of text. Clicking on it allows the user to change its type (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can be moved by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used later by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
===Video===<br />
A video stream can be rendered in a <tt>video_plugin</tt> papget, using the mplayer player:<br />
<papget type="video_plugin" display="mplayer" x="300" y="250"><br />
<property name="video_feed" value="my video source"/><br />
<property name="width" VALUE="320"/><br />
<property name="height" VALUE="240"/><br />
</papget><br />
or any video player which takes in option the X window id :<br />
<papget type="video_plugin" display="plugin" x="300" y="250"><br />
<property name="command" value="cvlc video_source --drawable-xid="/><br />
<property NAME="width" VALUE="320"/><br />
<property NAME="height" VALUE="240"/><br />
</papget><br />
<br />
===Development===<br />
Graphical appearence of papgets is defined in <tt>sw/lib/ocaml/papget_renderer.ml</tt>. A renderer must implement the Papget_renderer.t class type interface (<tt>canvas_text</tt> is probably the simpler example) and listed in the <tt>renderers</tt> list to be available<br />
in the edit popup box.<br />
<br />
The XML configuration is parsed in <tt>sw/ground_segment/cockpit/papgets.ml</tt>: a new created papget identifier must listed here.<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=6400GCS2010-04-19T13:29:46Z<p>HectoPascal: </p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The height Above Ground Level (AGL) displays the ground altitude of the mouse near the geographic position in the top right hand corner. The [http://srtm.usgs.gov/ SRTM] option must be enabled in the ''Nav'' menu. The height information comes from SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) and must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/]. For example: http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N47E016.hgt.zip is for 47 deg North latitude and 16 deg East longitude.<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame or from the menu.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video -layout appropriate_layout.xml</tt><br />
Note that a <tt>plugin</tt> widget must be specified in the used layout:<br />
<tt> <widget size="300" name="plugin"/></tt><br />
<br />
The <tt>-plugin</tt> option is another way to use the plugin widget: the X subwindow id is given to the provided command:<br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "mplayer video_stream -wid " -layout appropriate_layout.xml</tt><br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "cvlc video_stream --drawable-xid=" -layout appropriate_layout.xml</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a string of text. Clicking on it allows the user to change its type (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can be moved by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used later by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
===Video===<br />
A video stream can be rendered in <tt>video_plugin</tt> papget, using the mplayer player:<br />
<papget type="video_plugin" display="mplayer" x="300" y="250"><br />
<property name="video_feed" value="my video source"/><br />
<property name="width" VALUE="320"/><br />
<property name="height" VALUE="240"/><br />
</papget><br />
or any video player which takes in option the X window id :<br />
<papget type="video_plugin" display="plugin" x="300" y="250"><br />
<property name="command" value="cvlc video_source --drawable-xid="/><br />
<property NAME="width" VALUE="320"/><br />
<property NAME="height" VALUE="240"/><br />
</papget><br />
<br />
<br />
===Development===<br />
Graphical appearence of papgets is defined in <tt>sw/lib/ocaml/papget_renderer.ml</tt>. A renderer must implement the Papget_renderer.t class type interface (<tt>canvas_text</tt> is probably the simpler example) and listed in the <tt>renderers</tt> list to be available<br />
in the edit popup box.<br />
<br />
The XML configuration is parsed in <tt>sw/ground_segment/cockpit/papgets.ml</tt>: a new created papget identifier must listed here.<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=6394GCS2010-04-18T08:58:34Z<p>HectoPascal: /* Video Plugin */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The height Above Ground Level (AGL) displays the ground altitude of the mouse near the geographic position in the top right hand corner. The [http://srtm.usgs.gov/ SRTM] option must be enabled in the ''Nav'' menu. The height information comes from SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) and must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/]. For example: http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N47E016.hgt.zip is for 47 deg North latitude and 16 deg East longitude.<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame or from the menu.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video -layout appropriate_layout.xml</tt><br />
Note that a <tt>plugin</tt> widget must be specified in the used layout:<br />
<tt> <widget size="300" name="plugin"/></tt><br />
<br />
The <tt>-plugin</tt> option is another way to use the plugin widget: the X subwindow id is given to the provided command:<br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "mplayer video_stream -wid " -layout appropriate_layout.xml</tt><br />
<tt>path_to_ground_segment/cockpit/gcs -plugin "cvlc video_stream --drawable-xid=" -layout appropriate_layout.xml</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a string of text. Clicking on it allows the user to change its type (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can be moved by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used later by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
===Development===<br />
Graphical appearence of papgets is defined in <tt>sw/lib/ocaml/papget_renderer.ml</tt>. A renderer must implement the Papget_renderer.t class type interface (<tt>canvas_text</tt> is probably the simpler example) and listed in the <tt>renderers</tt> list to be available<br />
in the edit popup box.<br />
<br />
The XML configuration is parsed in <tt>sw/ground_segment/cockpit/papgets.ml</tt>: a new created papget identifier must listed here.<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Fire-Storm&diff=5516Fire-Storm2009-09-23T15:01:22Z<p>HectoPascal: /* Performance */</p>
<hr />
<div>The new Storm Frame is designed according to Solar-Storm's flight conditions and for a long endurance flight. Unfortunately the EMAV09 Outdoor Endurance Mission has simulated by the number of laps that is completed between 2 poles 500m apart from each other, so the design is converted to a long range MAV by optimizing battery weight to total weight ratio and flight speed while staying at the optimum L/D point of the airframe. Finally Fire-Storm has born.<br />
<br />
<br />
<br />
<br />
[[Image:FireStorm.jpg|Fire Storm]]<br />
<br />
<br />
== Specifications ==<br />
*'''Span:''' 500 mm<br />
*'''Weight:''' 400 g (will be ~490g in a few days)<br />
<br />
== Performances ==<br />
<br />
Fire-Storm has not been tested for its designed total weight yet. However the light version (2x1320mAh LiPo batteries) is already capable of :<br />
*'''Endurance:''' 100 minutes<br />
*'''Range:''' 96 km<br />
<br />
Note: These numbers are taken from the actual flight tests in August in Toulouse. (with an 8m/s average wind)</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Fire-Storm&diff=5515Fire-Storm2009-09-23T15:01:09Z<p>HectoPascal: /* Performance */</p>
<hr />
<div>The new Storm Frame is designed according to Solar-Storm's flight conditions and for a long endurance flight. Unfortunately the EMAV09 Outdoor Endurance Mission has simulated by the number of laps that is completed between 2 poles 500m apart from each other, so the design is converted to a long range MAV by optimizing battery weight to total weight ratio and flight speed while staying at the optimum L/D point of the airframe. Finally Fire-Storm has born.<br />
<br />
<br />
<br />
<br />
[[Image:FireStorm.jpg|Fire Storm]]<br />
<br />
<br />
== Specifications ==<br />
*'''Span:''' 500 mm<br />
*'''Weight:''' 400 g (will be ~490g in a few days)<br />
<br />
== Performance ==<br />
<br />
Fire-Storm has not been tested for its designed total weight yet. However the light version (2x1320mAh LiPo batteries) is already capable of :<br />
*'''Endurance:''' 100 minutes<br />
*'''Range:''' 96 km<br />
<br />
Note: These numbers are taken from the actual flight tests in August in Toulouse. (with an 8m/s average wind)</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Solar-Storm&diff=5513Solar-Storm2009-09-23T14:53:08Z<p>HectoPascal: </p>
<hr />
<div>Solar Storm is the result of a conceptual design study for a Hybrid-Solar cell powered MAV. And as far as I can search through the internet Solar Storm is the smallest solar MAV (which is autonomous) in the world (please correct me if I am wrong...).<br />
<br />
more coming...<br />
<br />
<br />
<br />
[[Image:SolarStorm1.jpg|700px|Solar Storm]]<br />
<br />
<br />
== Specifications ==<br />
*'''Span:''' 500 mm<br />
*'''Weight:''' 300 g<br />
*'''Solar cells:''' 20 cells, serially linked for a maximum theoretical power of 6.5W<br />
*'''MPPT:''' Custom designed Maximum Power Point Tracker<br />
<br />
== Performances ==<br />
<br />
Solar-Storm has only 2 test flights yet. First to tune :) and second to measure the endurance.<br />
<br />
The numbers we got from the first flight test (by using only 730mAH battery) are encouraging:<br />
<br />
*'''Endurance:''' 53 minutes<br />
*'''Average level-flight consumption:''' 11-12 W<br />
*'''Average power from Solar cells:''' ~4-5 W <br />
<br />
Note: It was a partially cloudy day, sun was hiding behind the clouds for 20 minutes of the flight. <br />
<br />
The following plot show 7min power numbers for 7 minutes. From top to bottom, the curves show:<br />
* (purple) The voltage (V) of the solar cells array<br />
* (orange) The power (W) of the solar cells array extracetd through the MPPT.<br />
* (green) The total current (I) consumed by the whole system<br />
* (blue) The current (I) going out of the battery.<br />
<br />
We can observe on the last curve that the battery was sometimes charged in flight !<br />
<br />
[[Image:Solarplot.png|700px|Solar Plot]]<br />
<br />
Solar-Storm will be capable of flying more than 145 minutes at its designed conditions. But not tested yet :)</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5420Flight Plans2009-08-30T19:47:41Z<p>HectoPascal: /* Sectors */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS (a optional color can be specified).<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret" color="red"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Includes ===<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><includes><br />
<include name="landing" procedure="landing.xml"/><br />
</includes></tt><br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<tt><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5419Flight Plans2009-08-30T19:46:34Z<p>HectoPascal: /* Include */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Includes ===<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><includes><br />
<include name="landing" procedure="landing.xml"/><br />
</includes></tt><br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<tt><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5418Flight Plans2009-08-30T19:45:44Z<p>HectoPascal: /* Procedures */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<tt><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5417Flight Plans2009-08-30T19:44:02Z<p>HectoPascal: /* Include */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5415Flight Plans2009-08-29T08:29:12Z<p>HectoPascal: /* Include */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5414Flight Plans2009-08-28T16:24:35Z<p>HectoPascal: /* Procedures */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure [x] [y] [rotate] > [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file. The<br />
procedure can be shifted (<tt>x</tt> meters east, <tt>y</tt> meters north) and <tt>rotate</tt>d (clockwise degrees, north=0).<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="GROUND ALT+100"/><br />
<with from="event1" to="penta"/><br />
</include></tt><br />
where a jump to <tt>event1</tt> inside the <tt>hippo.xml</tt> procedure will actually jump to the <tt>penta</tt> block of the<br />
current flight plan.<br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="landing" procedure="landing.xml"/></tt><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<tt><!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</tt><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<tt><deroute block="landing.land"/></tt><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<tt><exception cond="..." deroute="go-around"/></tt><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<tt><include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include></tt><br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&diff=5384Installation/Linux2009-08-24T06:04:06Z<p>HectoPascal: </p>
<hr />
<div>Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package but to maintain the power and flexibility of open-source code, most operations within Paparazzi involve recompilation of autopilot and/or ground station code. Therefore the typical installation requires all of the necessary C and OCaml compilers as well as some XML and [http://www.tls.cena.fr/products/ivy/ Ivy] handlers. These tools are provided by the ''paparazzi-dev'' package.<br />
<br />
The Paparazzi sources are hosted by [https://savannah.nongnu.org/svn/?group=paparazzi Savannah].<br />
<br />
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].<br />
<br />
== Installation on Debian based distributions ==<br />
<br />
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://paparazzi.enac.fr/debian repository] hosted at ENAC holds their latest version.<br />
<br />
=== Installation from the Command Line===<br />
Just add the following lines to your repository list (<b>/etc/apt/sources.list</b>) and then<br />
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):<br />
<br />
Note: Because of the sources.list file permissions maybe you will need to edit it with root access. In Terminal write this:<br />
<br />
gksudo gedit /etc/apt/sources.list<br />
<br />
{{Box Code|/etc/apt/sources.list|<br />
# Uncomment just _one_ of the following lines - depending on your OS version<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> etch main<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> lenny main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> gutsy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> hardy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> intrepid main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> jaunty main<br />
}}<br />
<br />
Then, update your sources and '''either''' install the precompiled <b>bin</b>aries<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-bin<br />
<b>or</b> the dependencies needed for recompiling from the source (<b>dev</b>), and the cross-compiler (<b>arm7</b>) :<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-dev<br />
sudo apt-get install paparazzi-arm7<br />
<br />
It is not recommended to install both <tt>paparazzi-bin</tt> <b>and</b> <tt>paparazzi-dev</tt>. While the <b>bin</b> package is self-contained and should be sufficient for users who do not want to patch the code, the <b>dev</b> meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the SVN repository.<br />
<br />
Note: The ivy-python package now among the dependencies of paparazzi-dev is provided by [https://launchpad.net/~uce-launchpad/+archive/ppa Allen Ibara] and available from this repository.<br />
<br />
==== Optional/Obsolete Packages ====<br />
Users of older AVR based boards will also need the paparazzi-avr package.<br />
<br />
==== Extra for Ubuntu ====<br />
<br />
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:<br />
<br />
sudo apt-get remove brltty<br />
<br />
=== Installation thru Synaptic Package Manager ===<br />
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)<br />
* In '''Settings/Repositories''', add a new repository on URI = '''<nowiki>http://paparazzi.enac.fr/debian</nowiki>''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')<br />
* Search for <tt>paparazzi-bin</tt>, <tt>paparazzi-dev</tt>, and <tt>paparazzi-arm7</tt> packages (use the ''Search'' button)<br />
* Mark them for installation (right-click on package names)<br />
* Left-click on ''Apply''<br />
<br />
== Manual Installation of Individual Packages ==<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. The list of dependencies of the Debian package is located in the [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/debian/control.etch?revision=1.16&view=markup <tt> debian/control.etch</tt>] file and may help users of other distributions.<br />
<br />
The binary packages and some corresponding source tarballs can be downloaded from<br />
<br />
http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to translate a .deb package into a .rpm package.<br />
<br />
For Fedora (Core8) users, you can install the following packages from standard repository:<br />
* ocaml.i386<br />
* ocaml-camlimages-devel.i386<br />
* ocaml-lablgtk-devel.i386<br />
* ocaml-xml-light-devel.i386<br />
* boa.i386<br />
* libgnomecanvas-devel.i386<br />
* libusb-devel.i386<br />
* pcre-devel.i386<br />
* arm-gp2x-linux-gcc.i386<br />
* arm-gp2x-linux-binutils.i386<br />
* glade2.i386<br />
* and gcc, make, cvs, gnuplot, imagemagik...<br />
<br />
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:<br />
* ivy-c<br />
* ivy-c-dev<br />
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/<version> vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/<version> to /usr/lib/ocaml)<br />
* lpc21isp<br />
<br />
== Installing the Source Code (not needed with paparazzi-bin) ==<br />
After the <tt>paparazzi-dev</tt> package is installed the complete source code should be downloaded from the Subversion repository. See the [http://savannah.nongnu.org/svn/?group=paparazzi project page] at Savannah for more details. From the directory of your choice type:<br />
svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3<br />
or if you are behind a firewall with an http proxy available:<br />
svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3<br />
after configuration of your proxy in the <tt>~/.subversion/servers</tt> file<br />
<br />
This will download all of the code and install it into <tt>paparazzi3/</tt><br />
<br />
If you cannot use the Subversion install, daily updated tarballs can also be fetched from the [[Downloads|Downloads]] page.<br />
<br />
== Launching the Software ==<br />
<br />
If you are using the <tt>paparazzi-bin</tt> package or the Live-CD, just launch the <tt>paparazzi</tt> binary application and you will be guided through the installation of your personal configuration files.<br />
<br />
If you are using the source code, the first step is to compile it. From the <tt>paparazzi3</tt> directory (<tt>cd paparazzi3</tt>), run<br />
<br />
make<br />
<br />
You will have to run this command after each update of the source (<tt>cvs update</tt> command).<br />
Launch the software from the <tt>paparazzi3</tt> directory with<br />
<br />
./paparazzi<br />
<br />
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The prcedure is detailed in the [[Simulation]] page.<br />
<br />
If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]), without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:<br />
{{Box Code|/home/your_username/.bashrc|<br />
export PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
export PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
}}<br />
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:<br />
export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`<br />
Verify that your variables are set correctly with the following command:<br />
env | grep PAPARAZZI<br />
which should return the following:<br />
PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
<br />
== Setting access rights for USB download ==<br />
<br />
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].<br />
<br />
Default linux rights may not allow standard (non root) users to directly access the USB bus. You will need to make yourself a member of the plugdev "group" and then create a "rule", associated with that "group". <br><br />
Make yourself a member of the ''plugdev'' group:<br />
<br />
sudo adduser <your login> plugdev<br />
<br />
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler. Simply copy as root <tt>$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules</tt> to <tt>/etc/udev/rules.d/</tt><br />
<br />
sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/<br />
<br />
== Software Updates ==<br />
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed. Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. Your airframe file will not be updated by the Subversion (SVN) system and therefore any new or modified variable names will need to be added manually. The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on SVN to find the proper syntax. See the [[Compiling]] page for more help if needed.<br />
<br><br />
That said, keeping your software up to date is easy with the Subversion system. The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.<br />
<br />
To download and automatically merge any updated source files, run the following command from your Paparazzi directory<br />
svn update<br />
<br />
'''If you still use CVS (not updated anymore) run'''<br />
cvs update -d<br />
where the <tt>-d</tt> is needed to get any new directories.<br />
<br />
After any SVN update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:<br />
<br />
make<br />
<br />
The ''make'' command will only recompile portions of the software where changed have been detected. If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:<br />
<br />
make clean<br />
make<br />
<br />
See the [[Compiling]] page for more info.<br />
<br />
Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkcvs''' instead which provides highlighted comparisons of any files that differ between your code and the CVS server and allows for a file by file update.<br />
<br />
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:<br />
<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
<br />
== LiveCd ==<br />
<br />
The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer. Simply burn the image as a boot CD and reboot! The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers). It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly. <br />
<br />
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.<br />
<br />
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.<br />
<br />
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (<tt>knoppix.img</tt>).<br />
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''<br />
* Choose your media (be sure to connect your USB pendrive before booting!)<br />
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )<br />
* Choose the size of your home directory (100Mb is recommended)<br />
On the next reboot, this saved state will be automatically located and loaded.<br />
<br />
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.<br />
<br />
The Live CD can also be used to install a Debian system on the hard disk, using the <tt>knoppix-installer</tt> command. Be sure to backup the hard disk before trying ...<br />
<br />
<br />
[[Image:Lightscribe_CD_Cover_1.JPG|thumb|320px|LightScribe CD Cover]] A LiveCD needs some looks... In color or in LightScribe format, your CD will always look cool. <br />
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].<br />
<br />
* The LightScribe version is in Nero Cover Design format (.ncd) and it's here for download [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.zip LightScribe CD Cover 1]<br />
<br />
* Better is ofcourse to use it on an OpenSource OS, some Linux software to be found here: [http://www.lightscribe.com/downloadSection/linux/index.aspx?id=815]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&diff=5329Installation/Linux2009-08-10T14:31:38Z<p>HectoPascal: Reference to Allen</p>
<hr />
<div>Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package but to maintain the power and flexibility of open-source code, most operations within Paparazzi involve recompilation of autopilot and/or ground station code. Therefore the typical installation requires all of the necessary C and OCaml compilers as well as some XML and [http://www.tls.cena.fr/products/ivy/ Ivy] handlers. These tools are provided by the ''paparazzi-dev'' package.<br />
<br />
The Paparazzi sources are hosted by https://savannah.nongnu.org/svn/?group=paparazzi Savannah].<br />
<br />
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].<br />
<br />
== Installation on Debian based distributions ==<br />
<br />
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://paparazzi.enac.fr/debian repository] hosted at ENAC holds their latest version.<br />
<br />
=== Installation from the Command Line===<br />
Just add the following lines to your repository list (<b>/etc/apt/sources.list</b>) and then<br />
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):<br />
<br />
Note: Because of the sources.list file permissions maybe you will need to edit it with root access. In Terminal write this:<br />
<br />
gksudo gedit /etc/apt/sources.list<br />
<br />
{{Box Code|/etc/apt/sources.list|<br />
# Uncomment just _one_ of the following lines - depending on your OS version<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> etch main<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> lenny main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> gutsy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> hardy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> intrepid main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> jaunty main<br />
}}<br />
<br />
Then, update your sources and '''either''' install the precompiled <b>bin</b>aries<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-bin<br />
<b>or</b> the dependencies needed for recompiling from the source (<b>dev</b>), and the cross-compiler (<b>arm7</b>) :<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-dev<br />
sudo apt-get install paparazzi-arm7<br />
<br />
It is not recommended to install both <tt>paparazzi-bin</tt> <b>and</b> <tt>paparazzi-dev</tt>. While the <b>bin</b> package is self-contained and should be sufficient for users who do not want to patch the code, the <b>dev</b> meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the SVN repository.<br />
<br />
Note: The ivy-python package now among the dependencies of paparazzi-dev is provided by [https://launchpad.net/~uce-launchpad/+archive/ppa Allen Ibara] and available from this repository.<br />
<br />
==== Optional/Obsolete Packages ====<br />
Users of older AVR based boards will also need the paparazzi-avr package.<br />
<br />
==== Extra for Ubuntu ====<br />
<br />
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:<br />
<br />
sudo apt-get remove brltty<br />
<br />
=== Installation thru Synaptic Package Manager ===<br />
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)<br />
* In '''Settings/Repositories''', add a new repository on URI = '''<nowiki>http://paparazzi.enac.fr/debian</nowiki>''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')<br />
* Search for <tt>paparazzi-bin</tt>, <tt>paparazzi-dev</tt>, and <tt>paparazzi-arm7</tt> packages (use the ''Search'' button)<br />
* Mark them for installation (right-click on package names)<br />
* Left-click on ''Apply''<br />
<br />
== Manual Installation of Individual Packages ==<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. The list of dependencies of the Debian package is located in the [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/debian/control.etch?revision=1.16&view=markup <tt> debian/control.etch</tt>] file and may help users of other distributions.<br />
<br />
The binary packages and some corresponding source tarballs can be downloaded from<br />
<br />
http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to translate a .deb package into a .rpm package.<br />
<br />
For Fedora (Core8) users, you can install the following packages from standard repository:<br />
* ocaml.i386<br />
* ocaml-camlimages-devel.i386<br />
* ocaml-lablgtk-devel.i386<br />
* ocaml-xml-light-devel.i386<br />
* boa.i386<br />
* libgnomecanvas-devel.i386<br />
* libusb-devel.i386<br />
* pcre-devel.i386<br />
* arm-gp2x-linux-gcc.i386<br />
* arm-gp2x-linux-binutils.i386<br />
* glade2.i386<br />
* and gcc, make, cvs, gnuplot, imagemagik...<br />
<br />
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:<br />
* ivy-c<br />
* ivy-c-dev<br />
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/<version> vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/<version> to /usr/lib/ocaml)<br />
* lpc21isp<br />
<br />
== Installing the Source Code (not needed with paparazzi-bin) ==<br />
After the <tt>paparazzi-dev</tt> package is installed the complete source code should be downloaded from the Subversion repository. See the [http://savannah.nongnu.org/svn/?group=paparazzi project page] at Savannah for more details. From the directory of your choice type:<br />
svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3<br />
or if you are behind a firewall with an http proxy available:<br />
svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3<br />
after configuration of your proxy in the <tt>~/.subversion/servers</tt> file<br />
<br />
This will download all of the code and install it into <tt>paparazzi3/</tt><br />
<br />
If you cannot use the Subversion install, daily updated tarballs can also be fetched from the [[Downloads|Downloads]] page.<br />
<br />
== Launching the Software ==<br />
<br />
If you are using the <tt>paparazzi-bin</tt> package or the Live-CD, just launch the <tt>paparazzi</tt> binary application and you will be guided through the installation of your personal configuration files.<br />
<br />
If you are using the source code, the first step is to compile it. From the <tt>paparazzi3</tt> directory (<tt>cd paparazzi3</tt>), run<br />
<br />
make<br />
<br />
You will have to run this command after each update of the source (<tt>cvs update</tt> command).<br />
Launch the software from the <tt>paparazzi3</tt> directory with<br />
<br />
./paparazzi<br />
<br />
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The prcedure is detailed in the [[Simulation]] page.<br />
<br />
If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]), without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:<br />
{{Box Code|/home/your_username/.bashrc|<br />
export PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
export PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
}}<br />
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:<br />
export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`<br />
Verify that your variables are set correctly with the following command:<br />
env | grep PAPARAZZI<br />
which should return the following:<br />
PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
<br />
== Setting access rights for USB download ==<br />
<br />
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].<br />
<br />
Default linux rights may not allow standard (non root) users to directly access the USB bus. You will need to make yourself a member of the plugdev "group" and then create a "rule", associated with that "group". <br><br />
Make yourself a member of the ''plugdev'' group:<br />
<br />
sudo adduser <your login> plugdev<br />
<br />
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler. Simply copy as root <tt>$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules</tt> to <tt>/etc/udev/rules.d/</tt><br />
<br />
sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/<br />
<br />
== Software Updates ==<br />
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed. Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. Your airframe file will not be updated by the Subversion (SVN) system and therefore any new or modified variable names will need to be added manually. The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on SVN to find the proper syntax. See the [[Compiling]] page for more help if needed.<br />
<br><br />
That said, keeping your software up to date is easy with the Subversion system. The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.<br />
<br />
To download and automatically merge any updated source files, run the following command from your Paparazzi directory<br />
svn update<br />
<br />
'''If you still use CVS (not updated anymore) run'''<br />
cvs update -d<br />
where the <tt>-d</tt> is needed to get any new directories.<br />
<br />
After any SVN update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:<br />
<br />
make<br />
<br />
The ''make'' command will only recompile portions of the software where changed have been detected. If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:<br />
<br />
make clean<br />
make<br />
<br />
See the [[Compiling]] page for more info.<br />
<br />
Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkcvs''' instead which provides highlighted comparisons of any files that differ between your code and the CVS server and allows for a file by file update.<br />
<br />
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:<br />
<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
<br />
== LiveCd ==<br />
<br />
The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer. Simply burn the image as a boot CD and reboot! The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers). It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly. <br />
<br />
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.<br />
<br />
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.<br />
<br />
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (<tt>knoppix.img</tt>).<br />
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''<br />
* Choose your media (be sure to connect your USB pendrive before booting!)<br />
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )<br />
* Choose the size of your home directory (100Mb is recommended)<br />
On the next reboot, this saved state will be automatically located and loaded.<br />
<br />
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.<br />
<br />
The Live CD can also be used to install a Debian system on the hard disk, using the <tt>knoppix-installer</tt> command. Be sure to backup the hard disk before trying ...<br />
<br />
<br />
[[Image:Lightscribe_CD_Cover_1.JPG|thumb|320px|LightScribe CD Cover]] A LiveCD needs some looks... In color or in LightScribe format, your CD will always look cool. <br />
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].<br />
<br />
* The LightScribe version is in Nero Cover Design format (.ncd) and it's here for download [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.zip LightScribe CD Cover 1]<br />
<br />
* Better is ofcourse to use it on an OpenSource OS, some Linux software to be found here: [http://www.lightscribe.com/downloadSection/linux/index.aspx?id=815]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&diff=5328Installation/Linux2009-08-10T14:23:19Z<p>HectoPascal: /* Installation on Debian based distributions */</p>
<hr />
<div>Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package but to maintain the power and flexibility of open-source code, most operations within Paparazzi involve recompilation of autopilot and/or ground station code. Therefore the typical installation requires all of the necessary C and OCaml compilers as well as some XML and [http://www.tls.cena.fr/products/ivy/ Ivy] handlers. These tools are provided by the ''paparazzi-dev'' package.<br />
<br />
The Paparazzi sources are hosted by https://savannah.nongnu.org/svn/?group=paparazzi Savannah].<br />
<br />
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].<br />
<br />
== Installation on Debian based distributions ==<br />
<br />
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://paparazzi.enac.fr/debian repository] hosted at ENAC holds their latest version.<br />
<br />
=== Installation from the Command Line===<br />
Just add the following lines to your repository list (<b>/etc/apt/sources.list</b>) and then<br />
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):<br />
<br />
Note: Because of the sources.list file permissions maybe you will need to edit it with root access. In Terminal write this:<br />
<br />
gksudo gedit /etc/apt/sources.list<br />
<br />
{{Box Code|/etc/apt/sources.list|<br />
# Uncomment just _one_ of the following lines - depending on your OS version<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> etch main<br />
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> lenny main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> gutsy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> hardy main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> intrepid main<br />
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> jaunty main<br />
}}<br />
<br />
Note: It is not recommended to install both <tt>paparazzi-bin</tt> <b>and</b> <tt>paparazzi-dev</tt>.<br />
<br />
Then, update your sources and '''either''' install the precompiled <b>bin</b>aries<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-bin<br />
<b>or</b> the dependencies needed for recompiling from the source (<b>dev</b>), and the cross-compiler (<b>arm7</b>) :<br />
sudo apt-get update<br />
sudo apt-get install paparazzi-dev<br />
sudo apt-get install paparazzi-arm7<br />
<br />
As stated before it is not recommended to install both <tt>paparazzi-bin</tt> <b>and</b> <tt>paparazzi-dev</tt>. While the <b>bin</b> package is self-contained and should be sufficient for users who do not want to patch the code, the <b>dev</b> meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.<br />
<br />
<br />
==== Optional/Obsolete Packages ====<br />
Users of older AVR based boards will also need the paparazzi-avr package.<br />
<br />
==== Extra for Ubuntu ====<br />
<br />
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:<br />
<br />
sudo apt-get remove brltty<br />
<br />
=== Installation thru Synaptic Package Manager ===<br />
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)<br />
* In '''Settings/Repositories''', add a new repository on URI = '''<nowiki>http://paparazzi.enac.fr/debian</nowiki>''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')<br />
* Search for <tt>paparazzi-bin</tt>, <tt>paparazzi-dev</tt>, and <tt>paparazzi-arm7</tt> packages (use the ''Search'' button)<br />
* Mark them for installation (right-click on package names)<br />
* Left-click on ''Apply''<br />
<br />
== Manual Installation of Individual Packages ==<br />
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. The list of dependencies of the Debian package is located in the [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/debian/control.etch?revision=1.16&view=markup <tt> debian/control.etch</tt>] file and may help users of other distributions.<br />
<br />
The binary packages and some corresponding source tarballs can be downloaded from<br />
<br />
http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/<br />
<br />
For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to translate a .deb package into a .rpm package.<br />
<br />
For Fedora (Core8) users, you can install the following packages from standard repository:<br />
* ocaml.i386<br />
* ocaml-camlimages-devel.i386<br />
* ocaml-lablgtk-devel.i386<br />
* ocaml-xml-light-devel.i386<br />
* boa.i386<br />
* libgnomecanvas-devel.i386<br />
* libusb-devel.i386<br />
* pcre-devel.i386<br />
* arm-gp2x-linux-gcc.i386<br />
* arm-gp2x-linux-binutils.i386<br />
* glade2.i386<br />
* and gcc, make, cvs, gnuplot, imagemagik...<br />
<br />
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:<br />
* ivy-c<br />
* ivy-c-dev<br />
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/<version> vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/<version> to /usr/lib/ocaml)<br />
* lpc21isp<br />
<br />
== Installing the Source Code (not needed with paparazzi-bin) ==<br />
After the <tt>paparazzi-dev</tt> package is installed the complete source code should be downloaded from the Subversion repository. See the [http://savannah.nongnu.org/svn/?group=paparazzi project page] at Savannah for more details. From the directory of your choice type:<br />
svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3<br />
or if you are behind a firewall with an http proxy available:<br />
svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3<br />
after configuration of your proxy in the <tt>~/.subversion/servers</tt> file<br />
<br />
This will download all of the code and install it into <tt>paparazzi3/</tt><br />
<br />
If you cannot use the Subversion install, daily updated tarballs can also be fetched from the [[Downloads|Downloads]] page.<br />
<br />
== Launching the Software ==<br />
<br />
If you are using the <tt>paparazzi-bin</tt> package or the Live-CD, just launch the <tt>paparazzi</tt> binary application and you will be guided through the installation of your personal configuration files.<br />
<br />
If you are using the source code, the first step is to compile it. From the <tt>paparazzi3</tt> directory (<tt>cd paparazzi3</tt>), run<br />
<br />
make<br />
<br />
You will have to run this command after each update of the source (<tt>cvs update</tt> command).<br />
Launch the software from the <tt>paparazzi3</tt> directory with<br />
<br />
./paparazzi<br />
<br />
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The prcedure is detailed in the [[Simulation]] page.<br />
<br />
If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]), without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:<br />
{{Box Code|/home/your_username/.bashrc|<br />
export PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
export PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
}}<br />
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:<br />
export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`<br />
Verify that your variables are set correctly with the following command:<br />
env | grep PAPARAZZI<br />
which should return the following:<br />
PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''<br />
PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''<br />
<br />
== Setting access rights for USB download ==<br />
<br />
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].<br />
<br />
Default linux rights may not allow standard (non root) users to directly access the USB bus. You will need to make yourself a member of the plugdev "group" and then create a "rule", associated with that "group". <br><br />
Make yourself a member of the ''plugdev'' group:<br />
<br />
sudo adduser <your login> plugdev<br />
<br />
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler. Simply copy as root <tt>$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules</tt> to <tt>/etc/udev/rules.d/</tt><br />
<br />
sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/<br />
<br />
== Software Updates ==<br />
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed. Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. Your airframe file will not be updated by the Subversion (SVN) system and therefore any new or modified variable names will need to be added manually. The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on SVN to find the proper syntax. See the [[Compiling]] page for more help if needed.<br />
<br><br />
That said, keeping your software up to date is easy with the Subversion system. The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.<br />
<br />
To download and automatically merge any updated source files, run the following command from your Paparazzi directory<br />
svn update<br />
<br />
'''If you still use CVS (not updated anymore) run'''<br />
cvs update -d<br />
where the <tt>-d</tt> is needed to get any new directories.<br />
<br />
After any SVN update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:<br />
<br />
make<br />
<br />
The ''make'' command will only recompile portions of the software where changed have been detected. If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:<br />
<br />
make clean<br />
make<br />
<br />
See the [[Compiling]] page for more info.<br />
<br />
Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkcvs''' instead which provides highlighted comparisons of any files that differ between your code and the CVS server and allows for a file by file update.<br />
<br />
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:<br />
<br />
sudo apt-get update<br />
sudo apt-get upgrade<br />
<br />
== LiveCd ==<br />
<br />
The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer. Simply burn the image as a boot CD and reboot! The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers). It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly. <br />
<br />
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.<br />
<br />
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.<br />
<br />
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (<tt>knoppix.img</tt>).<br />
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''<br />
* Choose your media (be sure to connect your USB pendrive before booting!)<br />
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )<br />
* Choose the size of your home directory (100Mb is recommended)<br />
On the next reboot, this saved state will be automatically located and loaded.<br />
<br />
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.<br />
<br />
The Live CD can also be used to install a Debian system on the hard disk, using the <tt>knoppix-installer</tt> command. Be sure to backup the hard disk before trying ...<br />
<br />
<br />
[[Image:Lightscribe_CD_Cover_1.JPG|thumb|320px|LightScribe CD Cover]] A LiveCD needs some looks... In color or in LightScribe format, your CD will always look cool. <br />
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].<br />
<br />
* The LightScribe version is in Nero Cover Design format (.ncd) and it's here for download [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.zip LightScribe CD Cover 1]<br />
<br />
* Better is ofcourse to use it on an OpenSource OS, some Linux software to be found here: [http://www.lightscribe.com/downloadSection/linux/index.aspx?id=815]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Maps&diff=5327Maps2009-08-09T21:31:25Z<p>HectoPascal: SRTM URL updated</p>
<hr />
<div>== Google Maps ==<br />
<br />
The Paparazzi GCS will automatically download satellite photo tiles from Google for the area defined in the flight plan. These tiles are fully calibrated and automatically stitched together by the GCS. To load the map tiles simply select Maps->Google Maps Fill (Ctrl-F) from the GCS pulldown menu and the tiles corresponding to the GPS coordinates defined in the [[Flight_Plans|flight plan]] will begin donloading. Pan or zoom the map and re-fill to get more tiles. Tiles are saved in <tt>var/maps/</tt> for off-line use. Checking ''Maps->Google Maps Auto'' will automatically fill the map with tiles while paning and zooming. There is also a command line option to start the GCS with the Auto-fill feature enabled: <br />
<tt>paparazzi-gcs -google_fill</tt>. <br />
If you are behind a firewall, you can use a proxy by setting the <tt>http_proxy</tt> environment variable:<br />
<tt>export http_proxy=<nowiki>http://squid:3128</nowiki></tt><br />
<br />
If you wish to create a calibrated map from the google tiles, so that upon launching the map2d program a map of the area is shown, go ahead and put into view the area you wish to make the map. While holding left click, drag the area for the map. A red border will appear around the area. Next click on Maps->Map of Region or Maps->Map of Google Tiles. While the former will save the visible region (with waypoints, tracks, ...if any, under the current zoom), the latter will stich together the original Google tiles covering the selected region. Save the xml file to the <tt>data/maps/</tt> directory. This program will automatically screenshot the image and take reference location points and calibrate the map using them. You will be able to load this map in your next sessions (with the Maps->Load menu or with the <tt>-m</tt> option you can add in the your section of <tt>control_panel.xml</tt>.<br />
<br />
Example of map created from google tiles, <tt>gifhorn.xml</tt>:<br />
<tt><map file="gifhorn.jpg" projection="Mercator"><br />
<point x="0" y="0" geo="WGS84 52.527982 10.452157"/><br />
<point x="1965" y="1284" geo="WGS84 52.519595 10.473248"/><br />
</map></tt><br />
<br />
The GCS currently supports three projections (UTM, Mercator and LambertIIe). If you try to place a calibrated map for one projection (e.g. UTM) on another projection plot (e.g. Mercator) the image will be rotated and skewed and a warning will be shown during loading.<br />
<br />
<br />
== Manually Defined Maps ==<br />
<br />
Maps are used in the groundstation to give geographical reference to the flight area. These ''calibrated'' maps are described with two files: the image itself (.png, .jpg or .gif) and an xml file containing geographic references of some points of the bitmap.<br />
<br />
For example, <tt>muret_UTM.xml</tt>:<br />
<tt><map file="muret_UTM.gif" projection="UTM" scale="2.5" approx_ground_altitude="185" utm_zone="31" opacity="100"><br />
<point x="0" y="0" utm_x="359000" utm_y="4815000" geo="WGS84 43.474630 1.256652"/><br />
<point x="0" y="800" utm_x="359000" utm_y="4813000" geo="WGS84 43.456629 1.257169"/><br />
<point x="800" y="800" utm_x="361000" utm_y="4813000"/><br />
</map></tt><br />
<br />
These maps can be created from any image (many are available from various websites). Save the file as a jpeg and place it in the <tt>data/maps/</tt> folder. From the GCS select Maps->Calibrate. After loading the image (which is displayed), you will have to choose at least two reference points, name them with their geographic coordinates (in WGS84 or UTM) and save. The created map (an XML file describing the geographical position of your original bitmap) can then be loaded (Maps->Load).<br />
<br />
== SRTM Data ==<br />
The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu in the GCS displays the ground altitude of the mouse in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3 http://dds.cr.usgs.gov/srtm/version2_1/SRTM3].<br />
Some area (for example high latitudes) are not well covered by official SRTM data. Some other data have been compiled under the same format: [http://www.viewfinderpanoramas.org/dem3.html http://www.viewfinderpanoramas.org/dem3.html].</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5326Pyrenees Crossing2009-08-09T14:36:32Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.log .log] and [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.data.bz2 .data.bz2] files can be used to replay the flight in the Paparazzi GCS. They have been extracted (using the <tt>sw/logalizer/sd2log</tt> script) from a binary log stored on board, on a SD card. The telemetry was lost for few minutes, mainly because the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<p><br />
A 2.4Ghz XBee connected to the PA-13R antenna from [http://wimo.com wimo.com] allowed us to follow the aircraft during the first 12km. We were on line of sight and even almost in "open" space since the aircraft was flying over a deep valley.<br />
<br />
<br />
<p><br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg|250px]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
<center><br />
[[Image:Funny_Climbing.jpg]]<br />
</center></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5325Pyrenees Crossing2009-08-09T14:35:14Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.log .log] and [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.data.bz2 .data.bz2] files can be used to replay the flight in the Paparazzi GCS. They have been extracted (using the <tt>sw/logalizer/sd2log</tt> script) from a binary log stored on board, on a SD card. The telemetry was lost for few minutes, mainly because the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<p><br />
A 2.4Ghz XBee connected to the PA-13R antenna from [http://wimo.com wimo.com] allowed us to follow the aircraft during the first 12km. We were on line of sight and even almost in "open" space since the aircraft was flying over a deep valley.<br />
<br />
<br />
<p><br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5324Pyrenees Crossing2009-08-09T14:34:30Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.log .log] and [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.data.bz2 .data.bz2] files can be used to replay the flight in the Paparazzi GCS. They have been extracted (using the <tt>sw/logalizer/sd2log</tt> script) from a binary log stored on board, on a SD card. The telemetry was lost for few minutes, mainly because the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<p><br />
A 2.4Ghz XBee connected to the PA-13R antenna from [http://wimo.com] allowed us to follow the aircraft during the first 12km. We were on line of sight and even almost in "open" space since the aircraft was flying over a deep valley.<br />
<br />
<br />
<p><br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5323Pyrenees Crossing2009-08-09T14:25:31Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.log .log] and [http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.data.bz2 .data.bz2] files can be used to replay the flight in the Paparazzi GCS. They have been extracted from a binary log stored on board on a SD card (using the <tt>sw/logalizer/sd2log</tt> script). The telemetry was lost for few minutes, mainly because the the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5322Pyrenees Crossing2009-08-09T14:25:05Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [[http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.log .log]] and [[http://www.recherche.enac.fr/paparazzi/wiki_images/09_08_06__11_22_17_SD.data.bz2 .data.bz2]] files can be used to replay the flight in the Paparazzi GCS. They have been extracted from a binary log stored on board on a SD card (using the <tt>sw/logalizer/sd2log</tt> script). The telemetry was lost for few minutes, mainly because the the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5321Pyrenees Crossing2009-08-09T14:17:11Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [[Media:09_08_06__11_22_17_SD.log|.log]] and [[Media:09_08_06__11_22_17_SD.data.bz2|.data.bz2]] files can be used to replay the flight in the Paparazzi GCS. They have been extracted from a binary log stored on board on a SD card (using the <tt>sw/logalizer/sd2log</tt> script). The telemetry was lost for few minutes, mainly because the the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5320Pyrenees Crossing2009-08-09T14:14:38Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The [[Media:log|.log]] and [[Media:data|.data.bz2]] files can be used to replay the flight in the Paparazzi GCS. They have been extracted from a binary log stored on board on a SD card (using the <tt>sw/logalizer/sd2log</tt> script). The telemetry was lost for few minutes, mainly because the the aircraft was not in line of sight of the arrival GCS after the pass.<br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds. The front of the aircraft in on the left side of the pictures.<br />
<br />
Two pictures above the Laparan lake dam (1540m, seen from 2100m), and above the Fontargente lake (2150m, seen from 2350m) just before the pass (2262m). A blue tent can be seen:<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path (1900m, seen from 2100m) and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off while the airspeed was about 15m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5319Pyrenees Crossing2009-08-09T13:54:24Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds.<br />
<br />
Two pictures above the Laparan lake dam, and above the Fontargente lake just before the pass (a blue tent can be seen):<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg|500px]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Funny_Climbing.jpg&diff=5318File:Funny Climbing.jpg2009-08-09T13:53:19Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Arrival.jpg&diff=5317File:Arrival.jpg2009-08-09T13:52:47Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Incles.jpg&diff=5316File:Incles.jpg2009-08-09T13:52:07Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Fontargente.jpg&diff=5315File:Fontargente.jpg2009-08-09T13:51:41Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5314Pyrenees Crossing2009-08-09T13:50:38Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds.<br />
<br />
Two pictures above the Laparan lake dam, and above the Fontargente lake just before the pass (a blue tent can be seen):<br />
<center><br />
[[Image:Laparan.jpg|250px]] [[Image:Fontargente.jpg|250px]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Laparan.jpg&diff=5313File:Laparan.jpg2009-08-09T13:49:53Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Goal.jpg&diff=5312File:Goal.jpg2009-08-09T13:49:30Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Departure.jpg&diff=5311File:Departure.jpg2009-08-09T13:49:00Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5310Pyrenees Crossing2009-08-09T13:48:24Z<p>HectoPascal: </p>
<hr />
<div>Realized on August 6, 2009, the [http://paparazzi.enac.fr/wiki/Image:Pyrenees_crossing_NS.kmz flight path and some points of interest] appears here (screenshot, it does not seem to be possible to include the Google Maps widget in this wiki):<br />
<br />
<center><br />
[[Image:GM_screenshot.jpg|400px]]<br />
</center><br />
<br />
The take off took place on the "Plateau de Beille", 1800m:<br />
<br />
<center><br />
[[Image:Departure.jpg|250px]] [[Image:Goal.jpg|250px]]<br />
</center><br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds.<br />
<br />
Two pictures above the Laparan lake dam, and above the Fontargente lake just before the pass (a blue tent can be seen):<br />
<center><br />
[[Image:Laparan.jpg]] [[Image:Fontargente.jpg]]<br />
</center><br />
<br />
Just before the arrival, a guy on a path and his shadow:<br />
<br />
<center><br />
[[Image:Incles.jpg]]<br />
</center><br />
<br />
And the arrival ground station on a pretty and convenient support:<br />
<br />
<center><br />
[[Image:Arrival.jpg]]<br />
</center><br />
<br />
Wind was from the south, estimated at 2m/s during the first circles after take off. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:GM_screenshot.jpg&diff=5309File:GM screenshot.jpg2009-08-09T13:32:52Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Pyrenees_Crossing&diff=5308Pyrenees Crossing2009-08-09T13:31:40Z<p>HectoPascal: </p>
<hr />
<div>Autonomous flight across the Pyrenees. The flight path and some points of interest appears here (screenshot):<br />
<br />
[[Image:GM.jpg]]<br />
<br />
The aircraft, a Multiplex Funjet, was equipped with a Pentax Optio S7 digital camera and it took (well, at least it was supposed to do it) one shot every 5 seconds.<br />
<br />
[[Image:Departure.jpg]] [[Image:Goal.jpg]] [[Image:Laparan.jpg]] [[Image:Fontargente.jpg]] [[Image:Incles.jpg]] [[Image:Arrival.jpg]]<br />
<br />
Wind was from the south, about 2m/s. An interesting pertubation occurred just before crossing the pass: at t=1045s, the aircraft climbed 50m higher than the setpoint (2350m); the throttle was then shut down (10%) and pitch was set down as well ... and the<br />
ground speed increased from 13m/s to 17m/s. The following plots display the event<br />
<br />
[[Image:Funny_Climbing.jpg]]</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Pyrenees_crossing_NS.kmz&diff=5301File:Pyrenees crossing NS.kmz2009-08-06T18:25:14Z<p>HectoPascal: Autonomous flight across the Pyrenees</p>
<hr />
<div>Autonomous flight across the Pyrenees</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Settings&diff=5196Settings2009-07-03T22:02:15Z<p>HectoPascal: key press</p>
<hr />
<div>The grammar of the setting file is described in <tt>conf/settings/settings.dtd</tt>. It is a tree of named variables. Each variable is associated with a <tt>min</tt>, <tt>max</tt> and <tt>step</tt> attributes. These attributes are used to build the graphical interface of the settings page in the [[GCS]]. A simple entry looks like<br />
<tt><dl_setting MAX="2" MIN="0" STEP="1" VAR="pprz_mode"></tt><br />
More attributes may be added:<br />
* <tt>shortname="s"</tt> : <tt>s</tt> will replace the variable name for the label in the [[GCS]]<br />
* <tt>module="m"</tt> : It specifies the file where the variable is coming from. A corresponding <tt>#include "m.h"</tt> will be generated in the corresponding C code.<br />
* <tt>handler="h"</tt> : Specifies a macro to be called to do the setting. Associated with a module <tt>m</tt> the macro actually must be named <tt>m_h()</tt><br />
<br />
Buttons, packed in the strip in the [[GCS]], may be associated to variables. They are described as <tt>strip</tt> children elements of a <tt>dl_setting</tt> element.<br />
<tt><dl_setting MAX="1" MIN="0.0" STEP="0.05" VAR="v_ctl_auto_throttle_cruise_throttle" shortname="cruise throttle" module="fw_v_ctl" handler="SetCruiseThrottle"><br />
<strip_button name="Dash" value="1"/><br />
<strip_button name="Loiter" value="0.1"/><br />
<strip_button name="Cruise" value="0"/><br />
</dl_setting></tt><br />
<br />
For a prettier strip, an icon can be used for a strip button:<br />
<tt><dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="nav" handler="SetNavRadius"><br />
<strip_button icon="circle-right.png" name="Circle right" value="1"/> <br />
<strip_button icon="circle-left.png" name="Circle left" value="-1"/> <br />
</dl_setting></tt><br />
The image file must be located in the <tt>data/pictures/gcs_icons</tt> directory.<br />
<br />
Key accelerators can also be specified (using the GTK syntax to specify the keysym):<br />
<tt><dl_setting MAX="200" MIN="-200" STEP="10" VAR="nav_radius" module="nav" handler="SetNavRadius"><br />
<key_press key="greater" value="1"/><br />
<key_press key="less" value="-1"/><br />
<key_press key="F10" value="100"/><br />
</dl_setting></tt><br />
<br />
Some examples of settings files can be found in <tt>conf/settings</tt> ([http://cvs.savannah.nongnu.org/viewvc/paparazzi3/conf/settings/basic.xml?root=paparazzi&view=log basic.xml] and [http://cvs.savannah.nongnu.org/viewvc/paparazzi3/conf/settings/tuning.xml?root=paparazzi&view=log tuning.xml]).</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5195Flight Plans2009-07-03T15:08:01Z<p>HectoPascal: /* Follow */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure [x] [y] [rotate] > [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file. The<br />
procedure can be shifted (<tt>x</tt> meters east, <tt>y</tt> meters north) and <tt>rotate</tt>d (clockwise degrees, north=0).<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="GROUND ALT+100"/><br />
<with from="event1" to="penta"/><br />
</include></tt><br />
where a jump to <tt>event1</tt> inside the <tt>hippo.xml</tt> procedure will actually jump to the <tt>penta</tt> block of the<br />
current flight plan.<br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-win aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* the relative position and the orientation of the procedure in the flight plan;<br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="ground_alt+100"/><br />
<with from="end" to="landing"/><br />
</include></tt><br />
<br />
Here is the corresponding procedure '''hippo.xml''':<br />
<tt><procedure><br />
<param name="alt"/><br />
<param name="radius" default value="75"/><br />
<waypoints><br />
<waypoint name="c1" x="0" y="0"/><br />
<waypoint name="c2" x="250" y="0"/><br />
</waypoints><br />
<blocks><br />
<block name="oneturn"><br />
<go hmode="route" alt="alt" from="c1" from_qdr="0" from_dist="radius" wp="c2" wp_qdr="0" wp_dist="radius"/><br />
<circle wp="c2" radius="radius" until="Qdr(180)" alt="alt"/><br />
<go hmode="route" alt="alt" from="c2" from_qdr="180" from_dist="radius" wp="c1" wp_qdr="180" wp_dist="radius"/><br />
<circle wp="c1" radius="radius" until="Qdr(0)" alt="alt"/><br />
<deroute block="end"/><br />
</block><br />
</blocks><br />
</procedure></tt><br />
<br />
Note that the name of procedure block is then '''hippo1.oneturn''':<br />
<tt><deroute block="hippo1.oneturn"/></tt><br />
will jump to this procedure block.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5194Flight Plans2009-07-03T11:35:03Z<p>HectoPascal: /* Follow */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure [x] [y] [rotate] > [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file. The<br />
procedure can be shifted (<tt>x</tt> meters east, <tt>y</tt> meters north) and <tt>rotate</tt>d (clockwise degrees, north=0).<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="GROUND ALT+100"/><br />
<with from="event1" to="penta"/><br />
</include></tt><br />
where a jump to <tt>event1</tt> inside the <tt>hippo.xml</tt> procedure will actually jump to the <tt>penta</tt> block of the<br />
current flight plan.<br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-win aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature. The followings lines mus be added in the airframe file<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* the relative position and the orientation of the procedure in the flight plan;<br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="ground_alt+100"/><br />
<with from="end" to="landing"/><br />
</include></tt><br />
<br />
Here is the corresponding procedure '''hippo.xml''':<br />
<tt><procedure><br />
<param name="alt"/><br />
<param name="radius" default value="75"/><br />
<waypoints><br />
<waypoint name="c1" x="0" y="0"/><br />
<waypoint name="c2" x="250" y="0"/><br />
</waypoints><br />
<blocks><br />
<block name="oneturn"><br />
<go hmode="route" alt="alt" from="c1" from_qdr="0" from_dist="radius" wp="c2" wp_qdr="0" wp_dist="radius"/><br />
<circle wp="c2" radius="radius" until="Qdr(180)" alt="alt"/><br />
<go hmode="route" alt="alt" from="c2" from_qdr="180" from_dist="radius" wp="c1" wp_qdr="180" wp_dist="radius"/><br />
<circle wp="c1" radius="radius" until="Qdr(0)" alt="alt"/><br />
<deroute block="end"/><br />
</block><br />
</blocks><br />
</procedure></tt><br />
<br />
Note that the name of procedure block is then '''hippo1.oneturn''':<br />
<tt><deroute block="hippo1.oneturn"/></tt><br />
will jump to this procedure block.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5193Flight Plans2009-07-03T11:34:11Z<p>HectoPascal: /* Follow */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure [x] [y] [rotate] > [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file. The<br />
procedure can be shifted (<tt>x</tt> meters east, <tt>y</tt> meters north) and <tt>rotate</tt>d (clockwise degrees, north=0).<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="GROUND ALT+100"/><br />
<with from="event1" to="penta"/><br />
</include></tt><br />
where a jump to <tt>event1</tt> inside the <tt>hippo.xml</tt> procedure will actually jump to the <tt>penta</tt> block of the<br />
current flight plan.<br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-win aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature. The followings lines mus be added in the airframe file<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>asim.srcs += traffic_info.c</tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* the relative position and the orientation of the procedure in the flight plan;<br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="ground_alt+100"/><br />
<with from="end" to="landing"/><br />
</include></tt><br />
<br />
Here is the corresponding procedure '''hippo.xml''':<br />
<tt><procedure><br />
<param name="alt"/><br />
<param name="radius" default value="75"/><br />
<waypoints><br />
<waypoint name="c1" x="0" y="0"/><br />
<waypoint name="c2" x="250" y="0"/><br />
</waypoints><br />
<blocks><br />
<block name="oneturn"><br />
<go hmode="route" alt="alt" from="c1" from_qdr="0" from_dist="radius" wp="c2" wp_qdr="0" wp_dist="radius"/><br />
<circle wp="c2" radius="radius" until="Qdr(180)" alt="alt"/><br />
<go hmode="route" alt="alt" from="c2" from_qdr="180" from_dist="radius" wp="c1" wp_qdr="180" wp_dist="radius"/><br />
<circle wp="c1" radius="radius" until="Qdr(0)" alt="alt"/><br />
<deroute block="end"/><br />
</block><br />
</blocks><br />
</procedure></tt><br />
<br />
Note that the name of procedure block is then '''hippo1.oneturn''':<br />
<tt><deroute block="hippo1.oneturn"/></tt><br />
will jump to this procedure block.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=5181Flight Plans2009-06-30T22:30:30Z<p>HectoPascal: /* Blocks */</p>
<hr />
<div>The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<tt><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></tt><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. <br />
<br />
== Structure of the flight plan file ==<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional <tt>include</tt>'s and global <tt>exceptions</tt>.<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt><flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home></tt><br />
* <tt>name</tt>: the name of the mission (a text string)<br />
* <tt>lat0, lon0</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>ground_alt</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>security_height</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>qfu</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft.<br />
* <tt>alt</tt>: the default altitude of waypoints<br />
* <tt>max_dist_from_home</tt>: the maximum allowed distance (in meters) from the HOME waypoint.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<tt><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</tt><br />
<br />
=== Waypoints ===<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:<br />
<tt> <waypoint name x y [alt] /> </tt><br />
where <tt>x</tt> and <tt>y</tt> are the coordinates in meters from point {0,0}. <tt>alt</tt> is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> above. Note that a waypoint named <tt>HOME</tt> is required as it is used by the failsafe HOME mode procedure.<br />
<br />
One example:<br />
<tt><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="1" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="2" x="-130.0" y="217.5" alt="3000."/><br />
</waypoints><br />
</tt><br />
<br />
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].<br />
<br />
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.<br />
<br />
<br />
=== Sectors ===<br />
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.<br />
A function is generated to check if a point (usually the aircraft itself) is ''inside'' the polygon. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>, the generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. Note: If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS.<br />
<br />
For example, with the following element in a flight plan (waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode)<br />
<tt><br />
<sectors><br />
<sector name="Muret"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</tt><br />
it is then possible to write a exception to stay inside it:<br />
<tt><br />
<exception cond="! InsideMuret(estimator_x, estimator_y)" deroute="standby"/><br />
</tt><br />
<br />
=== Include ===<br />
<br />
<tt>include</tt> is used to add blocks defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure [x] [y] [rotate] > [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to jump to the blocks of the <tt>procedure</tt>, the XML referenced file. The<br />
procedure can be shifted (<tt>x</tt> meters east, <tt>y</tt> meters north) and <tt>rotate</tt>d (clockwise degrees, north=0).<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="GROUND ALT+100"/><br />
<with from="event1" to="penta"/><br />
</include></tt><br />
where a jump to <tt>event1</tt> inside the <tt>hippo.xml</tt> procedure will actually jump to the <tt>penta</tt> block of the<br />
current flight plan.<br />
<br />
=== Blocks ===<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot go to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<tt><!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow<br />
|survey_rectangle)*></tt><br />
<br />
Example:<br />
<tt><block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block></tt><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<tt><block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
This button will activate the block.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<tt><block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block> </tt><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<tt><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></tt><br />
<br />
You can call functions before or after each execution of the block:<br />
<tt><block name="ciclehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block></tt><br />
<br />
===== Expressions =====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
==== Exceptions ====<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<tt><exception cond="..." deroute="..."></tt><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<tt><exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/></tt><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<tt><flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...</tt><br />
<br />
==== Deroute ====<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<tt><br />
<deroute block="landing"/></tt><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
==== Loops ====<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<tt><while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while></tt><br />
In this example, we run an infinite loop, going to waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<tt><for var="i" from="0" to="3"><br />
...<br />
</for></tt><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<tt><for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for></tt><br />
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
==== Navigation modes ====<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-win aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
==== Attitude ====<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<tt><attitude roll="0" vmode="throttle", throttle="0.5"/></tt><br />
<br />
To fly around, holding a given altitude:<br />
<tt><attitude roll="30" alt="ground_alt+50"/></tt><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
==== Heading ====<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<tt><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></tt><br />
<br />
==== Go ====<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<tt><go wp="HOME"/></tt><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<tt><go from="wp1" wp="wp2" hmode="route"/></tt><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<tt><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></tt><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<tt><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></tt><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<tt><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></tt><br />
<br />
==== Circle ====<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<tt><circle wp="HOME" radius="75"/></tt><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<tt><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></tt><br />
<br />
==== Follow ====<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<tt><follow ac_id="4" distance="50" height="20"/></tt><br />
<br />
==== Stay ====<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<tt><stay wp="HOME" alt="10"/></tt><br />
<br />
==== Xyz ====<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<tt><xyz radius="40"/></tt><br />
<br />
==== Set ====<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<tt><set var="ground_alt" value="ground_alt+50"/></tt><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
==== Call ====<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<tt><call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/></tt><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<tt><header><br />
#include "nav_line.h"<br />
</header></tt><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<br />
<set var="h_ctl_disabled" value="true"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="false"/><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may<br />
contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:<br />
<tt><!ELEMENT procedure (param*,waypoints,exceptions?,blocks)></tt><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<tt><param name="alt"/><br />
<param name="radius" default_value="75"/></tt><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:<br />
* the name of the procedure file, the name given to this inclusion; <br />
* the relative position and the orientation of the procedure in the flight plan;<br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<tt><include name="hippo1" procedure="hippo.xml" x="-100" y="150" rotate="0"><br />
<arg name="alt" value="ground_alt+100"/><br />
<with from="end" to="landing"/><br />
</include></tt><br />
<br />
Here is the corresponding procedure '''hippo.xml''':<br />
<tt><procedure><br />
<param name="alt"/><br />
<param name="radius" default value="75"/><br />
<waypoints><br />
<waypoint name="c1" x="0" y="0"/><br />
<waypoint name="c2" x="250" y="0"/><br />
</waypoints><br />
<blocks><br />
<block name="oneturn"><br />
<go hmode="route" alt="alt" from="c1" from_qdr="0" from_dist="radius" wp="c2" wp_qdr="0" wp_dist="radius"/><br />
<circle wp="c2" radius="radius" until="Qdr(180)" alt="alt"/><br />
<go hmode="route" alt="alt" from="c2" from_qdr="180" from_dist="radius" wp="c1" wp_qdr="180" wp_dist="radius"/><br />
<circle wp="c1" radius="radius" until="Qdr(0)" alt="alt"/><br />
<deroute block="end"/><br />
</block><br />
</blocks><br />
</procedure></tt><br />
<br />
Note that the name of procedure block is then '''hippo1.oneturn''':<br />
<tt><deroute block="hippo1.oneturn"/></tt><br />
will jump to this procedure block.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=Downloads&diff=5073Downloads2009-06-09T12:17:21Z<p>HectoPascal: /* Paparazzi Source Code */</p>
<hr />
<div>== Paparazzi Boot CD ==<br />
* Burn this to a CD and boot from it to try Paparazzi without any software changes to your PC! Includes Debian, Paparazzi, and all required libraries.<br />
*: [http://www.recherche.enac.fr/paparazzi/paparazzix/ Download Page]<br />
* Boot the CD, sit back, relax and enjoy the scenery.<br />
*: [[Using the Boot CD]] step by step - howto<br />
<br />
(Note: The image file [http://www.recherche.enac.fr/paparazzi/paparazzix/paparazziX_Mas2008.iso paparazziX_Mas2008.iso] is the latest and greatest version of the boot-CD)<br />
<br />
== Paparazzi Binary Package ==<br />
* Install this package to your Debian system<br />
*: [http://www.recherche.enac.fr/paparazzi/debian/ Http Download Page].<br />
<br />
== Paparazzi Source Code ==<br />
'''We switched to Subversion:'''<br />
* Browse the current code tree here:<br />
*: http://svn.savannah.gnu.org/viewvc/paparazzi3/trunk/?root=paparazzi<br />
* Download the current source tree using our anonymous SVN server by running this command from your home directory<br />
svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3<br />
or through <tt>http</tt> (proxy configuration is <tt>~/.subversion/servers</tt>)<br />
svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3<br />
<br />
'''You can still use CVS, but soon it will be read only and not updated anymore:'''<br />
* Browse the current code tree here:<br />
*: http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/<br />
* Download a recent archive<br />
*: http://www.recherche.enac.fr/paparazzi/tarball/<br />
* Download the current source tree using our anonymous CVS server by running this command from your home directory<br />
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/paparazzi co paparazzi3<br />
<br />
== Paparazzi Hardware Plans ==<br />
* Download Eagle files for all current and past autopilot, sensor, and miscellaneous hardware.<br />
*: http://svn.savannah.gnu.org/viewvc/paparazzi3/trunk/hw/?root=paparazzi<br />
* Be sure to download both *.brd and *.sch files and use Cadsoft Eagle to view them. [http://www.cadsoft.de/freeware.htm Eagle (free version)]<br />
<br />
== User Submitted Files ==<br />
* Upload your patches, scripts, etc. here. Please sign your entry!<br />
<br />
=== Matlab Files ===<br />
<br />
=== Other Files ===</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=5041GCS2009-05-15T09:11:55Z<p>HectoPascal: /* Papgets */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu displays the ground altitude of the mouse near the geographic position in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3 ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3].<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a text. A click on it then allows the user to change its kind (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can also be placed anywhere by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets then can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used lated by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
===Development===<br />
Graphical appearence of papgets is defined in <tt>sw/lib/ocaml/papget_renderer.ml</tt>. A renderer must implement the Papget_renderer.t class type interface (<tt>canvas_text</tt> is probably the simpler example) and listed in the <tt>renderers</tt> list to be available<br />
in the edit popup box.<br />
<br />
The XML configuration is parsed in <tt>sw/ground_segment/cockpit/papgets.ml</tt>: a new created papget identifier must listed here.<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=5040GCS2009-05-15T08:56:29Z<p>HectoPascal: /* Papgets */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu displays the ground altitude of the mouse near the geographic position in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3 ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3].<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a text. A click on it then allows the user to change its kind (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can also be placed anywhere by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets then can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<pre><br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
</pre><br />
<br />
The file is used lated by giving it to the gcs process:<br />
<br />
<pre><br />
.../gcs -layout my_fancy_papgets.xml<br />
</pre><br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=5039GCS2009-05-15T08:50:05Z<p>HectoPascal: /* Telemetry data report */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu displays the ground altitude of the mouse near the geographic position in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3 ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3].<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a text. A click on it then allows the user to change its kind (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can also be placed anywhere by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets then can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
<br />
The file is used lated by giving it to the gcs process:<br />
<br />
.../gcs -layout my_fancy_papgets.xml<br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=5038GCS2009-05-15T08:49:33Z<p>HectoPascal: /* Papgets */</p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu displays the ground altitude of the mouse near the geographic position in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3 ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3].<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
==Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''. The following snapshot<br />
shows an example with buttons (left side), gauges (lower left corner), text (upper right corner) and ruler (right side). This example<br />
has been produced with a layout file provided in the distribution:<br />
<br />
.../gcs -layout papgets.xml <br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
===Telemetry data report===<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a text. A click on it then allows the user to change its kind (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can also be placed anywhere by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
Papgets then can be saved in the layout of the GCS (from the Nav menu). The description is saved in an XML file (in <tt>conf/gcs/</tt> folder) which can be manually edited:<br />
<br />
<br />
<papget type="message_field" display="gauge" x="47" y="414"><br />
<property name="field" value="BAT:voltage"/><br />
<property name="scale" value="0.1"/><br />
<property name="min" value="0."/><br />
<property name="max" value="15."/><br />
<property name="size" value="50."/><br />
<property name="text" value="Bat(V)"/><br />
</papget><br />
The file is used lated by giving it to the gcs process:<br />
<br />
.../gcs -layout my_fancy_papgets.xml<br />
<br />
===Buttons===<br />
In the same way, user buttons from the strip can be dragged&dropped on the 2D map. However, they currently cannot be directly edited, and<br />
attributes changes have to be done in the XML file. Two types of button are provided to jump to a block or to set a value:<br />
<br />
<papget type="goto_block" display="button" x="10" y="300"><br />
<property name="block_name" value="Standby"/><br />
<property name="icon" value="home.png"/><br />
</papget><br />
<papget type="variable_setting" display="button" x="10" y="250"><br />
<property name="variable" value="launch"/><br />
<property name="value" value="1."/><br />
<property name="icon" value="launch.png"/><br />
</papget><br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=GCS&diff=5037GCS2009-05-15T07:17:10Z<p>HectoPascal: </p>
<hr />
<div>{|<br />
|-valign="top"<br />
|__TOC__<br />
|<br />
[[Image:gcs.jpg|frame|right|The Paparazzi Ground Control Station is the heart of the system and the user's primary interaction interface.]]<br />
|}<br />
<br />
== Strips ==<br />
<br />
Each A/C has an associated strip that displays information about the A/C and provides buttons for common commands. The strip has the following layout:<br />
<br />
[[Image:strip.png|Aircraft information strip]]<br />
<br />
=== Displayed information ===<br />
<br />
* Left: Flight information<br />
* Center: Navigation information<br />
* Right: Navigation control<br />
* Bottom: Custom navigation and setting buttons<br />
<br />
=== Actions ===<br />
<br />
Every change in the waypoints (position or/and altitude) must be confirmed with the dialog box that appears after the move. A modified waypoint remains animated on the map and the GCS continues to re-send the move request until confirmation is received from the aircraft.<br />
When clicked, the '''Mark''' button places a mark on the map at the A/C position. A snapshot from the video plugin is associated to this mark and can be viewed by moving the mouse over the mark. A click on the mark opens a dialog box allowing to delete the mark.<br />
A click on the colored bar at the top selects the corresponding A/C in the [[#notebook|Notebook]].<br />
<br />
== Map ==<br />
<br />
[[Image:GCSmap.png|thumb|400px|Sample map showing the various features]]<br />
<br />
=== Display ===<br />
<br />
The map display contains the following information:<br />
* The A/C track: it can be erased ''via'' the ''Clear track'' option from the A/C menu.<br />
* The A/C label (in clear blue near the A/C) contains the name of the A/C (Plaster), it's altitude (218 m) and it's ground speed (11.99 m/s). This option default is off. It can be activated with the ''A/C label'' option from the A/C menu.<br />
* The carrot (the orange triangle). This is the point the A/C is following during autonomous navigation.<br />
* The waypoints defined in the flight plan (blue diamonds).<br />
* The intended trajectory is shown in green (circling waypoint 2).<br />
* The default background is black. [[#google_tiles|Google tiles]] or [[Maps|user defined maps]] can be loaded to provide navigation reference.<br />
* The camera footprint (the grey polygon) is representative of the swath of land currently seen by the onboard camera. This option default is off. It can be activated with the ''Cam footprint'' option from the A/C menu.<br />
* The WGS84 coordinates of the mouse cursor are displayed at the top right hand corner (43.462019 1.270474).<br />
* A UTM kilometric grid can be added to the background ''via'' the ''UTM grid'' option from the ''Nav'' menu.<br />
* The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu displays the ground altitude of the mouse near the geographic position in the top right hand corner. The SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) must be copied to the <tt>data/srtm/</tt> directory. They can be downloaded from [ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3 ftp://e0srp01u.ecs.nasa.gov/srtm/version2/SRTM3].<br />
<br />
=== Navigation ===<br />
<br />
You can pan/zoom the map using the following:<br />
* Pan with the blue arrows on the map or use the arrow keys on the keyboard<br />
* zoom in/out with the mouse scroll wheel, the page up/page down buttons or the small up/down buttons at the top right hand corner where the zoom factor is displayed<br />
* fit the map to the window, in order to see all the waypoints and A/C, with the '''f''' key or the ''Fit'' option from the ''Nav'' menu;<br />
* center the map on an A/C with the ''Center A/C'' option from the corresponding A/C menu.<br />
<br />
=== Google Tiles ===<br />
<br />
The default black background can be automatically filled with calibrated satellite photo tiles from Google.<br />
<br><br />
See the [[Maps]] page for more info.<br />
<br />
=== Waypoint Editing ===<br />
<br />
The properties of any waypoint in the currently loaded flight plan can be modified by two methods:<br />
* Drag and drop the waypoints to a new location (a confirmation dialog will appear).<br />
* A single left click on a waypoint opens a dialog box where you can edit the waypoint's coordinates and altitude.<br />
<br />
Waypoint edits are sent to the aircraft immediately upon confirmation in the dialog box. The GCS will re-send the data and the waypoint will animate until the aircraft confirms receipt of the move request. New waypoints cannot be added during flight.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on waypoints.<br />
<br />
== Notebook ==<br />
<br />
The notebook frame contains one page for each running aircraft. Each aircraft page is itself divided into subpages displaying telemetry data and giving access to the autopilot tuning parameters.<br />
<br />
Note that the colored tabs at the top of this section allow the user to select among multiple aircraft.<br />
<br />
=== Flight Plan ===<br />
<br />
<center><br />
[[Image:GCSfp.png|Flight plan tree]]<br />
</center><br />
<br />
The full tree of the flight plan is given in this page. The current block and the current stage are highlighted. A double-click on a block allows the operator to immediately switch navigation to this block.<br />
<br><br />
See the [[Flight_Plans|Flight plans]] and [[Flight_Plan_Editor|Flight Plan Editor]] pages for more information on flight plans.<br />
<br />
=== Settings ===<br />
<center><br />
[[Image:GCSsettings.png|Settings tab]]<br />
</center><br />
The setting page allows the operator to change variable values during flight. The layout of the page is generated from the <tt>dl_settings</tt> section of the settings.xml file, one tab is associated to every section and sub-section.<br />
<br />
On each line is displayed (from left to right), the name of the variable, its current value (periodically sent by the A/C), a slider or radio buttons for user input, and commit/undo buttons.<br />
<br><br />
See the [[Telemetry#Settings|Telemetry]] page for more information on settings.<br />
<br><br />
The save button of this tab opens the following popup which proposes to the user to save the current values in the airframe file (according to the <tt>param</tt> attribute in the [[Telemetry#Settings|setttings]] configuration file). The values of the checked rows will be saved in the airframe file (or any other file) for further use. Units (e.g. deg or rad) are taken into account. '''It is recommended to backup the airframe file before overwriting it with this utility''' (even if time-stamped copy of the airframe file is actually automatically done).<br />
<br />
Symetrically, the Upload button of this dialog button will send all the checked values of the airframe file to the live aircraft.<br />
<center><br />
[[Image:Save settings.png|Settings tab]]<br />
</center><br />
<br />
=== PFD ===<br />
<br />
[[Image:GCSpfd.png|Primary Flight Display]]<br />
<br />
The Primary Flight Display contains an artificial horizon and two scales displaying the current ground speed (left side) and the altitude (right side). Minimum and maximum speeds are shown under and above the speed scale. A click on the scale resets these values to the current speed value.<br />
<br />
=== GPS, Infrared, Wind ===<br />
<br />
The '''GPS''' page gives the list of satellites tracked by the receiver and their respective signal strengths in dB.<br />
(35 is low, 45 is excellent) and if they are used to compute the fix (green: used, red:not used). This page may help to tune the position of the receiver on the aircraft relatively to other components (e.g. datalink and video transmitters).<br />
<br />
The '''Infrared''' page is only used for aircraft not equipped with the vertical infrared sensor. This page reports the required pre-flight calibration value as well as the evolution of the in-flight calibration correction factor (from hybridization with the GPS information).<br />
<br />
The '''Misc''' page displays the estimated wind velocity computed by the ground station during flight and relayed back to the aircraft. Wind velocity is estimated by vector addition of the GPS-measured ground speed in many different directions during level flight. This computation may soon be performed by the autopilot instead of the ground station.<br />
<br />
== Video Plugin ==<br />
<br />
The <tt>-mplayer</tt> option of GCS allows the user to display a video stream in this window. The video window can also be exchanged with the map by clicking anywhere inside the frame.<br />
Use the following line in your [[Control_panel.xml|control panel]] to enable the video window.<br />
<tt>path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video</tt><br />
<br />
== Altitude graph widget ==<br />
<center><br />
[[Image:altgraph.png|400px|The GCS with the altitude graph]]<br />
</center><br />
<br />
An altitude graph can be displayed in the GCS by adding the widget ''altgraph'' in the layout configuration (See the [[GCS_Configuration|GCS configuration]] page). An example is provided in conf/gcs/alt.xml (launch GCS with the option -layout alt.xml).<br />
<br />
== Papgets==<br />
Graphical objects can be added to 2D maps: text, rule, gauge, buttons, .... These objects are named ''papgets''.<br />
<br />
<center><br />
[[Image:papgets.png|516px|A 2D map augmented with papgets]]<br />
</center><br />
<br />
The easiest way to create a papget displaying telemetry data is to drag&drop a message field from the Messages window onto the 2D map of the GCS. The default rendering is then a text. A click on it then allows the user to change its kind (currently text, ruler or gauge) and some of its attributes (color, size, range for a gauge, format for a text ...). A papget can also be placed anywhere by simply dragging it.<br />
<br />
<center><br />
[[Image:papget_editor.png|Main characteristics of a papget can be dynamically edited]]<br />
</center><br />
<br />
to be continued ...<br />
<br />
== Alarms ==<br />
<br />
The alarm window displays a list of recent errors such as:<br />
* Low battery warning<br />
* Low altitude warning<br />
* Autopilot mode changes (i.e. Manual, Auto2)<br />
* Flight plan block changes<br />
<br />
== Configuration Options ==<br />
The GCS is highly configurable and modules can be added, removed, or resized as needed. In addition to this the gcs has many command line options which can be used when launching the GCS<br />
<br><br />
See the [[GCS_Configuration|GCS configuration]] page for details.<br />
<br />
== Flight Simulation ==<br />
Complex flight plans should always be carefully tested prior to flight. See the [[Simulation|simulation]] page for details.</div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Papget_editor.png&diff=5036File:Papget editor.png2009-05-14T20:45:50Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascalhttp://wiki.paparazziuav.org/w/index.php?title=File:Papgets.png&diff=5035File:Papgets.png2009-05-14T20:45:03Z<p>HectoPascal: </p>
<hr />
<div></div>HectoPascal