<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rcbrother</id>
	<title>PaparazziUAV - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rcbrother"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/Rcbrother"/>
	<updated>2026-04-29T17:13:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=4732</id>
		<title>DevGuide/Values</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=4732"/>
		<updated>2009-03-18T19:12:11Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* IR sensors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How do values travel through the system? =&lt;br /&gt;
&lt;br /&gt;
Make sure you have a ready built system when trying to analyze the&lt;br /&gt;
software. Some of the embedded code is generated from the xml&lt;br /&gt;
configuration files at build time. You can find that in the var folder&lt;br /&gt;
for the aircraft you are using.&lt;br /&gt;
&lt;br /&gt;
=== RC transmitter ===&lt;br /&gt;
The most important sensor. It gives stick movements from the safety&lt;br /&gt;
pilot to the aircraft. The values are derived from the angle of the&lt;br /&gt;
sticks or from position switches. The minimum configuration for a&lt;br /&gt;
Paparazzi transmitter is two sticks and one three-position switch for&lt;br /&gt;
manual, auto1 and auto2.&lt;br /&gt;
&lt;br /&gt;
The angle is usually given from -100% to 100% for full sweep and 0% for&lt;br /&gt;
the middle position. This are the min / max positions and values we use:&lt;br /&gt;
&lt;br /&gt;
[[Image:radio_robbe.jpg|Robbe transmitter]]&lt;br /&gt;
&lt;br /&gt;
RC transmitters generate a pulse-pause-modulation PPM signal from the&lt;br /&gt;
angles (proprietary PCM does not work with Paparazzi). The information&lt;br /&gt;
is in the length of a pulse. Usually a 1.5ms pulse is middle position&lt;br /&gt;
and 1ms equals -100% and 2ms 100%. The pulses are sent as a packet and&lt;br /&gt;
repeat at about 15ms rate The following shows a 9 channel transmitter (this is 10 pulses) and a decoded servo #1. Use RC_FUTABA in your airframe conf file if you see a signal like this (pulses go &amp;quot;high&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
[[Image:9ch_pulses.png|9 Channel PPM signal]]&lt;br /&gt;
&lt;br /&gt;
RC transmitter use slightly different timings for the middle and 100%&lt;br /&gt;
positions and have different directions. The conf/radio folder contains&lt;br /&gt;
the descriptions for the different transmitters. Here, also no trim&lt;br /&gt;
should be used. Give the repeat time of the PPM pulse and the number of&lt;br /&gt;
channels (you have one pulse more than channels!). The switches can be&lt;br /&gt;
filtered by a low pass filter through the &amp;quot;average&amp;quot; descriptor.&lt;br /&gt;
&lt;br /&gt;
=== RC receiver ===&lt;br /&gt;
The PPM signal is transmitted as FM signal and demodulated in your&lt;br /&gt;
receiver. The receiver demultiplexes the signals with a shift register&lt;br /&gt;
chip like 4015 or 4017 and gives it to servos. Paparazzi needs the&lt;br /&gt;
non-demultiplexed TTL level signal from the receiver. A good point to&lt;br /&gt;
grab that is the input of the shift register of the receiver (e.g. pin 1 of a 4015). Some newer receiver have microcontrollers which make it tricky to get the&lt;br /&gt;
signal.&lt;br /&gt;
&lt;br /&gt;
[[Image:rx_jeti.jpg|Jeti Rex 4 receiver]]&lt;br /&gt;
&lt;br /&gt;
The signal is low and goes high for the pulses in most cases, use&lt;br /&gt;
-DRADIO_CONTROL_TYPE=RC_FUTABA in your aircraft description file for&lt;br /&gt;
that. Some Graupner/JR receivers use inverted logic, use&lt;br /&gt;
-DRADIO_CONTROL_TYPE=RC_JR for them.&lt;br /&gt;
&lt;br /&gt;
=== Inside Paparazzi ===&lt;br /&gt;
&lt;br /&gt;
A normalized value is used for servo values within the Paparazzi&lt;br /&gt;
software. It ranges between MIN_PPRZ and MAX_PPRZ which is currently&lt;br /&gt;
-9600 and 9600. That is more than 14 bits resolution and a lot more&lt;br /&gt;
than what RC radios or servos can reproduce. Whenever a value is&lt;br /&gt;
calculated it should be trimmed to MIN and MAX by TRIM_PPRZ() or&lt;br /&gt;
TRIM_UPPRZ() for 0 and MAX bounds.&lt;br /&gt;
&lt;br /&gt;
=== ADC sensors ===&lt;br /&gt;
Analog voltages between 0 and 3.3V can be measured with the internal&lt;br /&gt;
Analog/Digital converters (this refers to the LPC/ARM7 architecture).&lt;br /&gt;
The values are sampled through a NB_SAMPLES stages long low pass&lt;br /&gt;
filter. Every ADC pin has to be activated for ADC usage individually for&lt;br /&gt;
flexible configuration.&lt;br /&gt;
&lt;br /&gt;
The resolution of the ADCs is 10 bits and that gives an integer value&lt;br /&gt;
between 0 and 1023 in the Paparazzi software. The values are converted&lt;br /&gt;
to more useful numbers for some sensors.&lt;br /&gt;
&lt;br /&gt;
=== IR sensors ===&lt;br /&gt;
The thermopiles give a voltage as a (nonlinear) function of the&lt;br /&gt;
roll/tilt angle. The angle is calculated using the information given in&lt;br /&gt;
the aircraft file (neutral value, sensor alignment relative to the&lt;br /&gt;
aircraft axes, correction for diversitiy in sensitivity). Angles are&lt;br /&gt;
used as [http://en.wikipedia.org/wiki/Radian radians] (360° = 2 * pi) for calculations. Some flight plan&lt;br /&gt;
values are given in degrees, though.&lt;br /&gt;
&lt;br /&gt;
=== SPI / I2C ===&lt;br /&gt;
Byte values can be read from SPI or I2C devices, e.g. to read data from&lt;br /&gt;
additional sensors.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
At the end servos have to be moved. The PPRZ values are converted to&lt;br /&gt;
-100% .. 100% servo movements. The aircraft configuration file&lt;br /&gt;
describes the relation between the min/max actuation and the 1.0ms -&lt;br /&gt;
2.0ms long pulse.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4728</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4728"/>
		<updated>2009-03-18T10:02:47Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML document using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4727</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4727"/>
		<updated>2009-03-18T10:01:35Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4726</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4726"/>
		<updated>2009-03-18T09:46:45Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Structure of the flight plan file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the DTD (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4725</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4725"/>
		<updated>2009-03-18T09:38:29Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Circle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the DTD (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the DTD:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4724</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4724"/>
		<updated>2009-03-18T09:37:38Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Stay */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the DTD (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the DTD:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAV fly clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4723</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4723"/>
		<updated>2009-03-18T09:37:11Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Xyz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the DTD (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the DTD:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAV fly clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAVs able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4722</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=4722"/>
		<updated>2009-03-18T09:36:58Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Follow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The formal description of the flight plan file is given in the DTD (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML file using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans in the GUI. &lt;br /&gt;
&lt;br /&gt;
== Structure of the flight plan file ==&lt;br /&gt;
&lt;br /&gt;
Extract from the DTD:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flight plan is composed of two compulsory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]] and typically contains optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and global &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan name lat0 lon0 ground alt security height qfu alt max_dist_from_home&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: the name of the mission (a text string)&lt;br /&gt;
* &amp;lt;tt&amp;gt;lat0, lon0&amp;lt;/tt&amp;gt;: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates&lt;br /&gt;
* &amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;: the ground altitude (in meters). It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used to define waypoint altitudes&lt;br /&gt;
* &amp;lt;tt&amp;gt;security_height&amp;lt;/tt&amp;gt;:  the altitude used by the circle-home failsafe procedure&lt;br /&gt;
* &amp;lt;tt&amp;gt;qfu&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. 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.&lt;br /&gt;
* &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt;: the default altitude of waypoints&lt;br /&gt;
* &amp;lt;tt&amp;gt;max_dist_from_home&amp;lt;/tt&amp;gt;: the maximum allowed distance (in meters) from the HOME waypoint.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the first line of a flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan name=&amp;quot;Example Muret&amp;quot;&lt;br /&gt;
   lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot;&lt;br /&gt;
   ground_alt=&amp;quot;185&amp;quot; security_height=&amp;quot;25&amp;quot; alt=&amp;quot;250&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Waypoints ===&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified with its name and its relative coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt; &amp;lt;waypoint name x y [alt] /&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are the coordinates in meters from point {0,0}. &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is optional and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; above.  Note that a waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required as it is used by the failsafe HOME mode procedure.&lt;br /&gt;
&lt;br /&gt;
One example:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;1&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;2&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Waypoints are easily edited with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
&lt;br /&gt;
Waypoints which name starts with an underscore are not displayed in the GCS, except in editor mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sectors ===&lt;br /&gt;
Flat ''Sectors'' can be described as a list of waypoint corners. Such an area will be displayed in the GCS.&lt;br /&gt;
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 &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;sector&amp;lt;/tt&amp;gt;, the generated function is &amp;lt;tt&amp;gt;bool_t InsideSector(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;sectors&amp;gt;&lt;br /&gt;
  &amp;lt;sector name=&amp;quot;Muret&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/sector&amp;gt;&lt;br /&gt;
 &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
it is then possible to write a exception to stay inside it:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMuret(estimator_x, estimator_y)&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Include ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure [x] [y] [rotate] &amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to jump to the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file. The&lt;br /&gt;
procedure can be shifted (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; meters east, &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; meters north) and &amp;lt;tt&amp;gt;rotate&amp;lt;/tt&amp;gt;d (clockwise degrees, north=0).&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;GROUND ALT+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;event1&amp;quot; to=&amp;quot;penta&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where a jump to &amp;lt;tt&amp;gt;event1&amp;lt;/tt&amp;gt; inside the &amp;lt;tt&amp;gt;hippo.xml&amp;lt;/tt&amp;gt; procedure will actually jump to the &amp;lt;tt&amp;gt;penta&amp;lt;/tt&amp;gt; block of the&lt;br /&gt;
current flight plan.&lt;br /&gt;
&lt;br /&gt;
=== Blocks ===&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
 &amp;lt;!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow&lt;br /&gt;
                           |survey_rectangle)*&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt; &amp;lt;/tt&amp;gt;&lt;br /&gt;
This button will activate the block.&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;block name=&amp;quot;ciclehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/block&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Expressions =====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; estimator_z)&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;(estimator_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; 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 &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;exceptions&amp;gt;&lt;br /&gt;
    &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Deroute ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
==== Loops ====&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
  &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/while&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, going to waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
In this example, we circle around '''HOME''' 10 seconds at height 50m, 10s at height 100m, ... until height 250m.&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
==== Navigation modes ====&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-win aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; 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.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
==== Attitude ====&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==== Heading ====&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(estimator_z &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Go ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Circle ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
A positive radius makes the UAV fly clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; 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:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(estimator_z-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Follow ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Stay ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAVs able to hover:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Xyz ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAV circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; 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):&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
==== Call ====&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; 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).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;call fun=&amp;quot;nav_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;call fun=&amp;quot;nav_line(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_init()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends).&lt;br /&gt;
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section)&lt;br /&gt;
 &amp;lt;tt&amp;gt;ap.srcs += nav_line.c&lt;br /&gt;
 sim.srcs += nav_line.c&amp;lt;/tt&amp;gt;&lt;br /&gt;
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;header&amp;gt;&lt;br /&gt;
 #include &amp;quot;nav_line.h&amp;quot;&lt;br /&gt;
 &amp;lt;/header&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
These C source file and H header file must be located in the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
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:&lt;br /&gt;
 &amp;lt;for var = &amp;quot;i&amp;quot; from = &amp;quot;1&amp;quot; to = &amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;circle wp = &amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt = &amp;quot;ground_alt+50*$i&amp;quot;&lt;br /&gt;
          until = &amp;quot;stage_time&amp;gt;60&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/for&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints and blocks. The header of a procedure may&lt;br /&gt;
contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, optional global exceptions and blocks:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT procedure (param*,waypoints,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan (a procedure cannot be included by another procedure). A procedure call requires:&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* the relative position and the orientation of the procedure in the flight plan;&lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name=&amp;quot;hippo1&amp;quot; procedure=&amp;quot;hippo.xml&amp;quot; x=&amp;quot;-100&amp;quot; y=&amp;quot;150&amp;quot; rotate=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;arg name=&amp;quot;alt&amp;quot; value=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;with from=&amp;quot;end&amp;quot; to=&amp;quot;landing&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''hippo.xml''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;procedure&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c1&amp;quot; x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;c2&amp;quot; x=&amp;quot;250&amp;quot; y=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;oneturn&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c1&amp;quot; from_qdr=&amp;quot;0&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c2&amp;quot; wp_qdr=&amp;quot;0&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c2&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(180)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;go hmode=&amp;quot;route&amp;quot; alt=&amp;quot;alt&amp;quot; from=&amp;quot;c2&amp;quot; from_qdr=&amp;quot;180&amp;quot; from_dist=&amp;quot;radius&amp;quot; wp=&amp;quot;c1&amp;quot; wp_qdr=&amp;quot;180&amp;quot; wp_dist=&amp;quot;radius&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle wp=&amp;quot;c1&amp;quot; radius=&amp;quot;radius&amp;quot; until=&amp;quot;Qdr(0)&amp;quot; alt=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;end&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
  &amp;lt;/blocks&amp;gt;&lt;br /&gt;
 &amp;lt;/procedure&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure block is then '''hippo1.oneturn''':&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;deroute block=&amp;quot;hippo1.oneturn&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
== Flight Simulation ==&lt;br /&gt;
Complex flight plans should always be carefully tested prior to flight.  See the [[Simulation|simulation]] page for details.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Compiling&amp;diff=4622</id>
		<title>Compiling</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Compiling&amp;diff=4622"/>
		<updated>2009-03-02T15:52:54Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Installing the UART tunnel for direct access to the GPS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Flight plans, tuning and configuration settings are compiled into a single binary image and transferred to the microcontroler flash rom through USB.  Most tuning and flight plan parameters can be changed in-flight but after each power cycle, the autopilot reverts to the original settings.  Permanent changes must be made in the source files, compiled, and uploaded to the autopilot.&lt;br /&gt;
&lt;br /&gt;
== Configuring Non-Root users to access USB ==&lt;br /&gt;
&lt;br /&gt;
Non-Root users typically do not have access to hardware I/O with USB ports included.  The user you are using to program the autpilots must be a member of the ''plugdev'' group. The original user login given during the Linux install process usually is a member. If not, add yourself to this group with the following command:&lt;br /&gt;
&lt;br /&gt;
  sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
It will be effective only on your next login or after the command&lt;br /&gt;
&lt;br /&gt;
   newgrp plugdev&lt;br /&gt;
&lt;br /&gt;
== USB flashing ==&lt;br /&gt;
&lt;br /&gt;
The Paparazzi device rules are required for USB flashing.  Copy them into place if you haven't already done so:&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
If you are using Ubuntu, the Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
[[Image:Tiny_test_wiring.jpg|thumb|Example wiring for programming and telemetry]]&lt;br /&gt;
If the autopilot senses a connected USB cable during power-on, it will wait to receive a firmware image rather than booting normally.  The firmware can be compiled and flashed by several means, '''the simplest way using the [[Paparazzi_Center|Paparazzi Center]]''', the traditionnal way being:&lt;br /&gt;
 make AIRCRAFT=''myplane'' clean_ac ap.upload&lt;br /&gt;
 (where ''myplane'' is the name of your airframe as defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
This command erases any compiled autopilot code from the PC, recompiles everything from scratch, and then sends it to the autopilot.  &lt;br /&gt;
Variations include:&lt;br /&gt;
* make AIRCRAFT=''myplane'' sim&lt;br /&gt;
*: Compiles your code for use in the simulator - note that &amp;quot;clean_ac&amp;quot; will remove this code, so the simulator code must be rebuilt each time a clean has been performed.&lt;br /&gt;
* make AIRCRAFT=''myplane'' fbw.upload&lt;br /&gt;
*: This is needed when configuring the separate &amp;quot;fly by wire&amp;quot; MCU on the [[Classix]] autopilot.&lt;br /&gt;
* make AIRCRAFT=''myplane'' ap&lt;br /&gt;
*: This will simply build the portions of autopilot code that have changed since the last compile without attempting to flash.  Note: this method may not detect certain changes (i.e. changes to the airframe makefile section or CVS updated code).&lt;br /&gt;
* make AIRCRAFT=''myplane'' ap.upload FLASH_MODE=IAP&lt;br /&gt;
*: Specifies USB flashing.  This should be specified at the top of the makefile section of your airframe file but can be overridden here.  Use FLASH_MODE=IAS for serial flashing.&lt;br /&gt;
&lt;br /&gt;
=== Verify that above downloads work ===&lt;br /&gt;
&lt;br /&gt;
==== Step 1 ====&lt;br /&gt;
&lt;br /&gt;
Connect the USB cable to the USB port (U23, corner of the board). You then typically should see feedback like:&lt;br /&gt;
&lt;br /&gt;
   ~/paparazzi3$ dmesg | tail -5&lt;br /&gt;
   [79212.484187] pl2303 1-2.3:1.0: device disconnected&lt;br /&gt;
   [82312.463077] usb 5-1: new high speed USB device using ehci_hcd and address 23&lt;br /&gt;
   [82327.555770] usb 5-1: device descriptor read/64, error -110&lt;br /&gt;
   [82342.752307] usb 5-1: device descriptor read/64, error -110&lt;br /&gt;
   [82342.968031] usb 5-1: new high speed USB device using ehci_hcd and address 24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which confirms that your device is powered up and visible. If not - check your power and connections. Failing that - prepare to download the USB Bootloader through the 'Download' connector. &lt;br /&gt;
&lt;br /&gt;
Above output is for the Tiny2.1.&lt;br /&gt;
&lt;br /&gt;
==== Step 2 ====&lt;br /&gt;
&lt;br /&gt;
Secondly - download some firmare (here we're using a modified [http://paparazzi.enac.fr/wiki/index.php/Using_demo_programs_in_sw/airborne-tiny2.1 demo2] - which flashes the LEDs with a Tiny2.1 board):&lt;br /&gt;
&lt;br /&gt;
   $ export PAPARAZZI_HOME=.. if needed... etc.&lt;br /&gt;
   $ make AIRCRAFT=DEMO demo2.upload&lt;br /&gt;
     make[1]: Leaving directory `/usr/share/paparazzi'&lt;br /&gt;
    cd sw/airborne; make PAPARAZZI_SRC=/usr/share/paparazzi PAPARAZZI_HOME=/home/dirkx/paparazzi3 TARGET=demo2 all&lt;br /&gt;
    make[1]: Entering directory `/usr/share/paparazzi/sw/airborne'&lt;br /&gt;
    /home/dirkx/paparazzi3/var/demo/demo2/demo2.elf  :&lt;br /&gt;
    section    size         addr&lt;br /&gt;
    .text       956        16384&lt;br /&gt;
    .ctors        0        17340&lt;br /&gt;
    .dtors        0        17340&lt;br /&gt;
    .data         0   1073741824&lt;br /&gt;
    .bss         12   1073741824&lt;br /&gt;
    .stack     4096   1073742080&lt;br /&gt;
    .comment     54            0&lt;br /&gt;
    Total      5118&lt;br /&gt;
    make[1]: Leaving directory `/usr/share/paparazzi/sw/airborne'&lt;br /&gt;
    cd sw/airborne; make PAPARAZZI_SRC=/usr/share/paparazzi PAPARAZZI_HOME=/home/dirkx/paparazzi3 TARGET=demo2 upload&lt;br /&gt;
    make[1]: Entering directory `/usr/share/paparazzi/sw/airborne'&lt;br /&gt;
    /usr/share/paparazzi/sw/ground_segment/lpc21iap/lpc21iap  /home/dirkx/paparazzi3/var/demo/demo2/demo2.elf&lt;br /&gt;
    .&lt;br /&gt;
    Found USB device&lt;br /&gt;
    BootROM code: 2.12&lt;br /&gt;
    Part ID: 0x0402FF25 (LPC2148, 512k Flash, 32k+8k RAM)&lt;br /&gt;
    BootLoader version: 1.3&lt;br /&gt;
    #&lt;br /&gt;
    Starting software at 0x00004000&lt;br /&gt;
    make[1]: Leaving directory `/usr/share/paparazzi/sw/airborne'&lt;br /&gt;
    make: Leaving directory `/usr/share/paparazzi'&lt;br /&gt;
    ~/paparazzi3$&lt;br /&gt;
&lt;br /&gt;
which confirms that your device has the bootloader functioning. The important bit of output is:&lt;br /&gt;
&lt;br /&gt;
    Found USB device&lt;br /&gt;
    BootROM code: 2.12&lt;br /&gt;
    Part ID: 0x0402FF25 (LPC2148, 512k Flash, 32k+8k RAM)&lt;br /&gt;
    BootLoader version: 1.3&lt;br /&gt;
    #&lt;br /&gt;
&lt;br /&gt;
Be aware that the demos involving serial ports do not currently work with Tiny V2's.&lt;br /&gt;
&lt;br /&gt;
==== Step 3 ====&lt;br /&gt;
&lt;br /&gt;
Observe the LEDs flashing.&lt;br /&gt;
&lt;br /&gt;
==== Step 4 ====&lt;br /&gt;
&lt;br /&gt;
Disconnect the usb cable, powercylce the unit - LEDs should flash again.&lt;br /&gt;
&lt;br /&gt;
==== Step 5 ====&lt;br /&gt;
&lt;br /&gt;
Select aircraft MJ5, build and upload.&lt;br /&gt;
&lt;br /&gt;
Select airframe funjet1.xml (if you have a Tiny V2)&lt;br /&gt;
&lt;br /&gt;
(Many thanks to hwarm for helping me figure this out.)&lt;br /&gt;
&lt;br /&gt;
Connect the serial port of your tiny to your PC using a level converter and select session Flight usb serial@9600.&lt;br /&gt;
&lt;br /&gt;
If you are using funjet1.xml:&lt;br /&gt;
*Stop all the processes but do not remove them.&lt;br /&gt;
*Edit the line Data Link and add &amp;quot;-s 57600&amp;quot; to the end, to tell the data link the baud rate of the MJ5.&lt;br /&gt;
*Restart Data Link, Server and GCS in that order.&lt;br /&gt;
&lt;br /&gt;
If all went well, it should work and you should see messages coming in from the Tiny!&lt;br /&gt;
&lt;br /&gt;
=== Installing the UART tunnel for direct access to the GPS ===&lt;br /&gt;
&lt;br /&gt;
Type the following command from your paparazzi folder, substituting the name of your airframe and paying attention to case sensitivity:&lt;br /&gt;
 make AIRCRAFT=''myplane'' tunnel.upload&lt;br /&gt;
Connect the usb cable and power on the autopilot to receive the code.&lt;br /&gt;
&lt;br /&gt;
* This completely replaces the normal autopilot code (leaving the USB bootloader intact) with a simple serial-to-serial pass-thru that essentially connects the GPS serial port directly to the modem serial port.  You will have no LED indicators or other autopilot functionality with this code.  Use this only to gain direct access to the GPS for testing/configuration with [[GPS#GPS_configuration_using_U-Center|U-Center]] or other software.&lt;br /&gt;
* This can be done without the USB bootloader by appending ''FLASH_MODE=ISP'' to the command line (specifing ISP serial loading).  This will require a serial cable connection (i.e. FTDI USB-to-TTL). '''WARNING!''' Installing tunnel code with the ISP method will erase any USB bootloader code. Make sure you are able to install a bootloader yourself.&lt;br /&gt;
&lt;br /&gt;
=== Installing the USB Bootloader ===&lt;br /&gt;
&lt;br /&gt;
The USB bootloader should only need to be installed once when the board is first built.  It is loaded through the serial interface UART0 (Serial1) by holding pin P0.14 low during power-up on Tiny V1.x. For Tiny V2.x this pin is called BOOT and also GPS_RESET has to be tied low during the serial programming to keep the GPS receiver quiet that shares the serial port with the download. If you were supplied with a Tiny Autopilot it may have already had the USB bootloader installed, please check with your supplier.&lt;br /&gt;
&lt;br /&gt;
You will need to convert the PC's RS232 Serial with voltage levels of +/-13V to 3.3V (or 5V) TTL in order to communicate directly with the device.  This can be accomplished in multiple ways.  The easiest and most convenient method is to purchase or build a USB -&amp;gt; Serial 3.3V adapter similar to this one [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm TTL-232R-3V3]&lt;br /&gt;
Here's a few other examples:&lt;br /&gt;
[http://www.sparkfun.com/commerce/product_info.php?products_id=199]&lt;br /&gt;
[http://www.sparkfun.com/commerce/product_info.php?products_id=718]&lt;br /&gt;
[http://www.pololu.com/products/pololu/0391/]&lt;br /&gt;
[http://www.hvwtech.com/products_view.asp?CatID=166&amp;amp;SubCatID=183&amp;amp;SubSubCatID=0&amp;amp;ProductID=409]&lt;br /&gt;
[http://shop.halfbase.com/product_info.php/products_id/54]&lt;br /&gt;
Users are strongly urged to use FTDI usb-serial converters as they are well supported by default in the linux kernel and since the Paparazzi ground station software is configured to look for modems on FTDI ports by default, the converter can likely serve as a modem interface after it's use in programming.&lt;br /&gt;
&lt;br /&gt;
Make up a wiring harness similar to the following.  You may vary the details however this is a working solution:&lt;br /&gt;
&lt;br /&gt;
 Tiny V1.x (SERIAL_1):&amp;lt;br /&amp;gt;&lt;br /&gt;
 TINY RXD0  &amp;lt;-- PC SERIAL TX (5V or 3.3V)&lt;br /&gt;
 TINY TXD0  --&amp;gt; PC SERIAL RX (5V or 3.3V)&lt;br /&gt;
 TINY P0.14 --&amp;gt; attach to ground, or wire through a pushbutton to ground&lt;br /&gt;
 TINY GND   --&amp;gt; PC SERIAL ADAPTER GND&lt;br /&gt;
 TINY RESET --&amp;gt; ''optional'' wired to ground through a pushbutton so you can reset&lt;br /&gt;
&lt;br /&gt;
 Tiny V2.x (DOWNLOAD):&amp;lt;br /&amp;gt;&lt;br /&gt;
 TINY LPC_RXD0  &amp;lt;-- PC SERIAL TX (5V or 3.3V)&lt;br /&gt;
 TINY LPC_TXD0  --&amp;gt; PC SERIAL RX (5V or 3.3V)&lt;br /&gt;
 TINY BOOT      --&amp;gt; attach to ground, or wire through a pushbutton to ground&lt;br /&gt;
 TINY GPS_RESET --&amp;gt; attach to ground, or wire through a pushbutton to ground&lt;br /&gt;
 TINY GND       --&amp;gt; PC SERIAL ADAPTER GND&lt;br /&gt;
&lt;br /&gt;
Once this wiring is ready you will be ready to send the USB Bootloader to the Tiny from the PC.&lt;br /&gt;
&lt;br /&gt;
To prepare the Tiny to accept programming over its serial port you must have pin P0.14 LOW for at least 3mS while it is powering up or resetting.  While it is still powered up it is ready to accept code over serial.  Proceed now to instructions to load it via software.&lt;br /&gt;
&lt;br /&gt;
'''In Linux'''&lt;br /&gt;
&lt;br /&gt;
From your paparazzi3 folder in linux, type:&lt;br /&gt;
&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
&lt;br /&gt;
This will begin compiling your USB Bootloader and then attempt to transfer it to the Autopilot. This will also assume you are using a USB -&amp;gt; Serial adapter for the connection.  It uses /dev/ttyUSB0 by default. If your adapter is mapped to a different tty, you will need to modify the Makefile accordingly.&lt;br /&gt;
&lt;br /&gt;
'''In Windows'''&lt;br /&gt;
&lt;br /&gt;
If for some reason you need to program your Tiny's USB Bootloader in windows grab a copy of [http://www.standardics.nxp.com/support/documents/microcontrollers/zip/flash.isp.utility.lpc2000.zip LPC2000 Flash Utility V2.2.3] or later.  You will then prepare the Tiny and boot it into the ISP bootloader as mentioned above but program it with this utility.  You will need to copy your compiled bl.hex file from Linux of course.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
As a rapidly evolving open-source project, on occasion your software may fail to compile after a [[Installation#Software_Updates|CVS Update]].  This is most likely due to a new or changed variable name that is now required in your airframe, flight plan, etc.  Since the user-configured files are not updated automatically you may need to view the most recently changed sample airframe or flight plan files to find the required changes.&amp;lt;br&amp;gt;&lt;br /&gt;
See the [[Software_Troubleshooting|Software Troubleshooting]] page for help with common compiliation errors.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4604</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4604"/>
		<updated>2009-03-01T12:33:09Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Infrared */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
=== Autopilot Only Commands ===&lt;br /&gt;
For certain missions it might be required to control servos (payload) from the autopilot (gcs) at all times (even during manual flight). These commands should not be in the &amp;lt;rc_commands&amp;gt; block but in the special &amp;lt;ap_only_commands&amp;gt; block. This allows for instance the pantilt operator to keep working when in manual flight, or safety logic to automatically close cameras below a certain altitude during manual landings.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ap_only_commands&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;PAN&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;TILT&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;SHOOT&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/ap_only_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the conformity between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
 ap.srcs += $(SRC_ARCH)/adc_hw.c&lt;br /&gt;
&lt;br /&gt;
==== ADC Generic ====&lt;br /&gt;
&lt;br /&gt;
In addition, if you want to receive the value of some ADC channel, you can use the &amp;quot;ADC Generic&amp;quot; service. When activated, the aircraft sends 2 values corresponding to the selected ADC channels. They can be read from the &amp;quot;Messages&amp;quot; application.&lt;br /&gt;
  ap.CFLAGS += -DUSE_ADC_GENERIC -DUSE_ADC_3 -DADC_CHANNEL_GENERIC1=ADC_3 -DUSE_ADC_4 -DADC_CHANNEL_GENERIC2=ADC_4&lt;br /&gt;
  ap.srcs += adc_generic.c&lt;br /&gt;
In this example, the ADC channels 3 and 4 are read and sent by telemetry at 4Hz:&lt;br /&gt;
  &amp;lt;message name=&amp;quot;ADC_GENERIC&amp;quot; ID=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val1&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val2&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
Only two channels can be defined. If only one is activated, 0 will send for the second value.&lt;br /&gt;
&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a '''pair''' of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''. In the aligned case, ir'''1''' is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir'''2''' along the longitudinal one. In the '''tilted''' case, the sensors are tilted by 45 degrees; ir'''1''' is along rear-left -- front-right, and ir'''2''' along rear-right -- front-left. The parameter &amp;quot;value&amp;quot; has no effect! If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.&lt;br /&gt;
&lt;br /&gt;
For help with orientation of '''Previous Versions of Infrared Sensor Boards''' try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_ALIGNED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  or&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
The old way to define the parameters is still possible, but must not be mixed with the new one describe above.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot; value=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;-0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;radians&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;-7500.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;-1500&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;-8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot; value=&amp;quot;1250&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''-0.4''', a roll of -0.4 (23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot; value=&amp;quot;.4&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot; value=&amp;quot;1000&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot; value =&amp;quot;12.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot; value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot; value&amp;quot;60&amp;quot; unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== Radio Control ===&lt;br /&gt;
The Paparazzi autpilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;br /&gt;
&lt;br /&gt;
If you have a Tiny v1.1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4015_MAT_hw.h\&amp;quot; -DSERVOS_4015_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you have a Tiny v2 or TWOG v1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4017_hw.h\&amp;quot; -DSERVOS_4017&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you want to output standard PPM to a R/C receiver:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_ppm_hw.h\&amp;quot; -DSERVOS_PPM_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_ppm_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
This is used in the case where you want to directly drive a receiver which has a microcontroller to do the decoding and driving of the servos (not a 4015 or 4017 decoder chip). The PPM is output on the SERV_CLK pin. The PPM frame rate, pulse width, and number of channels can be adjusted in the &amp;quot;servos_ppm_hw.h&amp;quot; file to suit your particular receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have a Classix Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM. &amp;quot;RC_FUTABA&amp;quot; is for the Futaba or compatible brands, and &amp;quot;RC_JR&amp;quot; for JR (a.k.a Graupner outside of the USA) or compatible brands.&lt;br /&gt;
&lt;br /&gt;
For the Classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times and also must match the ground modem rate, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string by adding the line &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt; (the parameter &amp;quot;value&amp;quot; has no effect), update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
And Finally use this in the makefile section&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600&lt;br /&gt;
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
By reading all the information above you should be able to infer what the above does.&lt;br /&gt;
&lt;br /&gt;
Now keep in mind that the ground modem baud rate and airplanes modem baud rates do not have to match. The only things that need to match are the the modem on the planes baud rate and the rate defined in the airframe file. For example this planes modem is set to 9600 and this could be used with the ground modem configured above using 57600... &lt;br /&gt;
Also for multiple UAV's a good way to configure them is to use 9600 for the ap and use a ground modem configured to 57600 and its not a bad idea to use minimal telemetry.&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If using the u-blox LEA-5H, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file in the gps section. This flag must be inserted above &amp;quot;ap.srcs += gps_ubx.c gps.c&amp;quot; for proper operation.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_USE_LATLONG&lt;br /&gt;
ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM&lt;br /&gt;
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4603</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4603"/>
		<updated>2009-03-01T12:07:32Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Infrared */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
=== Autopilot Only Commands ===&lt;br /&gt;
For certain missions it might be required to control servos (payload) from the autopilot (gcs) at all times (even during manual flight). These commands should not be in the &amp;lt;rc_commands&amp;gt; block but in the special &amp;lt;ap_only_commands&amp;gt; block. This allows for instance the pantilt operator to keep working when in manual flight, or safety logic to automatically close cameras below a certain altitude during manual landings.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ap_only_commands&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;PAN&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;TILT&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;SHOOT&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/ap_only_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the conformity between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
 ap.srcs += $(SRC_ARCH)/adc_hw.c&lt;br /&gt;
&lt;br /&gt;
==== ADC Generic ====&lt;br /&gt;
&lt;br /&gt;
In addition, if you want to receive the value of some ADC channel, you can use the &amp;quot;ADC Generic&amp;quot; service. When activated, the aircraft sends 2 values corresponding to the selected ADC channels. They can be read from the &amp;quot;Messages&amp;quot; application.&lt;br /&gt;
  ap.CFLAGS += -DUSE_ADC_GENERIC -DUSE_ADC_3 -DADC_CHANNEL_GENERIC1=ADC_3 -DUSE_ADC_4 -DADC_CHANNEL_GENERIC2=ADC_4&lt;br /&gt;
  ap.srcs += adc_generic.c&lt;br /&gt;
In this example, the ADC channels 3 and 4 are read and sent by telemetry at 4Hz:&lt;br /&gt;
  &amp;lt;message name=&amp;quot;ADC_GENERIC&amp;quot; ID=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val1&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val2&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
Only two channels can be defined. If only one is activated, 0 will send for the second value.&lt;br /&gt;
&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a pair of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''. In the aligned case, ir'''1''' is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir'''2''' along the longitudinal one. In the '''tilted''' case, the sensors are tilted by 45 degrees; ir'''1''' is along rear-left -- front-right, and ir'''2''' along rear-right -- front-left. The parameter &amp;quot;value&amp;quot; has no effect! If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.&lt;br /&gt;
&lt;br /&gt;
For help with orientation of '''Previous Versions of Infrared Sensor Boards''' try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_ALIGNED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  or&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
The old way to define the parameters is still possible, but must not be mixed with the new one describe above.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot; value=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;-0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;radians&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;-7500.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;-1500&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;-8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot; value=&amp;quot;1250&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''-0.4''', a roll of -0.4 (23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot; value=&amp;quot;.4&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot; value=&amp;quot;1000&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot; value =&amp;quot;12.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot; value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot; value&amp;quot;60&amp;quot; unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== Radio Control ===&lt;br /&gt;
The Paparazzi autpilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;br /&gt;
&lt;br /&gt;
If you have a Tiny v1.1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4015_MAT_hw.h\&amp;quot; -DSERVOS_4015_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you have a Tiny v2 or TWOG v1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4017_hw.h\&amp;quot; -DSERVOS_4017&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you want to output standard PPM to a R/C receiver:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_ppm_hw.h\&amp;quot; -DSERVOS_PPM_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_ppm_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
This is used in the case where you want to directly drive a receiver which has a microcontroller to do the decoding and driving of the servos (not a 4015 or 4017 decoder chip). The PPM is output on the SERV_CLK pin. The PPM frame rate, pulse width, and number of channels can be adjusted in the &amp;quot;servos_ppm_hw.h&amp;quot; file to suit your particular receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have a Classix Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM. &amp;quot;RC_FUTABA&amp;quot; is for the Futaba or compatible brands, and &amp;quot;RC_JR&amp;quot; for JR (a.k.a Graupner outside of the USA) or compatible brands.&lt;br /&gt;
&lt;br /&gt;
For the Classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times and also must match the ground modem rate, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string by adding the line &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt; (the parameter &amp;quot;value&amp;quot; has no effect), update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
And Finally use this in the makefile section&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600&lt;br /&gt;
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
By reading all the information above you should be able to infer what the above does.&lt;br /&gt;
&lt;br /&gt;
Now keep in mind that the ground modem baud rate and airplanes modem baud rates do not have to match. The only things that need to match are the the modem on the planes baud rate and the rate defined in the airframe file. For example this planes modem is set to 9600 and this could be used with the ground modem configured above using 57600... &lt;br /&gt;
Also for multiple UAV's a good way to configure them is to use 9600 for the ap and use a ground modem configured to 57600 and its not a bad idea to use minimal telemetry.&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If using the u-blox LEA-5H, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file in the gps section. This flag must be inserted above &amp;quot;ap.srcs += gps_ubx.c gps.c&amp;quot; for proper operation.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_USE_LATLONG&lt;br /&gt;
ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM&lt;br /&gt;
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Main_Page&amp;diff=4602</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Main_Page&amp;diff=4602"/>
		<updated>2009-03-01T09:39:22Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;border-spacing:8px;margin:0px -8px&amp;quot; class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot;| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#82add9;font-size:150%;font-weight:bold;border:1px solid #a3bfb1;text-align:center;color:#ffffff;padding:0.2em 0.4em;&amp;quot;&amp;gt;Welcome To Paparazzi&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[General|General]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{General}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Hardware|Hardware]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Hardware}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Software|Software]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Software}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Miscellaneous|Miscellaneous]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Miscellaneous}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of right-column --&amp;gt;&lt;br /&gt;
| class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:70%;border:1px solid #cedff2;background-color:#f5faff;vertical-align:top&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;background-color:#f5fffa&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;The Paparazzi Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000&amp;quot;|[http://www.nongnu.org/paparazzi/ Paparazzi] is a free and open-source hardware and software project intended to create an exceptionally powerful and versatile autopilot system by allowing and encouraging input from the community. The project includes not only the airborne hardware and software, from voltage regulators and GPS receivers to [http://en.wikipedia.org/wiki/Kalman_filtering Kalman filtering] code, but also a powerful and ever-expanding array of ground hardware and software including modems, antennas, and a highly evolved user-friendly ground control software interface.&lt;br /&gt;
|-&lt;br /&gt;
|All hardware and software is open-source and freely available to anyone under the [http://www.gnu.org GNU] licencing agreement. [[Get_Hardware| Several vendors]] are currently producing and selling Paparazzi autopilots and popular accessories, making the system easy and affordable to all.&lt;br /&gt;
|-&lt;br /&gt;
|The key feature of the paparazzi autopilot is its unique combination of infrared thermopiles and inertial measurement for attitude sensing, providing a robust and accurate attitude estimate that requires no ground calibration and can recover from any launch attitude.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;The Paparazzi project at ENAC&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|The Paparazzi mini [http://en.wikipedia.org/wiki/Unmanned_Aircraft_System UAS] project is now being used and developed at [http://www.enac.fr/ ENAC University].&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000&amp;quot;|&lt;br /&gt;
* A [http://www.debian.org debian] [http://www.recherche.enac.fr/paparazzi/debian/ repository] containing some packages not in the official distribution and required to run Paparazzi.&lt;br /&gt;
* PaparazziX [http://www.ubuntu.com/ Ubuntu] based live CD is available from the [http://www.recherche.enac.fr/paparazzi/paparazzix/ paparazzix directory].&lt;br /&gt;
* Nightly and release [http://www.recherche.enac.fr/paparazzi/tarball/ tarballs].&lt;br /&gt;
|}&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;background-color:#faf5ff;border:1px solid #ddcef2; text-align: justify;&amp;quot;&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;News&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;February 16th, 2009&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| We have a new forum to talk about this project. Please visit and participate http://www.azoreanuav.com/forum . Please, vote in the next link to continue with the forum or not. http://www.azoreanuav.com/forum/viewtopic.php?f=2&amp;amp;t=7 &lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;February 9th, 2009&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 ENAC students have released a Graphical control application for Paparazzi on Mobile phone using Java technoligies. Check the [[Ipodrom]] project page for more details.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;January 19, 2009&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;|&lt;br /&gt;
Paparazzi Developers,&amp;lt;br&amp;gt;&lt;br /&gt;
This is to announce a Call for Papers for the 2009 ASME/IEEE International Conference on Mechatronic and Embedded Systems and Applications (MESA09), part of ASME IDETC09. The conference is to be held August 30 - September 2, 2009 at  San Diego Convention Center.  This Call for Papers is specific to the Session chaired by myself, Antoine Drouin , and Anton Kochevar. This topic of this session is &amp;quot; Open Source UAV Autopilots: Status and Progression&amp;quot;, part of a symposium of MESA09 called &amp;quot;Small Unmanned Aerial Vehicle Technologies and Applications (SUAVTA)&amp;quot;. This Technical Session is meant to be a session that will focus on Paparazzi, the topics can include specific features developed for Paparazzi or applications using Paparazzi along with other innovative aspects or uses of Paparazzi. We hope to make this one of the largest and best conferences dealing with Paparazzi. Please help us to promote Paparazzi and bring this amazing project to even more people. Full paper deadline is Feb. 27, 2009 using the online submission system.&lt;br /&gt;
&lt;br /&gt;
Conference Website: https://www.asmeconferences.org/IDETC09/  (click MESA09, then, UAV Symposium, then this dedicated session) or http://iel.ucdavis.edu/mesa/MESA09/&lt;br /&gt;
&lt;br /&gt;
If you have any further questions please email me at&lt;br /&gt;
daniel.morgan @ aggiemail.usu.edu (remove spaces)&lt;br /&gt;
Research Associate, Center for Self-Organizing and Intelligent Systems at Utah State University&lt;br /&gt;
http://www.engr.usu.edu/wiki/index.php/User:CSOIS &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;September 23, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:motodrone_08u.JPG|thumb|left]]&lt;br /&gt;
A paparazzi team took part in the [http://motodrone.org/ Motodrone] event held in Finowfurt near Berlin.&amp;lt;br&amp;gt;&lt;br /&gt;
It was fun, the beer was cool and barbecues worked flawlessly. And we flew funjets...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://berlinvr.info/motodrone2008.html Video]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;June 23, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Targets auvsi 08.JPG|thumb|left]]  &lt;br /&gt;
The [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi team took 2nd place in the Sixth Annual Student Unmanned Aerial Systems Competition! The event is sponsored by AUVSI (Association for Unmanned Vehicle Systems International) and was held at Webster Field, St. Inigoes, Maryland. It should also be noted that this was Paparazzi's and the OSAM Paparazzi team's first time at the competition.&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.navair.navy.mil/pma263/seafarers/default.htm Link to competition]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://hjnews.townnews.com/articles/2008/07/12/news/news01.txt News Story]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;June 13, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Twog_v1-00_top_side_3.jpg|thumb|left|'''T'''iny '''W'''ith'''O'''ut '''G'''ps]]  &lt;br /&gt;
The new baby autopilot is born.&amp;lt;br&amp;gt;&lt;br /&gt;
His name is TWOG, he weighs 8 grams and is 40.2 x 30.5mm long. He' in good health and looks a lot like his mother Tiny v2, except for the GPS receiver.&amp;lt;br&amp;gt;&lt;br /&gt;
The proud parents invite you to visit the [[Twog_v1|pictures and technical information album]]...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;March 26, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Heli_deck.jpg|thumb|left|Funjet on the helicopter deck]]  &lt;br /&gt;
Scientists from the [http://web.gfi.uib.no/index_e.html Geophysical Institute of the University of Bergen/Norway] flew Paparazzi controlled [[media:Funjet_spitsbergen.jpg|Funjet]] aircrafts equipped with meteorological sensors in the Arctic sea around Spitsbergen only with the help of a RC safety pilot and no Paparazzi team member nearby. They took off and landed on the helicopter deck of the Norwegian icebreaking coast guard vessel [http://www.jtashipphoto.dk/JTA-W303%20Svalbard.htm KV Svalbard] for one week and set a new Paparazzi low temperature record by flying at around -20°C and 15m/s wind in altitudes up to 1500m. For another two weeks they also collected data on Spitsbergen near Longyearbyen. See pictures in the gallery and a [http://www.youtube.com/watch?v=VWEa_4Hlm2s video].&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;March 15, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Tiny_v2-1_3D_top.jpg|thumb|left|Tiny 2.11]]&lt;br /&gt;
A number of vendors are now offering assembled and unassembled autopilots, sensors and accessories.  The software is written, the hardware is built, what are you waiting for?  Getting started has never been easier!  More details on the [[Get_Hardware|Get Hardware]] page.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;February 6, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:eeePC.jpg|thumb|left|Paparazzi running on eeePC]]  &lt;br /&gt;
Looking for a small, light and cheap ground station ? Paparazzi runs on the [http://eeepc.asus.com ASUS eeePC] out of the box (after installing the Debian Paparazzi packages). Tested on the pre-installed Xandros distribution, on a standard Ubuntu and on the preconfigured [http://wiki.eeeuser.com/ubuntu:eeexubuntu:home eeeXubuntu].&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;January 27, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:StormTV.jpg|thumb|left|Paparazzi's Storm on TV in Turkey]]  [http://www.showtvnet.com/haber/playerd.asp?ptype=haber&amp;amp;product=/270108/ucak.wmv Storm on TV], A Paparazzi aircraft is featured on the biggest Television station in Turkey. (Sorry, the audio is only in Turkish...)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;[[News Archives]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;|&lt;br /&gt;
[[Image:One_Small_Step.jpg|thumb|left|[[News Archives]]]] [[News Archives|Browse the archives]] for a look back at the earlier days of Paparazzi.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4317</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4317"/>
		<updated>2009-01-07T20:18:02Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Software Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi sources are hosted by [http://savannah.nongnu.org/cvs/?group=paparazzi Savannah].&lt;br /&gt;
&lt;br /&gt;
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian based distributions ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following lines to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;) and then&lt;br /&gt;
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):&lt;br /&gt;
&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 # Uncomment just _one_ of the following lines - depending on your OS version&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; etch main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; lenny main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; gutsy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; hardy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; intrepid main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: It is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then, update your sources and '''either''' install the precompiled &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt;aries&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-bin&lt;br /&gt;
&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; the dependencies needed for recompiling from the source (&amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt;), and the cross-compiler (&amp;lt;b&amp;gt;arm7&amp;lt;/b&amp;gt;) :&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-dev&lt;br /&gt;
 sudo apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
As stated before it is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;. While the &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt; package is self-contained and should be sufficient for users who do not want to patch the code, the &amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt; meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional/Obsolete Packages ====&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
==== Extra for Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')&lt;br /&gt;
* Search for &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;paparazzi-arm7&amp;lt;/tt&amp;gt; packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
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&amp;amp;view=markup &amp;lt;tt&amp;gt; debian/control.etch&amp;lt;/tt&amp;gt;] file and may help users of other distributions.&lt;br /&gt;
&lt;br /&gt;
The binary packages and some corresponding source tarballs can be downloaded from&lt;br /&gt;
&lt;br /&gt;
 http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For Fedora (Core8) users, you can install the following packages from standard repository:&lt;br /&gt;
* ocaml.i386&lt;br /&gt;
* ocaml-camlimages-devel.i386&lt;br /&gt;
* ocaml-lablgtk-devel.i386&lt;br /&gt;
* ocaml-xml-light-devel.i386&lt;br /&gt;
* boa.i386&lt;br /&gt;
* libgnomecanvas-devel.i386&lt;br /&gt;
* libusb-devel.i386&lt;br /&gt;
* pcre-devel.i386&lt;br /&gt;
* arm-gp2x-linux-gcc.i386&lt;br /&gt;
* arm-gp2x-linux-binutils.i386&lt;br /&gt;
* glade2.i386&lt;br /&gt;
* and gcc, make, cvs, gnuplot, imagemagik...&lt;br /&gt;
&lt;br /&gt;
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:&lt;br /&gt;
* ivy-c&lt;br /&gt;
* ivy-c-dev&lt;br /&gt;
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/&amp;lt;version&amp;gt; vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/&amp;lt;version&amp;gt; to /usr/lib/ocaml)&lt;br /&gt;
* lpc21isp&lt;br /&gt;
&lt;br /&gt;
== Installing the Source Code (not needed with paparazzi-bin) ==&lt;br /&gt;
After the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package is installed the complete source code should be downloaded from the CVS repository.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From the directory of your choice type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into &amp;lt;tt&amp;gt;paparazzi3/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, dayly updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; package or the Live-CD, just launch the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; binary application and you will be guided through the installation of your personal configuration files.&lt;br /&gt;
&lt;br /&gt;
If you are using the source code, the first step is to compile it. From the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd paparazzi3&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;cvs update&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
}}&lt;br /&gt;
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:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
&lt;br /&gt;
== Setting access rights for USB download ==&lt;br /&gt;
&lt;br /&gt;
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;group&amp;quot; and then create a &amp;quot;rule&amp;quot;, associated with that &amp;quot;group&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Make yourself a member of the ''plugdev'' group:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
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 CVS 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 the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS 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.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
 &lt;br /&gt;
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[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. &lt;br /&gt;
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4316</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4316"/>
		<updated>2009-01-07T20:17:00Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Software Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi sources are hosted by [http://savannah.nongnu.org/cvs/?group=paparazzi Savannah].&lt;br /&gt;
&lt;br /&gt;
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian based distributions ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following lines to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;) and then&lt;br /&gt;
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):&lt;br /&gt;
&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 # Uncomment just _one_ of the following lines - depending on your OS version&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; etch main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; lenny main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; gutsy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; hardy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; intrepid main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: It is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then, update your sources and '''either''' install the precompiled &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt;aries&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-bin&lt;br /&gt;
&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; the dependencies needed for recompiling from the source (&amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt;), and the cross-compiler (&amp;lt;b&amp;gt;arm7&amp;lt;/b&amp;gt;) :&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-dev&lt;br /&gt;
 sudo apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
As stated before it is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;. While the &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt; package is self-contained and should be sufficient for users who do not want to patch the code, the &amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt; meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional/Obsolete Packages ====&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
==== Extra for Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')&lt;br /&gt;
* Search for &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;paparazzi-arm7&amp;lt;/tt&amp;gt; packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
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&amp;amp;view=markup &amp;lt;tt&amp;gt; debian/control.etch&amp;lt;/tt&amp;gt;] file and may help users of other distributions.&lt;br /&gt;
&lt;br /&gt;
The binary packages and some corresponding source tarballs can be downloaded from&lt;br /&gt;
&lt;br /&gt;
 http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For Fedora (Core8) users, you can install the following packages from standard repository:&lt;br /&gt;
* ocaml.i386&lt;br /&gt;
* ocaml-camlimages-devel.i386&lt;br /&gt;
* ocaml-lablgtk-devel.i386&lt;br /&gt;
* ocaml-xml-light-devel.i386&lt;br /&gt;
* boa.i386&lt;br /&gt;
* libgnomecanvas-devel.i386&lt;br /&gt;
* libusb-devel.i386&lt;br /&gt;
* pcre-devel.i386&lt;br /&gt;
* arm-gp2x-linux-gcc.i386&lt;br /&gt;
* arm-gp2x-linux-binutils.i386&lt;br /&gt;
* glade2.i386&lt;br /&gt;
* and gcc, make, cvs, gnuplot, imagemagik...&lt;br /&gt;
&lt;br /&gt;
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:&lt;br /&gt;
* ivy-c&lt;br /&gt;
* ivy-c-dev&lt;br /&gt;
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/&amp;lt;version&amp;gt; vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/&amp;lt;version&amp;gt; to /usr/lib/ocaml)&lt;br /&gt;
* lpc21isp&lt;br /&gt;
&lt;br /&gt;
== Installing the Source Code (not needed with paparazzi-bin) ==&lt;br /&gt;
After the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package is installed the complete source code should be downloaded from the CVS repository.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From the directory of your choice type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into &amp;lt;tt&amp;gt;paparazzi3/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, dayly updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; package or the Live-CD, just launch the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; binary application and you will be guided through the installation of your personal configuration files.&lt;br /&gt;
&lt;br /&gt;
If you are using the source code, the first step is to compile it. From the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd paparazzi3&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;cvs update&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
}}&lt;br /&gt;
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:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
&lt;br /&gt;
== Setting access rights for USB download ==&lt;br /&gt;
&lt;br /&gt;
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;group&amp;quot; and then create a &amp;quot;rule&amp;quot;, associated with that &amp;quot;group&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Make yourself a member of the ''plugdev'' group:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
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 CVS 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 the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS 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.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
 &lt;br /&gt;
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[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. &lt;br /&gt;
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4191</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4191"/>
		<updated>2008-12-01T22:59:50Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Installation from the Command Line */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi sources are hosted by [http://savannah.nongnu.org/cvs/?group=paparazzi Savannah].&lt;br /&gt;
&lt;br /&gt;
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian based distributions ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following lines to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;) and then&lt;br /&gt;
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):&lt;br /&gt;
&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 # Uncomment just _one_ of the following lines - depending on your OS version&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; etch main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; lenny main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; gutsy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; hardy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; intrepid main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: It is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then, update your sources and '''either''' install the precompiled &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt;aries&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-bin&lt;br /&gt;
&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; the dependencies needed for recompiling from the source (&amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt;), and the cross-compiler (&amp;lt;b&amp;gt;arm7&amp;lt;/b&amp;gt;) :&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-dev&lt;br /&gt;
 sudo apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
As stated before it is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;. While the &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt; package is self-contained and should be sufficient for users who do not want to patch the code, the &amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt; meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional/Obsolete Packages ====&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
==== Extra for Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')&lt;br /&gt;
* Search for &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;paparazzi-arm7&amp;lt;/tt&amp;gt; packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
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&amp;amp;view=markup &amp;lt;tt&amp;gt; debian/control.etch&amp;lt;/tt&amp;gt;] file and may help users of other distributions.&lt;br /&gt;
&lt;br /&gt;
The binary packages and some corresponding source tarballs can be downloaded from&lt;br /&gt;
&lt;br /&gt;
 http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For Fedora (Core8) users, you can install the following packages from standard repository:&lt;br /&gt;
* ocaml.i386&lt;br /&gt;
* ocaml-camlimages-devel.i386&lt;br /&gt;
* ocaml-lablgtk-devel.i386&lt;br /&gt;
* ocaml-xml-light-devel.i386&lt;br /&gt;
* boa.i386&lt;br /&gt;
* libgnomecanvas-devel.i386&lt;br /&gt;
* libusb-devel.i386&lt;br /&gt;
* pcre-devel.i386&lt;br /&gt;
* arm-gp2x-linux-gcc.i386&lt;br /&gt;
* arm-gp2x-linux-binutils.i386&lt;br /&gt;
* glade2.i386&lt;br /&gt;
* and gcc, make, cvs, gnuplot, imagemagik...&lt;br /&gt;
&lt;br /&gt;
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:&lt;br /&gt;
* ivy-c&lt;br /&gt;
* ivy-c-dev&lt;br /&gt;
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/&amp;lt;version&amp;gt; vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/&amp;lt;version&amp;gt; to /usr/lib/ocaml)&lt;br /&gt;
* lpc21isp&lt;br /&gt;
&lt;br /&gt;
== Installing the Source Code (not needed with paparazzi-bin) ==&lt;br /&gt;
After the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package is installed the complete source code should be downloaded from the CVS repository.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From the directory of your choice type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into &amp;lt;tt&amp;gt;paparazzi3/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, dayly updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; package or the Live-CD, just launch the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; binary application and you will be guided through the installation of your personal configuration files.&lt;br /&gt;
&lt;br /&gt;
If you are using the source code, the first step is to compile it. From the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd paparazzi3&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;cvs update&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
}}&lt;br /&gt;
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:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
&lt;br /&gt;
== Setting access rights for USB download ==&lt;br /&gt;
&lt;br /&gt;
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;group&amp;quot; and then create a &amp;quot;rule&amp;quot;, associated with that &amp;quot;group&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Make yourself a member of the ''plugdev'' group:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
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 CVS 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 the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS 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.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
 &lt;br /&gt;
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[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. &lt;br /&gt;
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4070</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4070"/>
		<updated>2008-09-28T12:21:30Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* LEA-5H */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots are designed around the popular [http://www.u-blox.com u-blox] brand of receivers.&lt;br /&gt;
&lt;br /&gt;
*Features:&lt;br /&gt;
**Small size&lt;br /&gt;
**Excellent performance&lt;br /&gt;
**4Hz position update rate&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' features an onboard LEA series GPS receiver and patch antenna, while '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]].  Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol.  The protocol is parsed in &amp;lt;tt&amp;gt;sw/airborne/gps_ubx.c&amp;lt;/tt&amp;gt;.  Other GPS brands would require a similar parsing file to be written for NMEA or other proprietary protocols.    &lt;br /&gt;
&lt;br /&gt;
==GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
===u-Blox LEA Series Receivers===&lt;br /&gt;
[[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]]&lt;br /&gt;
The '''[[Tiny]]''' and Paparazzi stand-alone GPS currently use the [http://www.u-blox.com/products/lea_4p.html u-blox LEA-4P] featuring [http://www.u-blox.com/technology/antaris4/index.html Antaris-4] technology and uBlox's more efficient UBX binary protocol.  This module is a surface mount package which is soldered directly onto the PCB (Tiny or Paparazzi GPS).  An external battery backup (capacitor) is used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition.  Any of the LEA-4x series receivers can be used including the less expensive LEA-4A and 4S models as the special boot configuration code required for these models is already written.&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
*Low position [http://paparazzi.enac.fr/wiki_images/Gps_rx_noise.pdf noise] figure&lt;br /&gt;
[[Image:TINY_1.3_MCU_BOTTOM.JPG|thumb|center|250px|LEA-4P installed on the Tiny]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Paparazzi Stand-alone GPS Receivers===&lt;br /&gt;
There are currently two (LEA-based) stand-alone, GPS receiver + antenna, prototype boards in development; the first one is based on the Sangshin 13mm patch antenna.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Ppzgps13_800.jpg|100px|thumb|right]]&lt;br /&gt;
 The second is based on the Sarantel helix antenna.  Drawings for both are available from the [http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/hw/ CVS]&lt;br /&gt;
Another alternative is the NAVILOCK NL-507TTL u-blox TTL Modul 60416 which is availible for 28€ (amazon.de).&lt;br /&gt;
&lt;br /&gt;
===u-Blox SAM-LS GPS Smart Antenna===&lt;br /&gt;
[[Image:Ublox_SAM-LS.jpg|100px|thumb|right|u-blox SAM-LS]]&lt;br /&gt;
The '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards use a stand alone module from u-blox called the SAM-LS. It is an integrated TIM-LP module with a ceramic patch antenna. This processor also runs on 4hz and must be configured to use the UBX protocol. With battery backup (3V watch battery) they show hot starts of around a couple seconds. The LEA-LA processor weighs a couple grams and the complete the SAM-LS module with antenna and shielding weighs about 20grams.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Effective 12/2006 u-blox has begun to phase out the SAM-LS product.  No replacement will be offered.&lt;br /&gt;
&lt;br /&gt;
====Connecting external receivers to Classix, 1.2.1, Lite, and RoboStix boards====&lt;br /&gt;
&lt;br /&gt;
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.  The Classix and Lite boards feature a 3.3V regulator to power the GPS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sourcing from u-blox===&lt;br /&gt;
&lt;br /&gt;
u-blox keeps tight control over the distribution of their products.  They must be obtained DIRECTLY from their own reseller offices.  These offices may not be available in your area, for example Canada does not have a reseller.  Sample quantities can be obtained from uBlox but overnight or 2 day shipping is required which drives the cost up considerably.  While it is a large hassle obtaining these devices, it is undoubtedly worth it.&lt;br /&gt;
&lt;br /&gt;
Talking with ublox sale for two years, Confirmed, that Order is possiable Directly from ublox, by knowing what project it was for &amp;amp; how was it to be use.  After long reply waiting time, the answer was: - YES,  but at least 2K-3K in volume, otherwise they're not interested.  Like to share the order ?  It is 500pcs/Roll.&lt;br /&gt;
&lt;br /&gt;
===Other potential source of u-blox GPS===&lt;br /&gt;
&lt;br /&gt;
There seems to be a few alternative source of u-blox GPS out there. They are considerably cheaper then the samples u-blox offers (at least in america). We didn't buy from these sources yet. Do not take this as a recommandation, we do not know the level of service they offer, etc.&lt;br /&gt;
&lt;br /&gt;
If you do order from any of them, please update this page with your feedback.&lt;br /&gt;
&lt;br /&gt;
Here's a few link worth exploring:&lt;br /&gt;
*http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp&lt;br /&gt;
*http://www.comet.srl.ro/shop/info.html?ID=6195 ( Link error )&lt;br /&gt;
*http://www.expedienttech.com/product.htm  ( Singapore ) &lt;br /&gt;
*http://shop.halfbase.com/index.php/cPath/22?osCsid=414472d5a544b080f9ae153fdc323798  ( B2B- min.10pcs @ $38 )&lt;br /&gt;
&lt;br /&gt;
===Standalone GPS Module from CVS===&lt;br /&gt;
The Version 1 (V1) BOM is here.. Please post any pics you might have and check this for accuracy&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|250px|thumb|right|LEA-5H Full Board Pinout]]&lt;br /&gt;
&lt;br /&gt;
If this needs fixing don't be shy, fix away.&lt;br /&gt;
&lt;br /&gt;
==GPS configuration using U-Center==&lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/products/u_center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note: You must [[Compiling#USB_flashing|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
* Note: You can run u-center on Linux by installing &amp;quot;wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and setting up com1 as /dev/ttyUSB0 See Info on wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.&lt;br /&gt;
* Note: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI.  Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun] or [http://shop.halfbase.com/product_info.php/products_id/54 Halfbase].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates.  Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accomodate the 4Hz update rate.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [http://paparazzi.enac.fr/wiki_images/Tiny_LEA-5H-v5.zip LEA-5H (For Use w/ Firmware V5 ONLY!)]&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 7. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 8. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 9. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. &lt;br /&gt;
    Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 7. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 (add the flag -DGPS_USE_LATLONG in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]]) also make sure you set tiny_2_1_1.h if you have the latest boards Tiny/TinyWOG)&lt;br /&gt;
 8. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH. Additionally, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file.&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===DGPS (Differential GPS)===&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.environmental-studies.de/Precision_Farming/EGNOS_WAAS__E/3E.html WAAS, EGNOS, and MSAS] though only WAAS is officially operational.  U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
====WAAS issues====&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification.  Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution.  Our advice is to completely disable WAAS.&lt;br /&gt;
&lt;br /&gt;
====EGNOS issues====&lt;br /&gt;
EGNOS is officially in &amp;quot;testing mode&amp;quot; and no claims of reliability are made.  The [http://www.u-blox.com/customersupport/faq_antaris u-blox FAQ] states the following:&lt;br /&gt;
* &amp;quot;Do you see issues with EGNOS?&amp;quot;&lt;br /&gt;
*:&amp;quot;Yes. Although the data transmitted by the EGNOS satellites are usually good and valuable (e.g. during the solar storms in autumn 2003), they can sometimes be very unreliable, for example when system tests are performed. As an example, u-blox has noticed erroneous range information (up to three hundred kilometers) on various EGNOS satellite over the last few months [2006].&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Further Reading===&lt;br /&gt;
&lt;br /&gt;
The u-blox [http://www.u-blox.com/customersupport/antaris4_doc.html System Integration Manual] covers a lot of GPS theory as well as product specific topics.&lt;br /&gt;
&lt;br /&gt;
== Antenna options for the Tiny and Paparazzi GPS units ==&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny|Tiny 1.1]]''' features a 28mm square ground plane intended to be centered below the [[#Sangshin_13mm_Patch|Sangshin 13mm patch antenna]].  Much better performance has been seen with the 18mm antennas and an augmented ground plane.  The ground plane is a critical part of the antenna affecting not only the gain and polarization characteristics but also the center frequency of the system.  Users are advised to expand the ground plane to approximately 36mm square, centered on the ceramic portion of the antenna (not the pin).  This can be done with copper foil soldered to the vias of the existing ground plane.&lt;br /&gt;
[[image:gps_antenna_comparison.jpg|thumb|500px|left|SAM-LS 25mm / Emtac 20mm / Emtac 18mm / Sangshin 18mm / Sangshin 13mm / Sarantel P2]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 18mm Patch ===&lt;br /&gt;
[[image:Sangshin_18mm.jpg|thumb|Sangshin 18mm x 4mm 1580Mhz]]&lt;br /&gt;
The Sangshin KSA-ST1580MS18 antenna has proven to offer the best performance of the currently available options.  These are available from any Sanshin distributor such as [http://www.rfmw.com rfmw] ([http://www.rfmw.com/PortalProductDetail.aspx?ProdId=232436&amp;amp;fmt=1 here]) and cost approximately $6.50/ea. in small quantities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EMTAC 18mm Patch ===&lt;br /&gt;
[[image:Emtac_18mm.jpg|thumb|Emtac 18mm x 4mm 1580Mhz]]&lt;br /&gt;
Offering identical performance to the Sangshin in a less attractive package is the Emtac 18mm antenna.  The part number for the standard 1580MHz 18x18x4mm is ANA1580T18D40 and is not listed on their website.  Other frequencies are available on a special order basis and the 1584Mhz has proven to outperform all other frequencies when used with a 36mm ground plane and no radome.  The use of a radome (any material covering the antenna) or a larger ground plane should theoretically favor even higher frequencies.&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* [http://www.transplantgps.com/modules.html TransplantGPS] in MN, USA.  The 1580Mhz models are usually available at a cost of $3.55ea but there may be a minimum order requirement of ~$50 USD.&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=43 PPZUAV] ~$10.00 USD (no min. order requirement)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 13mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Sangshin_13mm_onboard.jpg|thumb|Sangshin 13mm x 4mm 1580Mhz]]&lt;br /&gt;
Part of interest: '''[http://www.sangshinec.com/eng/patch_spec.htm KSA-ST1580MS13]'''&lt;br /&gt;
&lt;br /&gt;
The Tiny 0.99 (not 0.9) and 1.1 were designed around this antenna but users are advised to install 18mm units for better performance.&lt;br /&gt;
&lt;br /&gt;
Size: 13 x 13 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
Center Frequency: 1580 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
Bandwidth: 5 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
@Fo: -15 dB&amp;lt;br/&amp;gt;&lt;br /&gt;
GAIN (dBi): 0 dBi&amp;lt;br/&amp;gt;&lt;br /&gt;
Ground Plane: 50 x 50 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Available From'''&lt;br /&gt;
&lt;br /&gt;
[http://www.systroninc.com/ Systronic INC.] - Alberta, Canada&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emtac 20mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Salvaged_20mm_onboard.jpg|thumb|Emtac 20mm x 4mm]]&lt;br /&gt;
The Tiny 0.9 was designed around this 1583Mhz antenna and performed extremely well.  Emtac has replaced this with an 18mm model that they claim offers even better performance.&lt;br /&gt;
&lt;br /&gt;
* Obsolete&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sarantel GeoHelix-P2 ===&lt;br /&gt;
&lt;br /&gt;
[[image:Geohelix-p2.jpg|thumb|Sarantel Geohelix P-2 1575Mhz]]&lt;br /&gt;
&lt;br /&gt;
This antenna is popular among UAV designers due to it's natural rejection of other radio frequencies such as those originating from the modem or video system as well as it's improved rejection of signals reflected from the ground.  U-blox recommends this antenna and features it in their [http://www.u-blox.com/news/sarantel.html reference design].  Frequency and polarization are not dependent upon ground plane geometry so this antenna is sold only in the true GPS frequency of 1575Mhz.&lt;br /&gt;
The geometry makes this antenna very inconvenient to mount, especially in an airplane.  Some very non-scientific testing has been done with one of these antennas connected to a Tiny with a short length of 50 Ohm coax above a 120mm square of ungrounded aluminum foil and performance was adequate.  The helical design should theoretically outperform a patch in the air, but not on the ground, so any organized comparison will be difficult.  Possibly the most important aspect of this antenna is it's natural RFI filtering, which should be evaluated further.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sarantel.com/products/geohelix-p2 GeoHelix-P2] Passive GPS Antenna [[http://www.sarantel.com/downloads/specifications/geohelix-p2.pdf datasheet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* Sarantel @ cost of approx $18 USD each (active versions available for ~$40)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=40&amp;amp;osCsid=709e839698120c5cd324072b77d67cc1 PPZUAV]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4058</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4058"/>
		<updated>2008-09-19T10:25:20Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* LEA-5H */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots are designed around the popular [http://www.u-blox.com u-blox] brand of receivers.&lt;br /&gt;
&lt;br /&gt;
*Features:&lt;br /&gt;
**Small size&lt;br /&gt;
**Excellent performance&lt;br /&gt;
**4Hz position update rate&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' features an onboard LEA series GPS receiver and patch antenna, while '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]].  Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol.  The protocol is parsed in &amp;lt;tt&amp;gt;sw/airborne/gps_ubx.c&amp;lt;/tt&amp;gt;.  Other GPS brands would require a similar parsing file to be written for NMEA or other proprietary protocols.    &lt;br /&gt;
&lt;br /&gt;
==GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
===u-Blox LEA Series Receivers===&lt;br /&gt;
[[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]]&lt;br /&gt;
The '''[[Tiny]]''' and Paparazzi stand-alone GPS currently use the [http://www.u-blox.com/products/lea_4p.html u-blox LEA-4P] featuring [http://www.u-blox.com/technology/antaris4/index.html Antaris-4] technology and uBlox's more efficient UBX binary protocol.  This module is a surface mount package which is soldered directly onto the PCB (Tiny or Paparazzi GPS).  An external battery backup (capacitor) is used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition.  Any of the LEA-4x series receivers can be used including the less expensive LEA-4A and 4S models as the special boot configuration code required for these models is already written.&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
*Low position [http://paparazzi.enac.fr/wiki_images/Gps_rx_noise.pdf noise] figure&lt;br /&gt;
[[Image:TINY_1.3_MCU_BOTTOM.JPG|thumb|center|250px|LEA-4P installed on the Tiny]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Paparazzi Stand-alone GPS Receivers===&lt;br /&gt;
There are currently two (LEA-based) stand-alone, GPS receiver + antenna, prototype boards in development; the first one is based on the Sangshin 13mm patch antenna. The second is based on the Sarantel helix antenna.  Drawings for both are available from the [http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/hw/ CVS]&lt;br /&gt;
Another alternative is the NAVILOCK NL-507TTL u-blox TTL Modul 60416 which is availible for 28€ (amazon.de).&lt;br /&gt;
&lt;br /&gt;
===u-Blox SAM-LS GPS Smart Antenna===&lt;br /&gt;
[[Image:Ublox_SAM-LS.jpg|100px|thumb|right|u-blox SAM-LS]]&lt;br /&gt;
The '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards use a stand alone module from u-blox called the SAM-LS. It is an integrated TIM-LP module with a ceramic patch antenna. This processor also runs on 4hz and must be configured to use the UBX protocol. With battery backup (3V watch battery) they show hot starts of around a couple seconds. The LEA-LA processor weighs a couple grams and the complete the SAM-LS module with antenna and shielding weighs about 20grams.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Effective 12/2006 u-blox has begun to phase out the SAM-LS product.  No replacement will be offered.&lt;br /&gt;
&lt;br /&gt;
====Connecting external receivers to Classix, 1.2.1, Lite, and RoboStix boards====&lt;br /&gt;
&lt;br /&gt;
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.  The Classix and Lite boards feature a 3.3V regulator to power the GPS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sourcing from u-blox===&lt;br /&gt;
&lt;br /&gt;
u-blox keeps tight control over the distribution of their products.  They must be obtained DIRECTLY from their own reseller offices.  These offices may not be available in your area, for example Canada does not have a reseller.  Sample quantities can be obtained from uBlox but overnight or 2 day shipping is required which drives the cost up considerably.  While it is a large hassle obtaining these devices, it is undoubtedly worth it.&lt;br /&gt;
&lt;br /&gt;
Talking with ublox sale for two years, Confirmed, that Order is possiable Directly from ublox, by knowing what project it was for &amp;amp; how was it to be use.  After long reply waiting time, the answer was: - YES,  but at least 2K-3K in volume, otherwise they're not interested.  Like to share the order ?  It is 500pcs/Roll.&lt;br /&gt;
&lt;br /&gt;
===Other potential source of u-blox GPS===&lt;br /&gt;
&lt;br /&gt;
There seems to be a few alternative source of u-blox GPS out there. They are considerably cheaper then the samples u-blox offers (at least in america). We didn't buy from these sources yet. Do not take this as a recommandation, we do not know the level of service they offer, etc.&lt;br /&gt;
&lt;br /&gt;
If you do order from any of them, please update this page with your feedback.&lt;br /&gt;
&lt;br /&gt;
Here's a few link worth exploring:&lt;br /&gt;
*http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp&lt;br /&gt;
*http://www.comet.srl.ro/shop/info.html?ID=6195 ( Link error )&lt;br /&gt;
*http://www.expedienttech.com/product.htm  ( Singapore ) &lt;br /&gt;
*http://shop.halfbase.com/index.php/cPath/22?osCsid=414472d5a544b080f9ae153fdc323798  ( B2B- min.10pcs @ $38 )&lt;br /&gt;
&lt;br /&gt;
===Standalone GPS Module from CVS===&lt;br /&gt;
The Version 1 (V1) BOM is here.. Please post any pics you might have and check this for accuracy&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|250px|thumb|right|LEA-5H Full Board Pinout]]&lt;br /&gt;
&lt;br /&gt;
If this needs fixing don't be shy, fix away.&lt;br /&gt;
&lt;br /&gt;
==GPS configuration using U-Center==&lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/products/u_center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note: You must [[Compiling#USB_flashing|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
* Note: You can run u-center on Linux by installing &amp;quot;wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and setting up com1 as /dev/ttyUSB0 See Info on wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.&lt;br /&gt;
* Note: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI.  Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun] or [http://shop.halfbase.com/product_info.php/products_id/54 Halfbase].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates.  Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accomodate the 4Hz update rate.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [http://paparazzi.enac.fr/wiki_images/Tiny_LEA-5H-v5.zip LEA-5H (For Use w/ Firmware V5 ONLY!)]&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 7. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 8. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 9. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. Not that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 7. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 (add the flag -DGPS_USE_LATLONG in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]]) also make sure you set tiny_2_1_1.h if you have the latest boards Tiny/TinyWOG)&lt;br /&gt;
 8. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH. Additionally, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file.&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===DGPS (Differential GPS)===&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.environmental-studies.de/Precision_Farming/EGNOS_WAAS__E/3E.html WAAS, EGNOS, and MSAS] though only WAAS is officially operational.  U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
====WAAS issues====&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification.  Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution.  Our advice is to completely disable WAAS.&lt;br /&gt;
&lt;br /&gt;
====EGNOS issues====&lt;br /&gt;
EGNOS is officially in &amp;quot;testing mode&amp;quot; and no claims of reliability are made.  The [http://www.u-blox.com/customersupport/faq_antaris u-blox FAQ] states the following:&lt;br /&gt;
* &amp;quot;Do you see issues with EGNOS?&amp;quot;&lt;br /&gt;
*:&amp;quot;Yes. Although the data transmitted by the EGNOS satellites are usually good and valuable (e.g. during the solar storms in autumn 2003), they can sometimes be very unreliable, for example when system tests are performed. As an example, u-blox has noticed erroneous range information (up to three hundred kilometers) on various EGNOS satellite over the last few months [2006].&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Further Reading===&lt;br /&gt;
&lt;br /&gt;
The u-blox [http://www.u-blox.com/customersupport/antaris4_doc.html System Integration Manual] covers a lot of GPS theory as well as product specific topics.&lt;br /&gt;
&lt;br /&gt;
== Antenna options for the Tiny and Paparazzi GPS units ==&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny|Tiny 1.1]]''' features a 28mm square ground plane intended to be centered below the [[#Sangshin_13mm_Patch|Sangshin 13mm patch antenna]].  Much better performance has been seen with the 18mm antennas and an augmented ground plane.  The ground plane is a critical part of the antenna affecting not only the gain and polarization characteristics but also the center frequency of the system.  Users are advised to expand the ground plane to approximately 36mm square, centered on the ceramic portion of the antenna (not the pin).  This can be done with copper foil soldered to the vias of the existing ground plane.&lt;br /&gt;
[[image:gps_antenna_comparison.jpg|thumb|500px|left|SAM-LS 25mm / Emtac 20mm / Emtac 18mm / Sangshin 18mm / Sangshin 13mm / Sarantel P2]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 18mm Patch ===&lt;br /&gt;
[[image:Sangshin_18mm.jpg|thumb|Sangshin 18mm x 4mm 1580Mhz]]&lt;br /&gt;
The Sangshin KSA-ST1580MS18 antenna has proven to offer the best performance of the currently available options.  These are available from any Sanshin distributor such as [http://www.rfmw.com rfmw] ([http://www.rfmw.com/PortalProductDetail.aspx?ProdId=232436&amp;amp;fmt=1 here]) and cost approximately $6.50/ea. in small quantities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EMTAC 18mm Patch ===&lt;br /&gt;
[[image:Emtac_18mm.jpg|thumb|Emtac 18mm x 4mm 1580Mhz]]&lt;br /&gt;
Offering identical performance to the Sangshin in a less attractive package is the Emtac 18mm antenna.  The part number for the standard 1580MHz 18x18x4mm is ANA1580T18D40 and is not listed on their website.  Other frequencies are available on a special order basis and the 1584Mhz has proven to outperform all other frequencies when used with a 36mm ground plane and no radome.  The use of a radome (any material covering the antenna) or a larger ground plane should theoretically favor even higher frequencies.&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* [http://www.transplantgps.com/modules.html TransplantGPS] in MN, USA.  The 1580Mhz models are usually available at a cost of $3.55ea but there may be a minimum order requirement of ~$50 USD.&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=43 PPZUAV] ~$10.00 USD (no min. order requirement)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 13mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Sangshin_13mm_onboard.jpg|thumb|Sangshin 13mm x 4mm 1580Mhz]]&lt;br /&gt;
Part of interest: '''[http://www.sangshinec.com/eng/patch_spec.htm KSA-ST1580MS13]'''&lt;br /&gt;
&lt;br /&gt;
The Tiny 0.99 (not 0.9) and 1.1 were designed around this antenna but users are advised to install 18mm units for better performance.&lt;br /&gt;
&lt;br /&gt;
Size: 13 x 13 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
Center Frequency: 1580 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
Bandwidth: 5 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
@Fo: -15 dB&amp;lt;br/&amp;gt;&lt;br /&gt;
GAIN (dBi): 0 dBi&amp;lt;br/&amp;gt;&lt;br /&gt;
Ground Plane: 50 x 50 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Available From'''&lt;br /&gt;
&lt;br /&gt;
[http://www.systroninc.com/ Systronic INC.] - Alberta, Canada&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emtac 20mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Salvaged_20mm_onboard.jpg|thumb|Emtac 20mm x 4mm]]&lt;br /&gt;
The Tiny 0.9 was designed around this 1583Mhz antenna and performed extremely well.  Emtac has replaced this with an 18mm model that they claim offers even better performance.&lt;br /&gt;
&lt;br /&gt;
* Obsolete&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sarantel GeoHelix-P2 ===&lt;br /&gt;
&lt;br /&gt;
[[image:Geohelix-p2.jpg|thumb|Sarantel Geohelix P-2 1575Mhz]]&lt;br /&gt;
&lt;br /&gt;
This antenna is popular among UAV designers due to it's natural rejection of other radio frequencies such as those originating from the modem or video system as well as it's improved rejection of signals reflected from the ground.  U-blox recommends this antenna and features it in their [http://www.u-blox.com/news/sarantel.html reference design].  Frequency and polarization are not dependent upon ground plane geometry so this antenna is sold only in the true GPS frequency of 1575Mhz.&lt;br /&gt;
The geometry makes this antenna very inconvenient to mount, especially in an airplane.  Some very non-scientific testing has been done with one of these antennas connected to a Tiny with a short length of 50 Ohm coax above a 120mm square of ungrounded aluminum foil and performance was adequate.  The helical design should theoretically outperform a patch in the air, but not on the ground, so any organized comparison will be difficult.  Possibly the most important aspect of this antenna is it's natural RFI filtering, which should be evaluated further.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sarantel.com/products/geohelix-p2 GeoHelix-P2] Passive GPS Antenna [[http://www.sarantel.com/downloads/specifications/geohelix-p2.pdf datasheet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* Sarantel @ cost of approx $18 USD each (active versions available for ~$40)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=40&amp;amp;osCsid=709e839698120c5cd324072b77d67cc1 PPZUAV]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Communications&amp;diff=4053</id>
		<title>DevGuide/Communications</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Communications&amp;diff=4053"/>
		<updated>2008-09-15T15:16:14Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* The &amp;quot;transport&amp;quot; layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the way the communications with the aircrafts are implemented in paparazzi&lt;br /&gt;
&lt;br /&gt;
We'll start with high level stuff such as sending your own telemetry message or datalink (uplink) message. We'll then look at the lower layers&lt;br /&gt;
== sending telemetry message ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Describe your message in the telemetry section in &amp;lt;tt&amp;gt;conf/messages.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should looks like this &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;message name=&amp;quot;MARK&amp;quot; id=&amp;quot;32&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;field name=&amp;quot;ac_id&amp;quot; type=&amp;quot;uint8&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;field name=&amp;quot;lat&amp;quot; type=&amp;quot;float&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;field name=&amp;quot;long&amp;quot; type=&amp;quot;float&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/message&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''id''' has to be unique. The fields can have type '''int8''', '''int16''', '''int32''', '''uint8''', '''uint16''', '''uint32''', '''float''' and arrays of those. They must be aligned on a multiple of their size (c.f. examples with ''pad'' fields).&lt;br /&gt;
&lt;br /&gt;
This enables all the ground system to deal with your message and generate sending code for the airborne system. The code is generated in &amp;lt;tt&amp;gt;var/include/messages.h&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
From the airborne code you can send the message by using this code, for example&lt;br /&gt;
&lt;br /&gt;
 DOWNLINK_SEND_MARK(&amp;amp;mark_id, &amp;amp;mark_lat, &amp;amp;mark_long);&lt;br /&gt;
 &lt;br /&gt;
You can also have the autopilot send the message periodically.&lt;br /&gt;
For doing that, in your telemetry file (for example &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;,  you can make your own and reference it in the [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] file). You can add a line like&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;message name=&amp;quot;MARK&amp;quot; period=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
meaning that '''MARK''' will be sent every second. You then need to specify the arguments to your message in &amp;lt;tt&amp;gt;the sw/airborne/ap_downlink.h&amp;lt;/tt&amp;gt; header by providing a macro &lt;br /&gt;
&lt;br /&gt;
 #define PERIODIC_SEND_MARK() DOWNLINK_SEND_MARK(&amp;amp;mark_id, &amp;amp;mark_lat, &amp;amp;mark_long)&lt;br /&gt;
&lt;br /&gt;
You can have different telemetry modes having different rates for each message. For example you might want a verbose mode and a stealth mode.&lt;br /&gt;
&lt;br /&gt;
When sent by the aircraft the message will be available on the ground ivy bus. You can watch it using the '''messages''' program or with the &amp;lt;tt&amp;gt;ivyprobe&amp;lt;/tt&amp;gt; command line.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;sw/ground_segment/cockpit/ant_track.c&amp;lt;/tt&amp;gt; shows how to receive a message in a C program&lt;br /&gt;
For ocaml, we have a higher level library to receive messages (&amp;lt;tt&amp;gt;sw/lib/ocaml/pprz.ml&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Adding datalink (uplink) messages ==&lt;br /&gt;
&lt;br /&gt;
This is similar to the above. Add your message in the &amp;lt;tt&amp;gt;datalink&amp;lt;/tt&amp;gt; section of &amp;lt;tt&amp;gt;messages.xml&amp;lt;/tt&amp;gt;&lt;br /&gt;
This will generate parsing code for the airborne program (&amp;lt;tt&amp;gt;var/include/dl_protocol.h&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
You then can add your handler in the &amp;lt;tt&amp;gt;sw/airborne/datalink.c&amp;lt;/tt&amp;gt; code (a way should be fined to include external code in that) or you can just rewrite your own &amp;lt;tt&amp;gt;dl_parse_msg()&amp;lt;/tt&amp;gt; function, for example in a test program where you want to receive only your own messages.&lt;br /&gt;
&lt;br /&gt;
== The &amp;quot;transport&amp;quot; layer ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi can use the built-in transport layer of different hardware (currently only wavecards and xbee/xtends) and also provides his own layer for hardware lacking it (showing as remote serial ports). C sourcecode (.c) and belonging header (.h) -files are:&lt;br /&gt;
&amp;lt;tt&amp;gt;xbee.c, xbee.h&amp;lt;/tt&amp;gt; &lt;br /&gt;
and &lt;br /&gt;
&amp;lt;tt&amp;gt;pprz_transport.c, pprz_transport.h&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=4052</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=4052"/>
		<updated>2008-09-15T13:09:10Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Pinout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilot features a 5V tolerant 3V TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Modem|Airframe Configuration]] page.&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4Ghz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~32$&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The image view is from above, top, thus NOT at the side where the connector pins come out&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro XSC 900Mhz ==&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4Ghz video compatibility of their high end 900Mhz models.  Sounds like the perfect modem for anyone who can use 900Mhz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz&lt;br /&gt;
* Output Power 100mW&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* Data Rate: 9600 bps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 24km (15 miles) line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~75 USD&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
== Maxstream 9XTend ==&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side, about 20 grams, but give good performance at range.  They have adjustable power settings from 100mW to 1W.  Testing has shown range up to 3.2km (2 miles) with 100mW.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : ~179 USD&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||N/A (requires 5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||N/A (requires 5V)||Permanently connect this pin to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
== Aerocomm ==&lt;br /&gt;
Aerocomm's API mode is not yet implemented. Therefore they are used in transparent mode. Users are reporting these modems cause more interference with GPS reception then the Maxstream modem.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4868-250 ===&lt;br /&gt;
* Frequency Band 868MHz (For Europe).&lt;br /&gt;
* Output Power (w/ 2dBi antenna) 250 mW &lt;br /&gt;
* Sensitivity (@ full RF data rate) -103 dB &lt;br /&gt;
* RF Data Rate Up to 28.8 Kbps &lt;br /&gt;
* INterface Data Rate Up to 57.6 Kbps &lt;br /&gt;
* Power Draw (typical) 240 mA TX / 36 mA RX &lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5V or 3.3v only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 kilometers line-of-sight &lt;br /&gt;
* Dimensions 49 x 42 x 5mm &lt;br /&gt;
* Weight &amp;lt; 21 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector &lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ConnexLink_USB_RF_Modem.jpg|thumb|Aerocomm USB Stand-alone Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Aerocomm AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Aerocomm AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Aerocomm AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm AC4790 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4790_HI.pdf AC4790 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4790.pdf AC4790 Manual]&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4868_868mhz_rf_transceiver.htm AC4848 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4868_HI.pdf AC4868 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4868.pdf AC4868 user manual]&lt;br /&gt;
&lt;br /&gt;
== Radiotronix ==&lt;br /&gt;
These Radiotronix modems are used in transparent mode. Use the WI232EUR Evaluation Software for configuring the modems for the set speed. Connect /CMD and CTS for programming. The DTS version for the US market might cause severe interference with GPS reception, it is not recommended. For a nice ground station modem just add a FTDI232 USB-&amp;gt;serial cable, a 3.3V regulator with 100nF capacitors from supplies to ground, solder a SMA cable/connector and put it in a nice case. Make sure you only connect RTS to /CMD if you want to reprogram the modem with the Evaluation software (see the open jumper connection in the picture, green wire) and leave it floating otherwise. The ANT-GXD105-FME/F from [http://www.roundsolutions.com Roundsolutions] was used as a ground station antenna at many competitions.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== WI232EUR ===&lt;br /&gt;
* Frequency Band 868MHz (for Europe)&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate Up to 76.8 kbps &lt;br /&gt;
* Interface Data Rate up to 115.2 kbps &lt;br /&gt;
* Power Draw (typical) 65 mA TX / 20 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 500 meters line-of-sight &lt;br /&gt;
* Dimensions 24 x 21 x 4mm &lt;br /&gt;
* Weight ~2 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* Antenna solder connector &lt;br /&gt;
* price : ~25$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_wiring.jpg|thumb|WI232EUR Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the WI232EUR to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''WI232 pins'''''||'''''Name'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||6||TxD||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||RxD||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||15-18||GND||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||19||VCC||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||4||/CMD||-||''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||7||CTS||-||''(Note 3)''&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the Radiotronix module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : connect to RTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
''Note 3 : connect to CTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_bopla.jpg|thumb|WI232EUR Modem in BOPLA case]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/eur_um.pdf WI232EUR data sheet]&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/rk-eur_um.pdf WI232EUR user's manual]&lt;br /&gt;
* [http://www.radiotronix.com/downloads/software/EUR/setup.exe Evaluation software]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== &amp;quot;Sparkfun&amp;quot; Roving Networks (WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : ~45$&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
and make a virtual connection to a Bluetooth serial port&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0  00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as /dev/rfcomm0 with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Coronis WaveCard ==&lt;br /&gt;
&lt;br /&gt;
These relatively inexpensive and light modules implement a Coronis proprietary protocol. Low power consumption - high latency - I would not recommend these modules mostly because of the low quality of the distribution and support. The documentation is rather poor and not easily available.&lt;br /&gt;
&lt;br /&gt;
'''Suport for these modems has been removed from the airborne code on Dec 10th, 2007.'''&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 400MHz, 868Mhz and 915MHz (3 versions)&lt;br /&gt;
* Output Power 25mW and 500mW (2 versions)&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* Data Rate 100 Kbps&lt;br /&gt;
* Power Draw (typical) 45mA (25mW), 450mA (500mW) TX / 15 mA RX &lt;br /&gt;
* Supply Voltage ...&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1km (25mW) , 5km (500mW) line-of-sight &lt;br /&gt;
* Dimensions 30 x 28 x 7mm (25mW), 37 x 30 x 7mm (500mW)&lt;br /&gt;
* 50 ohm RF port for antenna connection&lt;br /&gt;
|&lt;br /&gt;
[[Image:wavecard.jpg|Coronis Wavecard]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.coronis-systems.com/produit.php?lang=EN&amp;amp;id=WCA  www.coronis-systems.com]&lt;br /&gt;
* [[Media:CS-COM-SPRD-WAVECARD-E03B.pdf|Wavecard datasheet]]&lt;br /&gt;
&lt;br /&gt;
== Video Transmitter Telemetry ==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, a video transmitter is needed.  The paparazzi AP sends all telemetry data down with the video on the audio channel portion of the transmitter.  This means that the transmitter must have an audio channel.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different.  &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4051</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4051"/>
		<updated>2008-09-14T14:13:17Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* GPS configuration using U-Center */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots are designed around the popular [http://www.u-blox.com u-blox] brand of receivers.&lt;br /&gt;
&lt;br /&gt;
*Features:&lt;br /&gt;
**Small size&lt;br /&gt;
**Excellent performance&lt;br /&gt;
**4Hz position update rate&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' features an onboard LEA series GPS receiver and patch antenna, while '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]].  Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol.  The protocol is parsed in &amp;lt;tt&amp;gt;sw/airborne/gps_ubx.c&amp;lt;/tt&amp;gt;.  Other GPS brands would require a similar parsing file to be written for NMEA or other proprietary protocols.    &lt;br /&gt;
&lt;br /&gt;
==GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
===u-Blox LEA Series Receivers===&lt;br /&gt;
[[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]]&lt;br /&gt;
The '''[[Tiny]]''' and Paparazzi stand-alone GPS currently use the [http://www.u-blox.com/products/lea_4p.html u-blox LEA-4P] featuring [http://www.u-blox.com/technology/antaris4/index.html Antaris-4] technology and uBlox's more efficient UBX binary protocol.  This module is a surface mount package which is soldered directly onto the PCB (Tiny or Paparazzi GPS).  An external battery backup (capacitor) is used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition.  Any of the LEA-4x series receivers can be used including the less expensive LEA-4A and 4S models as the special boot configuration code required for these models is already written.&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
*Low position [http://paparazzi.enac.fr/wiki_images/Gps_rx_noise.pdf noise] figure&lt;br /&gt;
[[Image:TINY_1.3_MCU_BOTTOM.JPG|thumb|center|250px|LEA-4P installed on the Tiny]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Paparazzi Stand-alone GPS Receivers===&lt;br /&gt;
There are currently two (LEA-based) stand-alone, GPS receiver + antenna, prototype boards in development; the first one is based on the Sangshin 13mm patch antenna. The second is based on the Sarantel helix antenna.  Drawings for both are available from the [http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/hw/ CVS]&lt;br /&gt;
Another alternative is the NAVILOCK NL-507TTL u-blox TTL Modul 60416 which is availible for 28€ (amazon.de).&lt;br /&gt;
&lt;br /&gt;
===u-Blox SAM-LS GPS Smart Antenna===&lt;br /&gt;
[[Image:Ublox_SAM-LS.jpg|100px|thumb|right|u-blox SAM-LS]]&lt;br /&gt;
The '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards use a stand alone module from u-blox called the SAM-LS. It is an integrated TIM-LP module with a ceramic patch antenna. This processor also runs on 4hz and must be configured to use the UBX protocol. With battery backup (3V watch battery) they show hot starts of around a couple seconds. The LEA-LA processor weighs a couple grams and the complete the SAM-LS module with antenna and shielding weighs about 20grams.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Effective 12/2006 u-blox has begun to phase out the SAM-LS product.  No replacement will be offered.&lt;br /&gt;
&lt;br /&gt;
====Connecting external receivers to Classix, 1.2.1, Lite, and RoboStix boards====&lt;br /&gt;
&lt;br /&gt;
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.  The Classix and Lite boards feature a 3.3V regulator to power the GPS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sourcing from u-blox===&lt;br /&gt;
&lt;br /&gt;
u-blox keeps tight control over the distribution of their products.  They must be obtained DIRECTLY from their own reseller offices.  These offices may not be available in your area, for example Canada does not have a reseller.  Sample quantities can be obtained from uBlox but overnight or 2 day shipping is required which drives the cost up considerably.  While it is a large hassle obtaining these devices, it is undoubtedly worth it.&lt;br /&gt;
&lt;br /&gt;
Talking with ublox sale for two years, Confirmed, that Order is possiable Directly from ublox, by knowing what project it was for &amp;amp; how was it to be use.  After long reply waiting time, the answer was: - YES,  but at least 2K-3K in volume, otherwise they're not interested.  Like to share the order ?  It is 500pcs/Roll.&lt;br /&gt;
&lt;br /&gt;
===Other potential source of u-blox GPS===&lt;br /&gt;
&lt;br /&gt;
There seems to be a few alternative source of u-blox GPS out there. They are considerably cheaper then the samples u-blox offers (at least in america). We didn't buy from these sources yet. Do not take this as a recommandation, we do not know the level of service they offer, etc.&lt;br /&gt;
&lt;br /&gt;
If you do order from any of them, please update this page with your feedback.&lt;br /&gt;
&lt;br /&gt;
Here's a few link worth exploring:&lt;br /&gt;
*http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp&lt;br /&gt;
*http://www.comet.srl.ro/shop/info.html?ID=6195 ( Link error )&lt;br /&gt;
*http://www.expedienttech.com/product.htm  ( Singapore ) &lt;br /&gt;
*http://shop.halfbase.com/index.php/cPath/22?osCsid=414472d5a544b080f9ae153fdc323798  ( B2B- min.10pcs @ $38 )&lt;br /&gt;
&lt;br /&gt;
===Standalone GPS Module from CVS===&lt;br /&gt;
The Version 1 (V1) BOM is here.. Please post any pics you might have and check this for accuracy&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|250px|thumb|right|LEA-5H Full Board Pinout]]&lt;br /&gt;
&lt;br /&gt;
If this needs fixing don't be shy, fix away.&lt;br /&gt;
&lt;br /&gt;
==GPS configuration using U-Center==&lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/products/u_center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note: You must [[Compiling#USB_flashing|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
* Note: You can run u-center on Linux by installing &amp;quot;wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and setting up com1 as /dev/ttyUSB0 See Info on wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.&lt;br /&gt;
* Note: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI.  Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun] or [http://shop.halfbase.com/product_info.php/products_id/54 Halfbase].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates.  Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accomodate the 4Hz update rate.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [http://paparazzi.enac.fr/wiki_images/Tiny_LEA-5H-v5.zip LEA-5H (For Use w/ Firmware V5 ONLY!)]&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 7. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 8. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 9. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;gt;4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 7. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 (add the flag -DGPS_USE_LATLONG in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 8. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH. Additionally, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file.&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===DGPS (Differential GPS)===&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.environmental-studies.de/Precision_Farming/EGNOS_WAAS__E/3E.html WAAS, EGNOS, and MSAS] though only WAAS is officially operational.  U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
====WAAS issues====&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification.  Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution.  Our advice is to completely disable WAAS.&lt;br /&gt;
&lt;br /&gt;
====EGNOS issues====&lt;br /&gt;
EGNOS is officially in &amp;quot;testing mode&amp;quot; and no claims of reliability are made.  The [http://www.u-blox.com/customersupport/faq_antaris u-blox FAQ] states the following:&lt;br /&gt;
* &amp;quot;Do you see issues with EGNOS?&amp;quot;&lt;br /&gt;
*:&amp;quot;Yes. Although the data transmitted by the EGNOS satellites are usually good and valuable (e.g. during the solar storms in autumn 2003), they can sometimes be very unreliable, for example when system tests are performed. As an example, u-blox has noticed erroneous range information (up to three hundred kilometers) on various EGNOS satellite over the last few months [2006].&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Further Reading===&lt;br /&gt;
&lt;br /&gt;
The u-blox [http://www.u-blox.com/customersupport/antaris4_doc.html System Integration Manual] covers a lot of GPS theory as well as product specific topics.&lt;br /&gt;
&lt;br /&gt;
== Antenna options for the Tiny and Paparazzi GPS units ==&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny|Tiny 1.1]]''' features a 28mm square ground plane intended to be centered below the [[#Sangshin_13mm_Patch|Sangshin 13mm patch antenna]].  Much better performance has been seen with the 18mm antennas and an augmented ground plane.  The ground plane is a critical part of the antenna affecting not only the gain and polarization characteristics but also the center frequency of the system.  Users are advised to expand the ground plane to approximately 36mm square, centered on the ceramic portion of the antenna (not the pin).  This can be done with copper foil soldered to the vias of the existing ground plane.&lt;br /&gt;
[[image:gps_antenna_comparison.jpg|thumb|500px|left|SAM-LS 25mm / Emtac 20mm / Emtac 18mm / Sangshin 18mm / Sangshin 13mm / Sarantel P2]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 18mm Patch ===&lt;br /&gt;
[[image:Sangshin_18mm.jpg|thumb|Sangshin 18mm x 4mm 1580Mhz]]&lt;br /&gt;
The Sangshin KSA-ST1580MS18 antenna has proven to offer the best performance of the currently available options.  These are available from any Sanshin distributor such as [http://www.rfmw.com rfmw] ([http://www.rfmw.com/PortalProductDetail.aspx?ProdId=232436&amp;amp;fmt=1 here]) and cost approximately $6.50/ea. in small quantities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EMTAC 18mm Patch ===&lt;br /&gt;
[[image:Emtac_18mm.jpg|thumb|Emtac 18mm x 4mm 1580Mhz]]&lt;br /&gt;
Offering identical performance to the Sangshin in a less attractive package is the Emtac 18mm antenna.  The part number for the standard 1580MHz 18x18x4mm is ANA1580T18D40 and is not listed on their website.  Other frequencies are available on a special order basis and the 1584Mhz has proven to outperform all other frequencies when used with a 36mm ground plane and no radome.  The use of a radome (any material covering the antenna) or a larger ground plane should theoretically favor even higher frequencies.&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* [http://www.transplantgps.com/modules.html TransplantGPS] in MN, USA.  The 1580Mhz models are usually available at a cost of $3.55ea but there may be a minimum order requirement of ~$50 USD.&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=43 PPZUAV] ~$10.00 USD (no min. order requirement)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 13mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Sangshin_13mm_onboard.jpg|thumb|Sangshin 13mm x 4mm 1580Mhz]]&lt;br /&gt;
Part of interest: '''[http://www.sangshinec.com/eng/patch_spec.htm KSA-ST1580MS13]'''&lt;br /&gt;
&lt;br /&gt;
The Tiny 0.99 (not 0.9) and 1.1 were designed around this antenna but users are advised to install 18mm units for better performance.&lt;br /&gt;
&lt;br /&gt;
Size: 13 x 13 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
Center Frequency: 1580 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
Bandwidth: 5 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
@Fo: -15 dB&amp;lt;br/&amp;gt;&lt;br /&gt;
GAIN (dBi): 0 dBi&amp;lt;br/&amp;gt;&lt;br /&gt;
Ground Plane: 50 x 50 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Available From'''&lt;br /&gt;
&lt;br /&gt;
[http://www.systroninc.com/ Systronic INC.] - Alberta, Canada&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emtac 20mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Salvaged_20mm_onboard.jpg|thumb|Emtac 20mm x 4mm]]&lt;br /&gt;
The Tiny 0.9 was designed around this 1583Mhz antenna and performed extremely well.  Emtac has replaced this with an 18mm model that they claim offers even better performance.&lt;br /&gt;
&lt;br /&gt;
* Obsolete&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sarantel GeoHelix-P2 ===&lt;br /&gt;
&lt;br /&gt;
[[image:Geohelix-p2.jpg|thumb|Sarantel Geohelix P-2 1575Mhz]]&lt;br /&gt;
&lt;br /&gt;
This antenna is popular among UAV designers due to it's natural rejection of other radio frequencies such as those originating from the modem or video system as well as it's improved rejection of signals reflected from the ground.  U-blox recommends this antenna and features it in their [http://www.u-blox.com/news/sarantel.html reference design].  Frequency and polarization are not dependent upon ground plane geometry so this antenna is sold only in the true GPS frequency of 1575Mhz.&lt;br /&gt;
The geometry makes this antenna very inconvenient to mount, especially in an airplane.  Some very non-scientific testing has been done with one of these antennas connected to a Tiny with a short length of 50 Ohm coax above a 120mm square of ungrounded aluminum foil and performance was adequate.  The helical design should theoretically outperform a patch in the air, but not on the ground, so any organized comparison will be difficult.  Possibly the most important aspect of this antenna is it's natural RFI filtering, which should be evaluated further.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sarantel.com/products/geohelix-p2 GeoHelix-P2] Passive GPS Antenna [[http://www.sarantel.com/downloads/specifications/geohelix-p2.pdf datasheet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* Sarantel @ cost of approx $18 USD each (active versions available for ~$40)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=40&amp;amp;osCsid=709e839698120c5cd324072b77d67cc1 PPZUAV]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4047</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4047"/>
		<updated>2008-09-11T21:50:11Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* LiveCd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi sources are hosted by [http://savannah.nongnu.org/cvs/?group=paparazzi Savannah].&lt;br /&gt;
&lt;br /&gt;
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian based distributions ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following lines to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;) and then&lt;br /&gt;
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):&lt;br /&gt;
&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 # Uncomment just _one_ of the following lines - depending on your OS version&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; etch main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; gutsy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; hardy main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: It is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then, update your sources and '''either''' install the precompiled &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt;aries&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-bin&lt;br /&gt;
&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; the dependencies needed for recompiling from the source (&amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt;), and the cross-compiler (&amp;lt;b&amp;gt;arm7&amp;lt;/b&amp;gt;) :&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install paparazzi-dev&lt;br /&gt;
 apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
As stated before it is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;. While the &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt; package is self-contained and should be sufficient for users who do not want to patch the code, the &amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt; meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional/Obsolete Packages ====&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
==== Extra for Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')&lt;br /&gt;
* Search for &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;paparazzi-arm7&amp;lt;/tt&amp;gt; packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
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&amp;amp;view=markup &amp;lt;tt&amp;gt; debian/control.etch&amp;lt;/tt&amp;gt;] file and may help users of other distributions.&lt;br /&gt;
&lt;br /&gt;
The binary packages and some corresponding source tarballs can be downloaded from&lt;br /&gt;
&lt;br /&gt;
 http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For Fedora (Core8) users, you can install the following packages from standard repository:&lt;br /&gt;
* ocaml.i386&lt;br /&gt;
* ocaml-camlimages-devel.i386&lt;br /&gt;
* ocaml-lablgtk-devel.i386&lt;br /&gt;
* ocaml-xml-light-devel.i386&lt;br /&gt;
* boa.i386&lt;br /&gt;
* libgnomecanvas-devel.i386&lt;br /&gt;
* libusb-devel.i386&lt;br /&gt;
* pcre-devel.i386&lt;br /&gt;
* arm-gp2x-linux-gcc.i386&lt;br /&gt;
* arm-gp2x-linux-binutils.i386&lt;br /&gt;
* glade2.i386&lt;br /&gt;
* and gcc, make, cvs, gnuplot, imagemagik...&lt;br /&gt;
&lt;br /&gt;
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:&lt;br /&gt;
* ivy-c&lt;br /&gt;
* ivy-c-dev&lt;br /&gt;
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/&amp;lt;version&amp;gt; vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/&amp;lt;version&amp;gt; to /usr/lib/ocaml)&lt;br /&gt;
* lpc21isp&lt;br /&gt;
&lt;br /&gt;
== Installing the Source Code (not needed with paparazzi-bin) ==&lt;br /&gt;
After the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package is installed the complete source code should be downloaded from the CVS repository.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From the directory of your choice type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into &amp;lt;tt&amp;gt;paparazzi3/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, dayly updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; package or the Live-CD, just launch the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; binary application and you will be guided through the installation of your personal configuration files.&lt;br /&gt;
&lt;br /&gt;
If you are using the source code, the first step is to compile it. From the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd paparazzi3&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;cvs update&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
}}&lt;br /&gt;
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:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
&lt;br /&gt;
== Setting access rights for USB download ==&lt;br /&gt;
&lt;br /&gt;
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;group&amp;quot; and then create a &amp;quot;rule&amp;quot;, associated with that &amp;quot;group&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Make yourself a member of the ''plugdev'' group:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
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 CVS 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 the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS 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.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
 &lt;br /&gt;
The CD image is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[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. &lt;br /&gt;
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4046</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=4046"/>
		<updated>2008-09-11T21:43:28Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Installation from the Command Line */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi sources are hosted by [http://savannah.nongnu.org/cvs/?group=paparazzi Savannah].&lt;br /&gt;
&lt;br /&gt;
The Paparazzi packages are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian based distributions ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following lines to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;) and then&lt;br /&gt;
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):&lt;br /&gt;
&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 # Uncomment just _one_ of the following lines - depending on your OS version&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt; etch main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; gutsy main&lt;br /&gt;
 # deb &amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/ubuntu&amp;lt;/nowiki&amp;gt; hardy main&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: It is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Then, update your sources and '''either''' install the precompiled &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt;aries&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install paparazzi-bin&lt;br /&gt;
&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; the dependencies needed for recompiling from the source (&amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt;), and the cross-compiler (&amp;lt;b&amp;gt;arm7&amp;lt;/b&amp;gt;) :&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install paparazzi-dev&lt;br /&gt;
 apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
As stated before it is not recommended to install both &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;. While the &amp;lt;b&amp;gt;bin&amp;lt;/b&amp;gt; package is self-contained and should be sufficient for users who do not want to patch the code, the &amp;lt;b&amp;gt;dev&amp;lt;/b&amp;gt; meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the CVS repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Optional/Obsolete Packages ====&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
==== Extra for Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://paparazzi.enac.fr/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''' (or '''hardy''')&lt;br /&gt;
* Search for &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;paparazzi-arm7&amp;lt;/tt&amp;gt; packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
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&amp;amp;view=markup &amp;lt;tt&amp;gt; debian/control.etch&amp;lt;/tt&amp;gt;] file and may help users of other distributions.&lt;br /&gt;
&lt;br /&gt;
The binary packages and some corresponding source tarballs can be downloaded from&lt;br /&gt;
&lt;br /&gt;
 http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For Fedora (Core8) users, you can install the following packages from standard repository:&lt;br /&gt;
* ocaml.i386&lt;br /&gt;
* ocaml-camlimages-devel.i386&lt;br /&gt;
* ocaml-lablgtk-devel.i386&lt;br /&gt;
* ocaml-xml-light-devel.i386&lt;br /&gt;
* boa.i386&lt;br /&gt;
* libgnomecanvas-devel.i386&lt;br /&gt;
* libusb-devel.i386&lt;br /&gt;
* pcre-devel.i386&lt;br /&gt;
* arm-gp2x-linux-gcc.i386&lt;br /&gt;
* arm-gp2x-linux-binutils.i386&lt;br /&gt;
* glade2.i386&lt;br /&gt;
* and gcc, make, cvs, gnuplot, imagemagik...&lt;br /&gt;
&lt;br /&gt;
Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:&lt;br /&gt;
* ivy-c&lt;br /&gt;
* ivy-c-dev&lt;br /&gt;
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/&amp;lt;version&amp;gt; vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/&amp;lt;version&amp;gt; to /usr/lib/ocaml)&lt;br /&gt;
* lpc21isp&lt;br /&gt;
&lt;br /&gt;
== Installing the Source Code (not needed with paparazzi-bin) ==&lt;br /&gt;
After the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package is installed the complete source code should be downloaded from the CVS repository.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From the directory of your choice type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into &amp;lt;tt&amp;gt;paparazzi3/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, dayly updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;paparazzi-bin&amp;lt;/tt&amp;gt; package or the Live-CD, just launch the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; binary application and you will be guided through the installation of your personal configuration files.&lt;br /&gt;
&lt;br /&gt;
If you are using the source code, the first step is to compile it. From the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd paparazzi3&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;cvs update&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi3&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
}}&lt;br /&gt;
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:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;''your paparazzi3 directory''&lt;br /&gt;
&lt;br /&gt;
== Setting access rights for USB download ==&lt;br /&gt;
&lt;br /&gt;
This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;group&amp;quot; and then create a &amp;quot;rule&amp;quot;, associated with that &amp;quot;group&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
Make yourself a member of the ''plugdev'' group:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
&lt;br /&gt;
Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
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 CVS 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 the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS 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.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
 &lt;br /&gt;
The CD image is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
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 (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[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. &lt;br /&gt;
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].&lt;br /&gt;
&lt;br /&gt;
* 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]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4045</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4045"/>
		<updated>2008-09-11T21:36:20Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Infrared */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the correspondance between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a pair of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''. In the aligned case, ir'''1''' is along the lateral axis and ir'''2''' along the longitudian one. In the '''tilted''' case, the sensors are tilted by 45 degrees; ir'''1''' is along rear-left -- front-right, and ir'''2''' along rear-right -- front-left. A value of &amp;quot;0&amp;quot; indicates x-y sensor is aligned with the fueslage, a value of &amp;quot;1&amp;quot; indicates a 45 deg rotation. If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results. &lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot; value=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;-0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;radians&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;-7500.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;-1500&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;-8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot; value=&amp;quot;1250&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''-0.4''', a roll of -0.4 (23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot; value=&amp;quot;.4&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot; value=&amp;quot;1000&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot; value =&amp;quot;12.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot; value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot; value&amp;quot;60&amp;quot; unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== R/C ===&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM. &amp;quot;RC_FUTABA&amp;quot; is for The Futaba or compatible brands, and &amp;quot;RC_JR&amp;quot; for JR (a.k.a Graupner outside of the USA) or compatible brands.&lt;br /&gt;
&lt;br /&gt;
For the classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times and also must match the ground modem rate, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;, update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string and keep &amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
And Finally use this in the makefile section&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600&lt;br /&gt;
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
By reading all the information above you should be able to infer what the above does&lt;br /&gt;
&lt;br /&gt;
Now keep in mind that the ground modem baud rate and airplanes modem baud rates do not have to match. The only things that need to match are the the modem on the planes baud rate and the rate defined in the airframe file. For example this planes modem is set to 9600 and this could be used with the ground modem configured above using 57600... &lt;br /&gt;
Also for multiple UAV's a good way to configure them is to use 9600 for the ap and use a ground modem configured to 57600 and its not a bad idea to use minimal telemetry&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM&lt;br /&gt;
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Radio Control ==&lt;br /&gt;
The Paparazzi autpilot interfaces directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4044</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4044"/>
		<updated>2008-09-11T21:10:36Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the correspondance between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a pair of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define the orientation of the horizontal sensor, &amp;lt;tt&amp;gt;TILTED&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;ALIGNED&amp;lt;/tt&amp;gt;. In the &amp;lt;tt&amp;gt;ALIGNED&amp;lt;/tt&amp;gt; case, ir1 is along the lateral axis and ir2 along the longitudianl one. In the &amp;lt;tt&amp;gt;TILTED&amp;lt;/tt&amp;gt; case, the sensors are tilted by 45 degrees; ir1 is along rear-left -- front-right, and ir2 along rear-right -- front-left.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot; value=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;-0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;radians&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;-7500.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;-1500&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;-8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot; value=&amp;quot;1250&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''-0.4''', a roll of -0.4 (23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot; value=&amp;quot;.4&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot; value=&amp;quot;1000&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot; value =&amp;quot;12.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot; value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot; value&amp;quot;60&amp;quot; unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== R/C ===&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM. &amp;quot;RC_FUTABA&amp;quot; is for The Futaba or compatible brands, and &amp;quot;RC_JR&amp;quot; for JR (a.k.a Graupner outside of the USA) or compatible brands.&lt;br /&gt;
&lt;br /&gt;
For the classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times and also must match the ground modem rate, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;, update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string and keep &amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
And Finally use this in the makefile section&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600&lt;br /&gt;
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
By reading all the information above you should be able to infer what the above does&lt;br /&gt;
&lt;br /&gt;
Now keep in mind that the ground modem baud rate and airplanes modem baud rates do not have to match. The only things that need to match are the the modem on the planes baud rate and the rate defined in the airframe file. For example this planes modem is set to 9600 and this could be used with the ground modem configured above using 57600... &lt;br /&gt;
Also for multiple UAV's a good way to configure them is to use 9600 for the ap and use a ground modem configured to 57600 and its not a bad idea to use minimal telemetry&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM&lt;br /&gt;
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Radio Control ==&lt;br /&gt;
The Paparazzi autpilot interfaces directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Conf.xml&amp;diff=4006</id>
		<title>Conf.xml</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Conf.xml&amp;diff=4006"/>
		<updated>2008-09-02T17:29:51Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;conf/conf.xml&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; document associates the flight plan and various hardware/software configuration files with a partticular aircraft, identified by &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;. The values in this document are set and handled by the [[Paparazzi_Center|Paparazzi Center]] so it is usually not needed to edit the configuration document manually.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;7&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/generic.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    settings=&amp;quot;settings/basic.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;red&amp;quot;&lt;br /&gt;
  /&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where: &lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the name of the aircraft which will appear in different places in the [[GCS|GCS]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt; is a unique integer (between 1 and 255) identifying the aircraft (especially needed in the communication messages)&lt;br /&gt;
* &amp;lt;tt&amp;gt;airframe&amp;lt;/tt&amp;gt; is the file name containing the parameters of the aircraft&lt;br /&gt;
* &amp;lt;tt&amp;gt;radio&amp;lt;/tt&amp;gt; is the file name containing the description of the RC transmitter&lt;br /&gt;
* &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; is the sequence of actions and waypoints describing the desired trajectory&lt;br /&gt;
* &amp;lt;tt&amp;gt;telemetry&amp;lt;/tt&amp;gt; is the file name containing the set of messages sent over the telemetry link&lt;br /&gt;
* &amp;lt;tt&amp;gt;settings&amp;lt;/tt&amp;gt; is the file name containing the set of parameters that can be configured through the telemetry link&lt;br /&gt;
* &amp;lt;tt&amp;gt;gui_color&amp;lt;/tt&amp;gt; is the color assigned to this aircraft in the GCS&lt;br /&gt;
&lt;br /&gt;
All these attributes are required except the last two (&amp;lt;tt&amp;gt;settings&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;gui_color&amp;lt;/tt&amp;gt;) which are optional.&lt;br /&gt;
&lt;br /&gt;
The following sections describe these xml documents:&lt;br /&gt;
* [[Radio_Control|Radio Control]] &lt;br /&gt;
* [[Airframe_Configuration|Airframe]]&lt;br /&gt;
* [[Flight_Plans|Flight plans]]&lt;br /&gt;
* [[Telemetry|Telemetry]]&lt;br /&gt;
* [[Settings]]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Conf.xml&amp;diff=4005</id>
		<title>Conf.xml</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Conf.xml&amp;diff=4005"/>
		<updated>2008-09-02T17:27:51Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;conf/conf.xml&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; file associates the flight plan and various hardware/software configuration files with a partticular aircraft, identified by &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;. This file is handled by the [[Paparazzi_Center|Paparazzi Center]] so it is usually not needed to edit it by hand.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;7&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/generic.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    settings=&amp;quot;settings/basic.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;red&amp;quot;&lt;br /&gt;
  /&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where: &lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is the name of the aircraft which will appear in different places in the [[GCS|GCS]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt; is a unique integer (between 1 and 255) identifying the aircraft (especially needed in the communication messages)&lt;br /&gt;
* &amp;lt;tt&amp;gt;airframe&amp;lt;/tt&amp;gt; is the file name containing the parameters of the aircraft&lt;br /&gt;
* &amp;lt;tt&amp;gt;radio&amp;lt;/tt&amp;gt; is the file name containing the description of the RC transmitter&lt;br /&gt;
* &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; is the sequence of actions and waypoints describing the desired trajectory&lt;br /&gt;
* &amp;lt;tt&amp;gt;telemetry&amp;lt;/tt&amp;gt; is the file name containing the set of messages sent over the telemetry link&lt;br /&gt;
* &amp;lt;tt&amp;gt;settings&amp;lt;/tt&amp;gt; is the file name containing the set of parameters that can be configured through the telemetry link&lt;br /&gt;
* &amp;lt;tt&amp;gt;gui_color&amp;lt;/tt&amp;gt; is the color assigned to this aircraft in the GCS&lt;br /&gt;
&lt;br /&gt;
All these attributes are required except the last two (&amp;lt;tt&amp;gt;settings&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;gui_color&amp;lt;/tt&amp;gt;) which are optional.&lt;br /&gt;
&lt;br /&gt;
The following sections describe these xml documents:&lt;br /&gt;
* [[Radio_Control|Radio Control]] &lt;br /&gt;
* [[Airframe_Configuration|Airframe]]&lt;br /&gt;
* [[Flight_Plans|Flight plans]]&lt;br /&gt;
* [[Telemetry|Telemetry]]&lt;br /&gt;
* [[Settings]]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4004</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=4004"/>
		<updated>2008-09-02T17:20:36Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the correspondance between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a pair of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define the orientation of the horizontal sensor, &amp;lt;tt&amp;gt;TILTED&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;ALIGNED&amp;lt;/tt&amp;gt;. In the &amp;lt;tt&amp;gt;ALIGNED&amp;lt;/tt&amp;gt; case, ir1 is along the lateral axis and ir2 along the longitudianl one. In the &amp;lt;tt&amp;gt;TILTED&amp;lt;/tt&amp;gt; case, the sensors are tilted by 45 degrees; ir1 is along rear-left -- front-right, and ir2 along rear-right -- front-left.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot; value=&amp;quot;500&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;-0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;radians&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;-7500.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;-1500&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;-8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot; value=&amp;quot;1250&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''-0.4''', a roll of -0.4 (23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot; value=&amp;quot;.4&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&amp;quot; unit=&amp;quot;%&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot; value=&amp;quot;1000&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;-0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot; value =&amp;quot;12.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot; value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot; value&amp;quot;60&amp;quot; unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== R/C ===&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM.&lt;br /&gt;
&lt;br /&gt;
For the classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times and also must match the ground modem rate, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;, update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string and keep &amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/index.php/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
And Finally use this in the makefile section&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1 -DDATALINK=XBEE -DUART1_BAUD=B9600&lt;br /&gt;
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
By reading all the information above you should be able to infer what the above does&lt;br /&gt;
&lt;br /&gt;
Now keep in mind that the ground modem baud rate and airplanes modem baud rates do not have to match. The only things that need to match are the the modem on the planes baud rate and the rate defined in the airframe file. For example this planes modem is set to 9600 and this could be used with the ground modem configured above using 57600... &lt;br /&gt;
Also for multiple UAV's a good way to configure them is to use 9600 for the ap and use a ground modem configured to 57600 and its not a bad idea to use minimal telemetry&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM&lt;br /&gt;
ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Radio Control ==&lt;br /&gt;
The Paparazzi autpilot interfaces directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4003</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4003"/>
		<updated>2008-09-01T20:07:33Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Standalone GPS Module from CVS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots are designed around the popular [http://www.u-blox.com u-blox] brand of receivers.&lt;br /&gt;
&lt;br /&gt;
*Features:&lt;br /&gt;
**Small size&lt;br /&gt;
**Excellent performance&lt;br /&gt;
**4Hz position update rate&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' features an onboard LEA series GPS receiver and patch antenna, while '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]].  Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol.  The protocol is parsed in &amp;lt;tt&amp;gt;sw/airborne/gps_ubx.c&amp;lt;/tt&amp;gt;.  Other GPS brands would require a similar parsing file to be written for NMEA or other proprietary protocols.    &lt;br /&gt;
&lt;br /&gt;
==GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
===u-Blox LEA Series Receivers===&lt;br /&gt;
[[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]]&lt;br /&gt;
The '''[[Tiny]]''' and Paparazzi stand-alone GPS currently use the [http://www.u-blox.com/products/lea_4p.html u-blox LEA-4P] featuring [http://www.u-blox.com/technology/antaris4/index.html Antaris-4] technology and uBlox's more efficient UBX binary protocol.  This module is a surface mount package which is soldered directly onto the PCB (Tiny or Paparazzi GPS).  An external battery backup (capacitor) is used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition.  Any of the LEA-4x series receivers can be used including the less expensive LEA-4A and 4S models as the special boot configuration code required for these models is already written.&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
&lt;br /&gt;
[[Image:TINY_1.3_MCU_BOTTOM.JPG|thumb|center|250px|LEA-4P installed on the Tiny]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Paparazzi Stand-alone GPS Receivers===&lt;br /&gt;
There are currently two (LEA-based) stand-alone, GPS receiver + antenna, prototype boards in development; the first one is based on the Sangshin 13mm patch antenna. The second is based on the Sarantel helix antenna.  Drawings for both are available from the [http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/hw/ CVS]&lt;br /&gt;
Another alternative is the NAVILOCK NL-507TTL u-blox TTL Modul 60416 which is availible for 28€ (amazon.de).&lt;br /&gt;
&lt;br /&gt;
===u-Blox SAM-LS GPS Smart Antenna===&lt;br /&gt;
[[Image:Ublox_SAM-LS.jpg|100px|thumb|right|u-blox SAM-LS]]&lt;br /&gt;
The '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards use a stand alone module from u-blox called the SAM-LS. It is an integrated TIM-LP module with a ceramic patch antenna. This processor also runs on 4hz and must be configured to use the UBX protocol. With battery backup (3V watch battery) they show hot starts of around a couple seconds. The LEA-LA processor weighs a couple grams and the complete the SAM-LS module with antenna and shielding weighs about 20grams.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Effective 12/2006 u-blox has begun to phase out the SAM-LS product.  No replacement will be offered.&lt;br /&gt;
&lt;br /&gt;
====Connecting external receivers to Classix, 1.2.1, Lite, and RoboStix boards====&lt;br /&gt;
&lt;br /&gt;
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.  The Classix and Lite boards feature a 3.3V regulator to power the GPS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sourcing from u-blox===&lt;br /&gt;
&lt;br /&gt;
u-blox keeps tight control over the distribution of their products.  They must be obtained DIRECTLY from their own reseller offices.  These offices may not be available in your area, for example Canada does not have a reseller.  Sample quantities can be obtained from uBlox but overnight or 2 day shipping is required which drives the cost up considerably.  While it is a large hassle obtaining these devices, it is undoubtedly worth it.&lt;br /&gt;
&lt;br /&gt;
Talking with ublox sale for two years, Confirmed, that Order is possiable Directly from ublox, by knowing what project it was for &amp;amp; how was it to be use.  After long reply waiting time, the answer was: - YES,  but at least 2K-3K in volume, otherwise they're not interested.  Like to share the order ?  It is 500pcs/Roll.&lt;br /&gt;
&lt;br /&gt;
===Other potential source of u-blox GPS===&lt;br /&gt;
&lt;br /&gt;
There seems to be a few alternative source of u-blox GPS out there. They are considerably cheaper then the samples u-blox offers (at least in america). We didn't buy from these sources yet. Do not take this as a recommandation, we do not know the level of service they offer, etc.&lt;br /&gt;
&lt;br /&gt;
If you do order from any of them, please update this page with your feedback.&lt;br /&gt;
&lt;br /&gt;
Here's a few link worth exploring:&lt;br /&gt;
*http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp&lt;br /&gt;
*http://www.comet.srl.ro/shop/info.html?ID=6195 ( Link error )&lt;br /&gt;
*http://www.expedienttech.com/product.htm  ( Singapore ) &lt;br /&gt;
*http://shop.halfbase.com/index.php/cPath/22?osCsid=414472d5a544b080f9ae153fdc323798  ( B2B- min.10pcs @ $38 )&lt;br /&gt;
&lt;br /&gt;
===Standalone GPS Module from CVS===&lt;br /&gt;
The Version 1 (V1) BOM is here.. Please post any pics you might have and check this for accuracy&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|250px|thumb|right|LEA-5H Full Board Pinout]]&lt;br /&gt;
&lt;br /&gt;
If this needs fixing don't be shy, fix away.&lt;br /&gt;
&lt;br /&gt;
==GPS configuration using U-Center==&lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/products/u_center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note: You must [[Compiling#USB_flashing|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
* Note: You can run u-center on Linux by installing &amp;quot;wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and setting up com1 as /dev/ttyUSB0 See Info on wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with wine, follow prompts. This has been tested with Ubuntu7.10 so far.&lt;br /&gt;
* Note: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI.  Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun] or [http://shop.halfbase.com/product_info.php/products_id/54 Halfbase].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates.  Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accomodate the 4Hz update rate.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [http://paparazzi.enac.fr/wiki_images/Tiny_LEA-5H-v5.zip LEA-5H (For Use w/ Firmware V5 ONLY!)]&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 7. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 8. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 9. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;gt;4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 7. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 (add the flag -DGPS_USE_LATLONG in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 8. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH. Additionally, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file.&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===DGPS (Differential GPS)===&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.environmental-studies.de/Precision_Farming/EGNOS_WAAS__E/3E.html WAAS, EGNOS, and MSAS] though only WAAS is officially operational.  U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
====WAAS issues====&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification.  Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution.  Our advice is to completely disable WAAS.&lt;br /&gt;
&lt;br /&gt;
====EGNOS issues====&lt;br /&gt;
EGNOS is officially in &amp;quot;testing mode&amp;quot; and no claims of reliability are made.  The [http://www.u-blox.com/customersupport/faq_antaris u-blox FAQ] states the following:&lt;br /&gt;
* &amp;quot;Do you see issues with EGNOS?&amp;quot;&lt;br /&gt;
*:&amp;quot;Yes. Although the data transmitted by the EGNOS satellites are usually good and valuable (e.g. during the solar storms in autumn 2003), they can sometimes be very unreliable, for example when system tests are performed. As an example, u-blox has noticed erroneous range information (up to three hundred kilometers) on various EGNOS satellite over the last few months [2006].&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Further Reading===&lt;br /&gt;
&lt;br /&gt;
The u-blox [http://www.u-blox.com/customersupport/antaris4_doc.html System Integration Manual] covers a lot of GPS theory as well as product specific topics.&lt;br /&gt;
&lt;br /&gt;
== Antenna options for the Tiny and Paparazzi GPS units ==&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny|Tiny 1.1]]''' features a 28mm square ground plane intended to be centered below the [[#Sangshin_13mm_Patch|Sangshin 13mm patch antenna]].  Much better performance has been seen with the 18mm antennas and an augmented ground plane.  The ground plane is a critical part of the antenna affecting not only the gain and polarization characteristics but also the center frequency of the system.  Users are advised to expand the ground plane to approximately 36mm square, centered on the ceramic portion of the antenna (not the pin).  This can be done with copper foil soldered to the vias of the existing ground plane.&lt;br /&gt;
[[image:gps_antenna_comparison.jpg|thumb|500px|left|SAM-LS 25mm / Emtac 20mm / Emtac 18mm / Sangshin 18mm / Sangshin 13mm / Sarantel P2]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 18mm Patch ===&lt;br /&gt;
[[image:Sangshin_18mm.jpg|thumb|Sangshin 18mm x 4mm 1580Mhz]]&lt;br /&gt;
The Sangshin KSA-ST1580MS18 antenna has proven to offer the best performance of the currently available options.  These are available from any Sanshin distributor such as [http://www.rfmw.com rfmw] ([http://www.rfmw.com/PortalProductDetail.aspx?ProdId=232436&amp;amp;fmt=1 here]) and cost approximately $6.50/ea. in small quantities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EMTAC 18mm Patch ===&lt;br /&gt;
[[image:Emtac_18mm.jpg|thumb|Emtac 18mm x 4mm 1580Mhz]]&lt;br /&gt;
Offering identical performance to the Sangshin in a less attractive package is the Emtac 18mm antenna.  The part number for the standard 1580MHz 18x18x4mm is ANA1580T18D40 and is not listed on their website.  Other frequencies are available on a special order basis and the 1584Mhz has proven to outperform all other frequencies when used with a 36mm ground plane and no radome.  The use of a radome (any material covering the antenna) or a larger ground plane should theoretically favor even higher frequencies.&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* [http://www.transplantgps.com/modules.html TransplantGPS] in MN, USA.  The 1580Mhz models are usually available at a cost of $3.55ea but there may be a minimum order requirement of ~$50 USD.&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=43 PPZUAV] ~$10.00 USD (no min. order requirement)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 13mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Sangshin_13mm_onboard.jpg|thumb|Sangshin 13mm x 4mm 1580Mhz]]&lt;br /&gt;
Part of interest: '''[http://www.sangshinec.com/eng/patch_spec.htm KSA-ST1580MS13]'''&lt;br /&gt;
&lt;br /&gt;
The Tiny 0.99 (not 0.9) and 1.1 were designed around this antenna but users are advised to install 18mm units for better performance.&lt;br /&gt;
&lt;br /&gt;
Size: 13 x 13 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
Center Frequency: 1580 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
Bandwidth: 5 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
@Fo: -15 dB&amp;lt;br/&amp;gt;&lt;br /&gt;
GAIN (dBi): 0 dBi&amp;lt;br/&amp;gt;&lt;br /&gt;
Ground Plane: 50 x 50 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Available From'''&lt;br /&gt;
&lt;br /&gt;
[http://www.systroninc.com/ Systronic INC.] - Alberta, Canada&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emtac 20mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Salvaged_20mm_onboard.jpg|thumb|Emtac 20mm x 4mm]]&lt;br /&gt;
The Tiny 0.9 was designed around this 1583Mhz antenna and performed extremely well.  Emtac has replaced this with an 18mm model that they claim offers even better performance.&lt;br /&gt;
&lt;br /&gt;
* Obsolete&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sarantel GeoHelix-P2 ===&lt;br /&gt;
&lt;br /&gt;
[[image:Geohelix-p2.jpg|thumb|Sarantel Geohelix P-2 1575Mhz]]&lt;br /&gt;
&lt;br /&gt;
This antenna is popular among UAV designers due to it's natural rejection of other radio frequencies such as those originating from the modem or video system as well as it's improved rejection of signals reflected from the ground.  U-blox recommends this antenna and features it in their [http://www.u-blox.com/news/sarantel.html reference design].  Frequency and polarization are not dependent upon ground plane geometry so this antenna is sold only in the true GPS frequency of 1575Mhz.&lt;br /&gt;
The geometry makes this antenna very inconvenient to mount, especially in an airplane.  Some very non-scientific testing has been done with one of these antennas connected to a Tiny with a short length of 50 Ohm coax above a 120mm square of ungrounded aluminum foil and performance was adequate.  The helical design should theoretically outperform a patch in the air, but not on the ground, so any organized comparison will be difficult.  Possibly the most important aspect of this antenna is it's natural RFI filtering, which should be evaluated further.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sarantel.com/products/geohelix-p2 GeoHelix-P2] Passive GPS Antenna [[http://www.sarantel.com/downloads/specifications/geohelix-p2.pdf datasheet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* Sarantel @ cost of approx $18 USD each (active versions available for ~$40)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=40&amp;amp;osCsid=709e839698120c5cd324072b77d67cc1 PPZUAV]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4002</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=4002"/>
		<updated>2008-09-01T20:06:06Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Standalone GPS Module from CVS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots are designed around the popular [http://www.u-blox.com u-blox] brand of receivers.&lt;br /&gt;
&lt;br /&gt;
*Features:&lt;br /&gt;
**Small size&lt;br /&gt;
**Excellent performance&lt;br /&gt;
**4Hz position update rate&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' features an onboard LEA series GPS receiver and patch antenna, while '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]].  Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol.  The protocol is parsed in &amp;lt;tt&amp;gt;sw/airborne/gps_ubx.c&amp;lt;/tt&amp;gt;.  Other GPS brands would require a similar parsing file to be written for NMEA or other proprietary protocols.    &lt;br /&gt;
&lt;br /&gt;
==GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
===u-Blox LEA Series Receivers===&lt;br /&gt;
[[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]]&lt;br /&gt;
The '''[[Tiny]]''' and Paparazzi stand-alone GPS currently use the [http://www.u-blox.com/products/lea_4p.html u-blox LEA-4P] featuring [http://www.u-blox.com/technology/antaris4/index.html Antaris-4] technology and uBlox's more efficient UBX binary protocol.  This module is a surface mount package which is soldered directly onto the PCB (Tiny or Paparazzi GPS).  An external battery backup (capacitor) is used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition.  Any of the LEA-4x series receivers can be used including the less expensive LEA-4A and 4S models as the special boot configuration code required for these models is already written.&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
&lt;br /&gt;
[[Image:TINY_1.3_MCU_BOTTOM.JPG|thumb|center|250px|LEA-4P installed on the Tiny]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Paparazzi Stand-alone GPS Receivers===&lt;br /&gt;
There are currently two (LEA-based) stand-alone, GPS receiver + antenna, prototype boards in development; the first one is based on the Sangshin 13mm patch antenna. The second is based on the Sarantel helix antenna.  Drawings for both are available from the [http://cvs.savannah.gnu.org/viewcvs/paparazzi/paparazzi3/hw/ CVS]&lt;br /&gt;
Another alternative is the NAVILOCK NL-507TTL u-blox TTL Modul 60416 which is availible for 28€ (amazon.de).&lt;br /&gt;
&lt;br /&gt;
===u-Blox SAM-LS GPS Smart Antenna===&lt;br /&gt;
[[Image:Ublox_SAM-LS.jpg|100px|thumb|right|u-blox SAM-LS]]&lt;br /&gt;
The '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards use a stand alone module from u-blox called the SAM-LS. It is an integrated TIM-LP module with a ceramic patch antenna. This processor also runs on 4hz and must be configured to use the UBX protocol. With battery backup (3V watch battery) they show hot starts of around a couple seconds. The LEA-LA processor weighs a couple grams and the complete the SAM-LS module with antenna and shielding weighs about 20grams.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Effective 12/2006 u-blox has begun to phase out the SAM-LS product.  No replacement will be offered.&lt;br /&gt;
&lt;br /&gt;
====Connecting external receivers to Classix, 1.2.1, Lite, and RoboStix boards====&lt;br /&gt;
&lt;br /&gt;
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.  The Classix and Lite boards feature a 3.3V regulator to power the GPS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sourcing from u-blox===&lt;br /&gt;
&lt;br /&gt;
u-blox keeps tight control over the distribution of their products.  They must be obtained DIRECTLY from their own reseller offices.  These offices may not be available in your area, for example Canada does not have a reseller.  Sample quantities can be obtained from uBlox but overnight or 2 day shipping is required which drives the cost up considerably.  While it is a large hassle obtaining these devices, it is undoubtedly worth it.&lt;br /&gt;
&lt;br /&gt;
Talking with ublox sale for two years, Confirmed, that Order is possiable Directly from ublox, by knowing what project it was for &amp;amp; how was it to be use.  After long reply waiting time, the answer was: - YES,  but at least 2K-3K in volume, otherwise they're not interested.  Like to share the order ?  It is 500pcs/Roll.&lt;br /&gt;
&lt;br /&gt;
===Other potential source of u-blox GPS===&lt;br /&gt;
&lt;br /&gt;
There seems to be a few alternative source of u-blox GPS out there. They are considerably cheaper then the samples u-blox offers (at least in america). We didn't buy from these sources yet. Do not take this as a recommandation, we do not know the level of service they offer, etc.&lt;br /&gt;
&lt;br /&gt;
If you do order from any of them, please update this page with your feedback.&lt;br /&gt;
&lt;br /&gt;
Here's a few link worth exploring:&lt;br /&gt;
*http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp&lt;br /&gt;
*http://www.comet.srl.ro/shop/info.html?ID=6195 ( Link error )&lt;br /&gt;
*http://www.expedienttech.com/product.htm  ( Singapore ) &lt;br /&gt;
*http://shop.halfbase.com/index.php/cPath/22?osCsid=414472d5a544b080f9ae153fdc323798  ( B2B- min.10pcs @ $38 )&lt;br /&gt;
&lt;br /&gt;
===Standalone GPS Module from CVS===&lt;br /&gt;
The Version 1 (V1) BOM is here.. Please post any pics you might have and check this for accuracy&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output]&amp;lt;br&amp;gt;&lt;br /&gt;
If this needs fixing don't be shy, fix away.&lt;br /&gt;
&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|250px|thumb|left|LEA-5H Full Board Pinout]]&lt;br /&gt;
&lt;br /&gt;
==GPS configuration using U-Center==&lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/products/u_center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note: You must [[Compiling#USB_flashing|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
* Note: You can run u-center on Linux by installing &amp;quot;wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and setting up com1 as /dev/ttyUSB0 See Info on wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with wine, follow prompts. This has been tested with Ubuntu7.10 so far.&lt;br /&gt;
* Note: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI.  Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun] or [http://shop.halfbase.com/product_info.php/products_id/54 Halfbase].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates.  Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accomodate the 4Hz update rate.&lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [http://paparazzi.enac.fr/wiki_images/Tiny_LEA-5H-v5.zip LEA-5H (For Use w/ Firmware V5 ONLY!)]&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 7. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 8. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 9. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
 1. Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
 2. Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;gt;4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
 3. UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
 5. UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
 6. UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
 7. UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
 (add the flag -DGPS_USE_LATLONG in your [[Airframe_Configuration#Hardware_definitions_-_Makefile|Airframe file]])&lt;br /&gt;
 8. UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH. Additionally, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file.&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===DGPS (Differential GPS)===&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.environmental-studies.de/Precision_Farming/EGNOS_WAAS__E/3E.html WAAS, EGNOS, and MSAS] though only WAAS is officially operational.  U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
====WAAS issues====&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification.  Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution.  Our advice is to completely disable WAAS.&lt;br /&gt;
&lt;br /&gt;
====EGNOS issues====&lt;br /&gt;
EGNOS is officially in &amp;quot;testing mode&amp;quot; and no claims of reliability are made.  The [http://www.u-blox.com/customersupport/faq_antaris u-blox FAQ] states the following:&lt;br /&gt;
* &amp;quot;Do you see issues with EGNOS?&amp;quot;&lt;br /&gt;
*:&amp;quot;Yes. Although the data transmitted by the EGNOS satellites are usually good and valuable (e.g. during the solar storms in autumn 2003), they can sometimes be very unreliable, for example when system tests are performed. As an example, u-blox has noticed erroneous range information (up to three hundred kilometers) on various EGNOS satellite over the last few months [2006].&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Further Reading===&lt;br /&gt;
&lt;br /&gt;
The u-blox [http://www.u-blox.com/customersupport/antaris4_doc.html System Integration Manual] covers a lot of GPS theory as well as product specific topics.&lt;br /&gt;
&lt;br /&gt;
== Antenna options for the Tiny and Paparazzi GPS units ==&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny|Tiny 1.1]]''' features a 28mm square ground plane intended to be centered below the [[#Sangshin_13mm_Patch|Sangshin 13mm patch antenna]].  Much better performance has been seen with the 18mm antennas and an augmented ground plane.  The ground plane is a critical part of the antenna affecting not only the gain and polarization characteristics but also the center frequency of the system.  Users are advised to expand the ground plane to approximately 36mm square, centered on the ceramic portion of the antenna (not the pin).  This can be done with copper foil soldered to the vias of the existing ground plane.&lt;br /&gt;
[[image:gps_antenna_comparison.jpg|thumb|500px|left|SAM-LS 25mm / Emtac 20mm / Emtac 18mm / Sangshin 18mm / Sangshin 13mm / Sarantel P2]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 18mm Patch ===&lt;br /&gt;
[[image:Sangshin_18mm.jpg|thumb|Sangshin 18mm x 4mm 1580Mhz]]&lt;br /&gt;
The Sangshin KSA-ST1580MS18 antenna has proven to offer the best performance of the currently available options.  These are available from any Sanshin distributor such as [http://www.rfmw.com rfmw] ([http://www.rfmw.com/PortalProductDetail.aspx?ProdId=232436&amp;amp;fmt=1 here]) and cost approximately $6.50/ea. in small quantities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EMTAC 18mm Patch ===&lt;br /&gt;
[[image:Emtac_18mm.jpg|thumb|Emtac 18mm x 4mm 1580Mhz]]&lt;br /&gt;
Offering identical performance to the Sangshin in a less attractive package is the Emtac 18mm antenna.  The part number for the standard 1580MHz 18x18x4mm is ANA1580T18D40 and is not listed on their website.  Other frequencies are available on a special order basis and the 1584Mhz has proven to outperform all other frequencies when used with a 36mm ground plane and no radome.  The use of a radome (any material covering the antenna) or a larger ground plane should theoretically favor even higher frequencies.&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* [http://www.transplantgps.com/modules.html TransplantGPS] in MN, USA.  The 1580Mhz models are usually available at a cost of $3.55ea but there may be a minimum order requirement of ~$50 USD.&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=43 PPZUAV] ~$10.00 USD (no min. order requirement)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sangshin 13mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Sangshin_13mm_onboard.jpg|thumb|Sangshin 13mm x 4mm 1580Mhz]]&lt;br /&gt;
Part of interest: '''[http://www.sangshinec.com/eng/patch_spec.htm KSA-ST1580MS13]'''&lt;br /&gt;
&lt;br /&gt;
The Tiny 0.99 (not 0.9) and 1.1 were designed around this antenna but users are advised to install 18mm units for better performance.&lt;br /&gt;
&lt;br /&gt;
Size: 13 x 13 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
Center Frequency: 1580 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
Bandwidth: 5 MHz&amp;lt;br/&amp;gt;&lt;br /&gt;
@Fo: -15 dB&amp;lt;br/&amp;gt;&lt;br /&gt;
GAIN (dBi): 0 dBi&amp;lt;br/&amp;gt;&lt;br /&gt;
Ground Plane: 50 x 50 mm&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Available From'''&lt;br /&gt;
&lt;br /&gt;
[http://www.systroninc.com/ Systronic INC.] - Alberta, Canada&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emtac 20mm Patch ===&lt;br /&gt;
&lt;br /&gt;
[[image:Salvaged_20mm_onboard.jpg|thumb|Emtac 20mm x 4mm]]&lt;br /&gt;
The Tiny 0.9 was designed around this 1583Mhz antenna and performed extremely well.  Emtac has replaced this with an 18mm model that they claim offers even better performance.&lt;br /&gt;
&lt;br /&gt;
* Obsolete&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sarantel GeoHelix-P2 ===&lt;br /&gt;
&lt;br /&gt;
[[image:Geohelix-p2.jpg|thumb|Sarantel Geohelix P-2 1575Mhz]]&lt;br /&gt;
&lt;br /&gt;
This antenna is popular among UAV designers due to it's natural rejection of other radio frequencies such as those originating from the modem or video system as well as it's improved rejection of signals reflected from the ground.  U-blox recommends this antenna and features it in their [http://www.u-blox.com/news/sarantel.html reference design].  Frequency and polarization are not dependent upon ground plane geometry so this antenna is sold only in the true GPS frequency of 1575Mhz.&lt;br /&gt;
The geometry makes this antenna very inconvenient to mount, especially in an airplane.  Some very non-scientific testing has been done with one of these antennas connected to a Tiny with a short length of 50 Ohm coax above a 120mm square of ungrounded aluminum foil and performance was adequate.  The helical design should theoretically outperform a patch in the air, but not on the ground, so any organized comparison will be difficult.  Possibly the most important aspect of this antenna is it's natural RFI filtering, which should be evaluated further.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sarantel.com/products/geohelix-p2 GeoHelix-P2] Passive GPS Antenna [[http://www.sarantel.com/downloads/specifications/geohelix-p2.pdf datasheet]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Availability'''&lt;br /&gt;
&lt;br /&gt;
* Sarantel @ cost of approx $18 USD each (active versions available for ~$40)&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
* [http://www.onefastdaddy.com/catalog/product_info.php?products_id=40&amp;amp;osCsid=709e839698120c5cd324072b77d67cc1 PPZUAV]&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=File:LEA5HExternalModulePinout.jpg&amp;diff=4001</id>
		<title>File:LEA5HExternalModulePinout.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=File:LEA5HExternalModulePinout.jpg&amp;diff=4001"/>
		<updated>2008-09-01T20:00:48Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: LEA 5H pinout for connection to TWOG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LEA 5H pinout for connection to TWOG&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Main_Page&amp;diff=3997</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Main_Page&amp;diff=3997"/>
		<updated>2008-08-30T21:26:15Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;border-spacing:8px;margin:0px -8px&amp;quot; class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot;| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#82add9;font-size:150%;font-weight:bold;border:1px solid #a3bfb1;text-align:center;color:#ffffff;padding:0.2em 0.4em;&amp;quot;&amp;gt;Welcome To Paparazzi&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[General|General]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{General}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Hardware|Hardware]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Hardware}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Software|Software]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Software}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 1em;-moz-border-radius-topleft: 1em; &lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] [[Miscellaneous|Miscellaneous]] &lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Miscellaneous}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of right-column --&amp;gt;&lt;br /&gt;
| class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:70%;border:1px solid #cedff2;background-color:#f5faff;vertical-align:top&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;background-color:#f5fffa&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;The Paparazzi Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000&amp;quot;|[http://www.nongnu.org/paparazzi Paparazzi] is a free and open-source hardware and software project intended to create an exceptionally powerful and versatile autopilot system by allowing and encouraging input from the community. The project includes not only the airborne hardware and software, from voltage regulators and GPS receivers to [http://en.wikipedia.org/wiki/Kalman_filtering Kalman filtering] code, but also a powerful and ever-expanding array of ground hardware and software including modems, antennas, and a highly evolved user-friendly ground control software interface.&lt;br /&gt;
|-&lt;br /&gt;
|All hardware and software is open-source and freely available to anyone under the [http://www.gnu.org GNU] licencing agreement. [[Get_Hardware| Several vendors]] are currently producing and selling Paparazzi autopilots and popular accessories, making the system easy and affordable to all.&lt;br /&gt;
|-&lt;br /&gt;
|The key feature of the paparazzi autopilot is its unique combination of infrared thermopiles and inertial measurement for attitude sensing, providing a robust and accurate attitude estimate that requires no ground calibration and can recover from any launch attitude.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;The Paparazzi project at ENAC&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|The Paparazzi mini UAV project is now being used and developed at [http://www.enac.fr/ ENAC University].&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;color:#000&amp;quot;|&lt;br /&gt;
* A [http://www.debian.org debian] [http://www.recherche.enac.fr/paparazzi/debian repository] containing some packages not in the official distribution and required to run Paparazzi.&lt;br /&gt;
* PaparazziX [http://www.knoppix.net/ Knoppix] based live CD is available from the [http://www.recherche.enac.fr/paparazzi/paparazzix paparazzix directory].&lt;br /&gt;
* Nightly and release [http://www.recherche.enac.fr/paparazzi/tarball tarballs].&lt;br /&gt;
|-&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;background-color:#faf5ff;border:1px solid #ddcef2; text-align: justify;&amp;quot;&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;News&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;June 23, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Targets auvsi 08.JPG|thumb|left]]  &lt;br /&gt;
The [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi team took 2nd place in the Sixth Annual Student Unmanned Aerial Systems Competition! The event is sponsored by AUVSI (Association for Unmanned Vehicle Systems International) and was held at Webster Field, St. Inigoes, Maryland. It should also be noted that this was Paparazzi's and the OSAM Paparazzi team's first time at the competition.&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.navair.navy.mil/pma263/seafarers/default.htm Link to competition]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[http://hjnews.townnews.com/articles/2008/07/12/news/news01.txt News Story]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;June 13, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Twog_v1-00_top_side_3.jpg|thumb|left|'''T'''iny '''W'''ith'''O'''ut '''G'''ps]]  &lt;br /&gt;
The new baby autopilot is born.&amp;lt;br&amp;gt;&lt;br /&gt;
His name is TWOG, he weighs 8 grams and is 40.2 x 30.5mm long. He' in good health and looks a lot like his mother Tiny v2, except for the GPS receiver.&amp;lt;br&amp;gt;&lt;br /&gt;
The proud parents invite you to visit the [[Twog_v1|pictures and technical information album]]...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;March 26, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Heli_deck.jpg|thumb|left|Funjet on the helicopter deck]]  &lt;br /&gt;
Scientists from the [http://web.gfi.uib.no/index_e.html Geophysical Institute of the University of Bergen/Norway] flew Paparazzi controlled [[media:Funjet_spitsbergen.jpg|Funjet]] aircrafts equipped with meteorological sensors in the Arctic sea around Spitsbergen only with the help of a RC safety pilot and no Paparazzi team member nearby. They took off and landed on the helicopter deck of the Norwegian icebreaking coast guard vessel [http://www.jtashipphoto.dk/JTA-W303%20Svalbard.htm KV Svalbard] for one week and set a new Paparazzi low temperature record by flying at around -20°C and 15m/s wind in altitudes up to 1500m. For another two weeks they also collected data on Spitsbergen near Longyearbyen. See pictures in the gallery and a [http://www.youtube.com/watch?v=VWEa_4Hlm2s video].&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;March 15, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:Tiny_v2-1_3D_top.jpg|thumb|left|Tiny 2.11]]&lt;br /&gt;
A number of vendors are now offering assembled and unassembled autopilots, sensors and accessories.  The software is written, the hardware is built, what are you waiting for?  Getting started has never been easier!  More details on the [[Get_Hardware|Get Hardware]] page.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;February 6, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:eeePC.jpg|thumb|left|Paparazzi running on eeePC]]  &lt;br /&gt;
Looking for a small, light and cheap ground station ? Paparazzi runs on the [http://eeepc.asus.com ASUS eeePC] out of the box (after installing the Debian Paparazzi packages). Tested on the pre-installed Xandros distribution, on a standard Ubuntu and on the preconfigured [http://wiki.eeeuser.com/ubuntu:eeexubuntu:home eeeXubuntu].&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;January 27, 2008&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;| [[Image:StormTV.jpg|thumb|left|Paparazzi's Storm on TV in Turkey]]  [http://www.showtvnet.com/haber/playerd.asp?ptype=haber&amp;amp;product=/270108/ucak.wmv Storm on TV], A Paparazzi aircraft is featured on the biggest Television station in Turkey. (Sorry, the audio is only in Turkish...)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;[[News Archives]]&amp;lt;/h3&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;color:#000&amp;quot;|&lt;br /&gt;
[[Image:One_Small_Step.jpg|thumb|left|[[News Archives]]]] [[News Archives|Browse the archives]] for a look back at the earlier days of Paparazzi.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3996</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3996"/>
		<updated>2008-08-30T21:08:00Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Maxstream XBee Pro XSC 900Mhz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilot features a 5V tolerant 3V TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Modem|Airframe Configuration]] page.&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4Ghz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~32$&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro XSC 900Mhz ==&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4Ghz video compatibility of their high end 900Mhz models.  Sounds like the perfect modem for anyone who can use 900Mhz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz&lt;br /&gt;
* Output Power 100mW&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* Data Rate: 9600 bps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 24km (15 miles) line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~75 USD&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
== Maxstream 9XTend ==&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side, about 20 grams, but give good performance at range.  They have adjustable power settings from 100mW to 1W.  Testing has shown range up to 3.2km (2 miles) with 100mW.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : ~179 USD&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||N/A (requires 5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||N/A (requires 5V)||Permanently connect this pin to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
== Aerocomm ==&lt;br /&gt;
Aerocomm's API mode is not yet implemented. Therefore they are used in transparent mode. Users are reporting these modems cause more interference with GPS reception then the Maxstream modem.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4868-250 ===&lt;br /&gt;
* Frequency Band 868MHz (For Europe).&lt;br /&gt;
* Output Power (w/ 2dBi antenna) 250 mW &lt;br /&gt;
* Sensitivity (@ full RF data rate) -103 dB &lt;br /&gt;
* RF Data Rate Up to 28.8 Kbps &lt;br /&gt;
* INterface Data Rate Up to 57.6 Kbps &lt;br /&gt;
* Power Draw (typical) 240 mA TX / 36 mA RX &lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5V or 3.3v only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 kilometers line-of-sight &lt;br /&gt;
* Dimensions 49 x 42 x 5mm &lt;br /&gt;
* Weight &amp;lt; 21 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector &lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ConnexLink_USB_RF_Modem.jpg|thumb|Aerocomm USB Stand-alone Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Aerocomm AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Aerocomm AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Aerocomm AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm AC4790 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4790_HI.pdf AC4790 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4790.pdf AC4790 Manual]&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4868_868mhz_rf_transceiver.htm AC4848 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4868_HI.pdf AC4868 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4868.pdf AC4868 user manual]&lt;br /&gt;
&lt;br /&gt;
== Radiotronix ==&lt;br /&gt;
These Radiotronix modems are used in transparent mode. Use the WI232EUR Evaluation Software for configuring the modems for the set speed. Connect /CMD and CTS for programming. The DTS version for the US market might cause severe interference with GPS reception, it is not recommended. For a nice ground station modem just add a FTDI232 USB-&amp;gt;serial cable, a 3.3V regulator with 100nF capacitors from supplies to ground, solder a SMA cable/connector and put it in a nice case. Make sure you only connect RTS to /CMD if you want to reprogram the modem with the Evaluation software (see the open jumper connection in the picture, green wire) and leave it floating otherwise. The ANT-GXD105-FME/F from [http://www.roundsolutions.com Roundsolutions] was used as a ground station antenna at many competitions.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== WI232EUR ===&lt;br /&gt;
* Frequency Band 868MHz (for Europe)&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate Up to 76.8 kbps &lt;br /&gt;
* Interface Data Rate up to 115.2 kbps &lt;br /&gt;
* Power Draw (typical) 65 mA TX / 20 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 500 meters line-of-sight &lt;br /&gt;
* Dimensions 24 x 21 x 4mm &lt;br /&gt;
* Weight ~2 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* Antenna solder connector &lt;br /&gt;
* price : ~25$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_wiring.jpg|thumb|WI232EUR Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the WI232EUR to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''WI232 pins'''''||'''''Name'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||6||TxD||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||RxD||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||15-18||GND||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||19||VCC||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||4||/CMD||-||''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||7||CTS||-||''(Note 3)''&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the Radiotronix module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : connect to RTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
''Note 3 : connect to CTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_bopla.jpg|thumb|WI232EUR Modem in BOPLA case]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/eur_um.pdf WI232EUR data sheet]&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/rk-eur_um.pdf WI232EUR user's manual]&lt;br /&gt;
* [http://www.radiotronix.com/downloads/software/EUR/setup.exe Evaluation software]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== &amp;quot;Sparkfun&amp;quot; Roving Networks (WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : ~45$&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
and make a virtual connection to a Bluetooth serial port&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0  00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as /dev/rfcomm0 with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Coronis WaveCard ==&lt;br /&gt;
&lt;br /&gt;
These relatively inexpensive and light modules implement a Coronis proprietary protocol. Low power consumption - high latency - I would not recommend these modules mostly because of the low quality of the distribution and support. The documentation is rather poor and not easily available.&lt;br /&gt;
&lt;br /&gt;
'''Suport for these modems has been removed from the airborne code on Dec 10th, 2007.'''&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 400MHz, 868Mhz and 915MHz (3 versions)&lt;br /&gt;
* Output Power 25mW and 500mW (2 versions)&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* Data Rate 100 Kbps&lt;br /&gt;
* Power Draw (typical) 45mA (25mW), 450mA (500mW) TX / 15 mA RX &lt;br /&gt;
* Supply Voltage ...&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1km (25mW) , 5km (500mW) line-of-sight &lt;br /&gt;
* Dimensions 30 x 28 x 7mm (25mW), 37 x 30 x 7mm (500mW)&lt;br /&gt;
* 50 ohm RF port for antenna connection&lt;br /&gt;
|&lt;br /&gt;
[[Image:wavecard.jpg|Coronis Wavecard]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.coronis-systems.com/produit.php?lang=EN&amp;amp;id=WCA  www.coronis-systems.com]&lt;br /&gt;
* [[Media:CS-COM-SPRD-WAVECARD-E03B.pdf|Wavecard datasheet]]&lt;br /&gt;
&lt;br /&gt;
== Video Transmitter Telemetry ==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, a video transmitter is needed.  The paparazzi AP sends all telemetry data down with the video on the audio channel portion of the transmitter.  This means that the transmitter must have an audio channel.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different.  &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3995</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3995"/>
		<updated>2008-08-30T21:07:42Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Maxstream 9XTend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilot features a 5V tolerant 3V TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Modem|Airframe Configuration]] page.&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4Ghz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~32$&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro XSC 900Mhz ==&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4Ghz video compatibility of their high end 900Mhz models.  Sounds like the perfect modem for anyone who can use 900Mhz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz&lt;br /&gt;
* Output Power 100mW&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* Data Rate: 9600 bps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 24km (15 miles) line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~75$&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
== Maxstream 9XTend ==&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side, about 20 grams, but give good performance at range.  They have adjustable power settings from 100mW to 1W.  Testing has shown range up to 3.2km (2 miles) with 100mW.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : ~179 USD&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||N/A (requires 5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||N/A (requires 5V)||Permanently connect this pin to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
== Aerocomm ==&lt;br /&gt;
Aerocomm's API mode is not yet implemented. Therefore they are used in transparent mode. Users are reporting these modems cause more interference with GPS reception then the Maxstream modem.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4868-250 ===&lt;br /&gt;
* Frequency Band 868MHz (For Europe).&lt;br /&gt;
* Output Power (w/ 2dBi antenna) 250 mW &lt;br /&gt;
* Sensitivity (@ full RF data rate) -103 dB &lt;br /&gt;
* RF Data Rate Up to 28.8 Kbps &lt;br /&gt;
* INterface Data Rate Up to 57.6 Kbps &lt;br /&gt;
* Power Draw (typical) 240 mA TX / 36 mA RX &lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5V or 3.3v only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 kilometers line-of-sight &lt;br /&gt;
* Dimensions 49 x 42 x 5mm &lt;br /&gt;
* Weight &amp;lt; 21 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector &lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ConnexLink_USB_RF_Modem.jpg|thumb|Aerocomm USB Stand-alone Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Aerocomm AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Aerocomm AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Aerocomm AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm AC4790 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4790_HI.pdf AC4790 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4790.pdf AC4790 Manual]&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4868_868mhz_rf_transceiver.htm AC4848 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4868_HI.pdf AC4868 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4868.pdf AC4868 user manual]&lt;br /&gt;
&lt;br /&gt;
== Radiotronix ==&lt;br /&gt;
These Radiotronix modems are used in transparent mode. Use the WI232EUR Evaluation Software for configuring the modems for the set speed. Connect /CMD and CTS for programming. The DTS version for the US market might cause severe interference with GPS reception, it is not recommended. For a nice ground station modem just add a FTDI232 USB-&amp;gt;serial cable, a 3.3V regulator with 100nF capacitors from supplies to ground, solder a SMA cable/connector and put it in a nice case. Make sure you only connect RTS to /CMD if you want to reprogram the modem with the Evaluation software (see the open jumper connection in the picture, green wire) and leave it floating otherwise. The ANT-GXD105-FME/F from [http://www.roundsolutions.com Roundsolutions] was used as a ground station antenna at many competitions.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== WI232EUR ===&lt;br /&gt;
* Frequency Band 868MHz (for Europe)&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate Up to 76.8 kbps &lt;br /&gt;
* Interface Data Rate up to 115.2 kbps &lt;br /&gt;
* Power Draw (typical) 65 mA TX / 20 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 500 meters line-of-sight &lt;br /&gt;
* Dimensions 24 x 21 x 4mm &lt;br /&gt;
* Weight ~2 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* Antenna solder connector &lt;br /&gt;
* price : ~25$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_wiring.jpg|thumb|WI232EUR Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the WI232EUR to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''WI232 pins'''''||'''''Name'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||6||TxD||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||RxD||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||15-18||GND||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||19||VCC||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||4||/CMD||-||''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||7||CTS||-||''(Note 3)''&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the Radiotronix module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : connect to RTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
''Note 3 : connect to CTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_bopla.jpg|thumb|WI232EUR Modem in BOPLA case]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/eur_um.pdf WI232EUR data sheet]&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/rk-eur_um.pdf WI232EUR user's manual]&lt;br /&gt;
* [http://www.radiotronix.com/downloads/software/EUR/setup.exe Evaluation software]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== &amp;quot;Sparkfun&amp;quot; Roving Networks (WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : ~45$&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
and make a virtual connection to a Bluetooth serial port&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0  00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as /dev/rfcomm0 with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Coronis WaveCard ==&lt;br /&gt;
&lt;br /&gt;
These relatively inexpensive and light modules implement a Coronis proprietary protocol. Low power consumption - high latency - I would not recommend these modules mostly because of the low quality of the distribution and support. The documentation is rather poor and not easily available.&lt;br /&gt;
&lt;br /&gt;
'''Suport for these modems has been removed from the airborne code on Dec 10th, 2007.'''&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 400MHz, 868Mhz and 915MHz (3 versions)&lt;br /&gt;
* Output Power 25mW and 500mW (2 versions)&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* Data Rate 100 Kbps&lt;br /&gt;
* Power Draw (typical) 45mA (25mW), 450mA (500mW) TX / 15 mA RX &lt;br /&gt;
* Supply Voltage ...&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1km (25mW) , 5km (500mW) line-of-sight &lt;br /&gt;
* Dimensions 30 x 28 x 7mm (25mW), 37 x 30 x 7mm (500mW)&lt;br /&gt;
* 50 ohm RF port for antenna connection&lt;br /&gt;
|&lt;br /&gt;
[[Image:wavecard.jpg|Coronis Wavecard]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.coronis-systems.com/produit.php?lang=EN&amp;amp;id=WCA  www.coronis-systems.com]&lt;br /&gt;
* [[Media:CS-COM-SPRD-WAVECARD-E03B.pdf|Wavecard datasheet]]&lt;br /&gt;
&lt;br /&gt;
== Video Transmitter Telemetry ==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, a video transmitter is needed.  The paparazzi AP sends all telemetry data down with the video on the audio channel portion of the transmitter.  This means that the transmitter must have an audio channel.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different.  &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3994</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3994"/>
		<updated>2008-08-30T21:05:48Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Maxstream XBee Pro XSC 900Mhz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilot features a 5V tolerant 3V TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Modem|Airframe Configuration]] page.&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4Ghz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~32$&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro XSC 900Mhz ==&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4Ghz video compatibility of their high end 900Mhz models.  Sounds like the perfect modem for anyone who can use 900Mhz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz&lt;br /&gt;
* Output Power 100mW&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* Data Rate: 9600 bps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 24km (15 miles) line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~75$&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
== Maxstream 9XTend ==&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side(~20grams) but give good performance at range.  They have adjustable power settings from 100mW to 1W.  Testing has shown range up to 2 miles with 100mW.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : ~179$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||N/A (requires 5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||N/A (requires 5V)||Permanently connect this pin to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
== Aerocomm ==&lt;br /&gt;
Aerocomm's API mode is not yet implemented. Therefore they are used in transparent mode. Users are reporting these modems cause more interference with GPS reception then the Maxstream modem.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4868-250 ===&lt;br /&gt;
* Frequency Band 868MHz (For Europe).&lt;br /&gt;
* Output Power (w/ 2dBi antenna) 250 mW &lt;br /&gt;
* Sensitivity (@ full RF data rate) -103 dB &lt;br /&gt;
* RF Data Rate Up to 28.8 Kbps &lt;br /&gt;
* INterface Data Rate Up to 57.6 Kbps &lt;br /&gt;
* Power Draw (typical) 240 mA TX / 36 mA RX &lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5V or 3.3v only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 kilometers line-of-sight &lt;br /&gt;
* Dimensions 49 x 42 x 5mm &lt;br /&gt;
* Weight &amp;lt; 21 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector &lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ConnexLink_USB_RF_Modem.jpg|thumb|Aerocomm USB Stand-alone Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Aerocomm AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Aerocomm AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Aerocomm AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm AC4790 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4790_HI.pdf AC4790 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4790.pdf AC4790 Manual]&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4868_868mhz_rf_transceiver.htm AC4848 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4868_HI.pdf AC4868 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4868.pdf AC4868 user manual]&lt;br /&gt;
&lt;br /&gt;
== Radiotronix ==&lt;br /&gt;
These Radiotronix modems are used in transparent mode. Use the WI232EUR Evaluation Software for configuring the modems for the set speed. Connect /CMD and CTS for programming. The DTS version for the US market might cause severe interference with GPS reception, it is not recommended. For a nice ground station modem just add a FTDI232 USB-&amp;gt;serial cable, a 3.3V regulator with 100nF capacitors from supplies to ground, solder a SMA cable/connector and put it in a nice case. Make sure you only connect RTS to /CMD if you want to reprogram the modem with the Evaluation software (see the open jumper connection in the picture, green wire) and leave it floating otherwise. The ANT-GXD105-FME/F from [http://www.roundsolutions.com Roundsolutions] was used as a ground station antenna at many competitions.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== WI232EUR ===&lt;br /&gt;
* Frequency Band 868MHz (for Europe)&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate Up to 76.8 kbps &lt;br /&gt;
* Interface Data Rate up to 115.2 kbps &lt;br /&gt;
* Power Draw (typical) 65 mA TX / 20 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 500 meters line-of-sight &lt;br /&gt;
* Dimensions 24 x 21 x 4mm &lt;br /&gt;
* Weight ~2 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* Antenna solder connector &lt;br /&gt;
* price : ~25$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_wiring.jpg|thumb|WI232EUR Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the WI232EUR to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''WI232 pins'''''||'''''Name'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||6||TxD||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||RxD||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||15-18||GND||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||19||VCC||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||4||/CMD||-||''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||7||CTS||-||''(Note 3)''&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the Radiotronix module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : connect to RTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
''Note 3 : connect to CTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_bopla.jpg|thumb|WI232EUR Modem in BOPLA case]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/eur_um.pdf WI232EUR data sheet]&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/rk-eur_um.pdf WI232EUR user's manual]&lt;br /&gt;
* [http://www.radiotronix.com/downloads/software/EUR/setup.exe Evaluation software]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== &amp;quot;Sparkfun&amp;quot; Roving Networks (WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : ~45$&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
and make a virtual connection to a Bluetooth serial port&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0  00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as /dev/rfcomm0 with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Coronis WaveCard ==&lt;br /&gt;
&lt;br /&gt;
These relatively inexpensive and light modules implement a Coronis proprietary protocol. Low power consumption - high latency - I would not recommend these modules mostly because of the low quality of the distribution and support. The documentation is rather poor and not easily available.&lt;br /&gt;
&lt;br /&gt;
'''Suport for these modems has been removed from the airborne code on Dec 10th, 2007.'''&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 400MHz, 868Mhz and 915MHz (3 versions)&lt;br /&gt;
* Output Power 25mW and 500mW (2 versions)&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* Data Rate 100 Kbps&lt;br /&gt;
* Power Draw (typical) 45mA (25mW), 450mA (500mW) TX / 15 mA RX &lt;br /&gt;
* Supply Voltage ...&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1km (25mW) , 5km (500mW) line-of-sight &lt;br /&gt;
* Dimensions 30 x 28 x 7mm (25mW), 37 x 30 x 7mm (500mW)&lt;br /&gt;
* 50 ohm RF port for antenna connection&lt;br /&gt;
|&lt;br /&gt;
[[Image:wavecard.jpg|Coronis Wavecard]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.coronis-systems.com/produit.php?lang=EN&amp;amp;id=WCA  www.coronis-systems.com]&lt;br /&gt;
* [[Media:CS-COM-SPRD-WAVECARD-E03B.pdf|Wavecard datasheet]]&lt;br /&gt;
&lt;br /&gt;
== Video Transmitter Telemetry ==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, a video transmitter is needed.  The paparazzi AP sends all telemetry data down with the video on the audio channel portion of the transmitter.  This means that the transmitter must have an audio channel.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different.  &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3993</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=3993"/>
		<updated>2008-08-30T21:04:00Z</updated>

		<summary type="html">&lt;p&gt;Rcbrother: /* Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilot features a 5V tolerant 3V TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate thru non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Modem|Airframe Configuration]] page.&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro 2.4GHz (802.15.4, &amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4Ghz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~32$&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
&lt;br /&gt;
== Maxstream XBee Pro XSC 900Mhz ==&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4Ghz video compatibility of their high end 900Mhz models.  Sounds like the perfect modem for anyone who can use 900Mhz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz&lt;br /&gt;
* Output Power 100mW&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* Data Rate: 9600 bps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 miles line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : ~75$&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Maxstream 9XTend ==&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side(~20grams) but give good performance at range.  They have adjustable power settings from 100mW to 1W.  Testing has shown range up to 2 miles with 100mW.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : ~179$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||N/A (requires 5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||N/A (requires 5V)||Permanently connect this pin to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
== Aerocomm ==&lt;br /&gt;
Aerocomm's API mode is not yet implemented. Therefore they are used in transparent mode. Users are reporting these modems cause more interference with GPS reception then the Maxstream modem.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4868-250 ===&lt;br /&gt;
* Frequency Band 868MHz (For Europe).&lt;br /&gt;
* Output Power (w/ 2dBi antenna) 250 mW &lt;br /&gt;
* Sensitivity (@ full RF data rate) -103 dB &lt;br /&gt;
* RF Data Rate Up to 28.8 Kbps &lt;br /&gt;
* INterface Data Rate Up to 57.6 Kbps &lt;br /&gt;
* Power Draw (typical) 240 mA TX / 36 mA RX &lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5V or 3.3v only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 15 kilometers line-of-sight &lt;br /&gt;
* Dimensions 49 x 42 x 5mm &lt;br /&gt;
* Weight &amp;lt; 21 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector &lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ConnexLink_USB_RF_Modem.jpg|thumb|Aerocomm USB Stand-alone Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : ~80$&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Aerocomm AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Aerocomm AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Aerocomm AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm AC4790 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4790_HI.pdf AC4790 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4790.pdf AC4790 Manual]&lt;br /&gt;
* [http://www.aerocomm.com/rf_transceiver_modules/ac4868_868mhz_rf_transceiver.htm AC4848 product page]&lt;br /&gt;
* [http://www.aerocomm.com/docs/Datasheet_AC4868_HI.pdf AC4868 Datasheet]&lt;br /&gt;
* [http://www.aerocomm.com/docs/User_Manual_AC4868.pdf AC4868 user manual]&lt;br /&gt;
&lt;br /&gt;
== Radiotronix ==&lt;br /&gt;
These Radiotronix modems are used in transparent mode. Use the WI232EUR Evaluation Software for configuring the modems for the set speed. Connect /CMD and CTS for programming. The DTS version for the US market might cause severe interference with GPS reception, it is not recommended. For a nice ground station modem just add a FTDI232 USB-&amp;gt;serial cable, a 3.3V regulator with 100nF capacitors from supplies to ground, solder a SMA cable/connector and put it in a nice case. Make sure you only connect RTS to /CMD if you want to reprogram the modem with the Evaluation software (see the open jumper connection in the picture, green wire) and leave it floating otherwise. The ANT-GXD105-FME/F from [http://www.roundsolutions.com Roundsolutions] was used as a ground station antenna at many competitions.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== WI232EUR ===&lt;br /&gt;
* Frequency Band 868MHz (for Europe)&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate Up to 76.8 kbps &lt;br /&gt;
* Interface Data Rate up to 115.2 kbps &lt;br /&gt;
* Power Draw (typical) 65 mA TX / 20 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 500 meters line-of-sight &lt;br /&gt;
* Dimensions 24 x 21 x 4mm &lt;br /&gt;
* Weight ~2 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* Antenna solder connector &lt;br /&gt;
* price : ~25$&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_wiring.jpg|thumb|WI232EUR Modem]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the WI232EUR to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''WI232 pins'''''||'''''Name'''''||'''''Tiny Serial-1'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||6||TxD||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||RxD||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||15-18||GND||1|| - &lt;br /&gt;
|-&lt;br /&gt;
||19||VCC||2||+3.3v&lt;br /&gt;
|-&lt;br /&gt;
||4||/CMD||-||''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||7||CTS||-||''(Note 3)''&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the Radiotronix module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : connect to RTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
''Note 3 : connect to CTS to program device with Evaluation software''&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
[[Image:Wi232eur_bopla.jpg|thumb|WI232EUR Modem in BOPLA case]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/eur_um.pdf WI232EUR data sheet]&lt;br /&gt;
* [http://www.radiotronix.com/datasheets/new/rk-eur_um.pdf WI232EUR user's manual]&lt;br /&gt;
* [http://www.radiotronix.com/downloads/software/EUR/setup.exe Evaluation software]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== &amp;quot;Sparkfun&amp;quot; Roving Networks (WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : ~45$&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
and make a virtual connection to a Bluetooth serial port&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0  00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as /dev/rfcomm0 with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Coronis WaveCard ==&lt;br /&gt;
&lt;br /&gt;
These relatively inexpensive and light modules implement a Coronis proprietary protocol. Low power consumption - high latency - I would not recommend these modules mostly because of the low quality of the distribution and support. The documentation is rather poor and not easily available.&lt;br /&gt;
&lt;br /&gt;
'''Suport for these modems has been removed from the airborne code on Dec 10th, 2007.'''&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 400MHz, 868Mhz and 915MHz (3 versions)&lt;br /&gt;
* Output Power 25mW and 500mW (2 versions)&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* Data Rate 100 Kbps&lt;br /&gt;
* Power Draw (typical) 45mA (25mW), 450mA (500mW) TX / 15 mA RX &lt;br /&gt;
* Supply Voltage ...&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1km (25mW) , 5km (500mW) line-of-sight &lt;br /&gt;
* Dimensions 30 x 28 x 7mm (25mW), 37 x 30 x 7mm (500mW)&lt;br /&gt;
* 50 ohm RF port for antenna connection&lt;br /&gt;
|&lt;br /&gt;
[[Image:wavecard.jpg|Coronis Wavecard]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.coronis-systems.com/produit.php?lang=EN&amp;amp;id=WCA  www.coronis-systems.com]&lt;br /&gt;
* [[Media:CS-COM-SPRD-WAVECARD-E03B.pdf|Wavecard datasheet]]&lt;br /&gt;
&lt;br /&gt;
== Video Transmitter Telemetry ==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, a video transmitter is needed.  The paparazzi AP sends all telemetry data down with the video on the audio channel portion of the transmitter.  This means that the transmitter must have an audio channel.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different.  &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rcbrother</name></author>
	</entry>
</feed>