<?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=Sergio812</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=Sergio812"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/Sergio812"/>
	<updated>2026-04-28T20:33:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Overview&amp;diff=9586</id>
		<title>Overview</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Overview&amp;diff=9586"/>
		<updated>2011-06-14T12:13:56Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:Paparazzi_System_overview.jpg|right|Paparazzi System Overview]]&lt;br /&gt;
Paparazzi is a complete system of hardware and software for autonomous aircraft as well as complete ground station mission planning and monitoring software utilizing a bi-directional datalink for telemetry and control.&lt;br /&gt;
&lt;br /&gt;
== System Architecture ==&lt;br /&gt;
&lt;br /&gt;
The following figure shows the main agents of the system: one (or several) aircraft and the distributed ground architecture (usually distributed on a single computer):&lt;br /&gt;
&lt;br /&gt;
[[Image:Pprz_communication_agents.gif]]&lt;br /&gt;
&lt;br /&gt;
The UAV (in blue) is navigating autonomously and is monitored and controlled from the ground (in brown). The [[GCS|ground control station (GCS)]] provides a graphical user interface with telemetry data received by the ''link agent'' which manages the ground-based radio modem. The ''link agent'' distributes telemetry data across the network (a single computer, a local network or the internet) where it can be used locally or remotely by the:&lt;br /&gt;
* '''messages''' - a real-time display of all telemetry data&lt;br /&gt;
* '''server''' - an agent that logs, distributes, and preprocesses these messages for the GCS.&lt;br /&gt;
All of these processes run simultaneously and each module is independently controled and configured from [[Paparazzi_Center]]. &lt;br /&gt;
&lt;br /&gt;
Your first experiments with the system should be with the simulator where everything runs on your local machine. The configuration is then slightly different:&lt;br /&gt;
&lt;br /&gt;
[[Image:comm_sitl.gif]]&lt;br /&gt;
&lt;br /&gt;
Here the aircarft and its radio link are replaced by the simulator. An optional ''gaia'' agent is also available to introduce some environmental parameters such as wind, infrared contrast, GPS quality, and time scale reference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Aircraft ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[image:Paparazzi_Equiped_Aircraft.jpg|Paparazzi Equiped Aircraft]]&lt;br /&gt;
|&lt;br /&gt;
* '''A'''utopilot Control Board&lt;br /&gt;
* '''B'''attery&lt;br /&gt;
* '''D'''atalink Radio-Modem &amp;amp; Antenna&lt;br /&gt;
* '''G'''PS Receiver&lt;br /&gt;
* '''I'''R Sensor Board&lt;br /&gt;
* '''M'''otor &amp;amp; Controller&lt;br /&gt;
* '''R'''C Receiver &amp;amp; Antenna&lt;br /&gt;
* '''S'''ervos&lt;br /&gt;
* '''P'''ayload = Camera &amp;amp; Video Transmitter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== The Airframe ===&lt;br /&gt;
&lt;br /&gt;
The Paparazzi airborne system is highly configurable and can be used to autonomously operate almost any airframe. It is currently in use on airframes ranging from 30cm to 1.4m, and 180g to several kg. In the early days of the project, slow and stable airframes such as the venerable Twinstar and Microjet were favored, but today the system is employed in a wide variety of high performance aircrafts, many with little or no natural stability, and many designed specifically around the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The [[Gallery|User's Gallery]] shows some of the many Paparazzi aircraft.&lt;br /&gt;
&lt;br /&gt;
=== Airborne Electronics ===&lt;br /&gt;
&lt;br /&gt;
===== Controller Board =====&lt;br /&gt;
&lt;br /&gt;
[[image:tiny_proto1_top_small.jpg|frame|Tiny Controller Board]]&lt;br /&gt;
Several controller boards have been designed to run the Paparazzi autopilot software, using either Atmel AVR or Philips ARM7 LPC micro-controllers. These boards include one or two micro-controllers and the required connectors to handle the servos, motor controllers, sensors, RC receiver, radio modem, and a variety of payloads.  All of the [http://cvs.savannah.nongnu.org/viewcvs/paparazzi3/hw/?root=paparazzi schematics and PCB files] are available under the GPL licence. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
More details on the controller boards are available on the [[Hardware|Hardware Pages]].&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Sensors =====&lt;br /&gt;
&lt;br /&gt;
[[image:ir_sensor_bot_small.jpg|frame|2 Axis IR Sensor Board]]&lt;br /&gt;
Paparazzi autopilots can interface with virtually any type of sensor but the vast majority of applications rely on a set of 6 orthogonal infrared temperature sensors to estimate the orientation of the aircraft relative to the warm earth and cold sky.  The IR system provides a robust and absolute attitude estimate that is immune to vibration and disorienting launches, wind gusts, or stalls that may confuse inertial-based autopilots.  Paparazzi also uses conventional inertial systems on hovering aircraft such as quadrotors and helicopters with freely available [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/ software and hardware sources].  &amp;lt;br&amp;gt;&amp;lt;br&amp;gt; Fixed wing airborne hardware typically includes infrared sensors, GPS &amp;amp; occasionally a gyroscope for roll or pitch rate damping on more agile aircraft.&lt;br /&gt;
A standard GPS receiver from u-blox is used, either as a stand-alone unit for the [[Classix]] or [[Twog_v1|TWOG]] autopilots, or as a fully integrated package in the [[Tiny_v2|Tiny]] autopilot.&lt;br /&gt;
&lt;br /&gt;
More details on the sensors are available on the [[Sensors|Sensors page]].&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
===== Communications =====&lt;br /&gt;
&lt;br /&gt;
[[image:ac4868_transceiver.jpg|frame|Aerocomm AC4868 Radio-Modem]]&lt;br /&gt;
Airborne hardware also includes communications devices : Radio Modem (Datalink) &amp;amp; RC Receiver (Safety Link).&lt;br /&gt;
Any wireless device providing a serial link can be used for the telemetry and the telecontrol (Datalink). &lt;br /&gt;
&lt;br /&gt;
More details on communications hardware are available on the [[Modems|Modems page]].&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
===== Example Setup =====&lt;br /&gt;
&lt;br /&gt;
[[image:ppzsetup002.jpg|frame|Sample 2 servo setup]]&lt;br /&gt;
A typical configuration would include two servos (elevon setup), receiver, IR sensors, FTDI or RF Modem for serial communications either wired or wireless. ESC is not shown. NOTE: DO NOT CONNECT POWER WIRE FROM ESC TO TINY. Only connect Ground and Signal for the ESC to the Tiny.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
=== Airborne Software ===&lt;br /&gt;
&lt;br /&gt;
The Paparazzi autopilot provides the following features:&lt;br /&gt;
* RC receiver (PPM signal) decoding&lt;br /&gt;
* Servos and motor controller (PPM signal) control&lt;br /&gt;
* Manual control with the RC&lt;br /&gt;
* Control with augmented stability (named '''AUTO1''')&lt;br /&gt;
* Autonomous navigation (named '''AUTO2''') in 3D, including&lt;br /&gt;
** Waypoint navigation&lt;br /&gt;
** Segment and circle navigation&lt;br /&gt;
** Altitude hold, glide following&lt;br /&gt;
** High level flight plan language execution (sequence, loops, goto...)&lt;br /&gt;
* Telemetry to the ground station&lt;br /&gt;
* Telecontrol (datalink) from the ground station (navigation control, waypoint modifications, tuning)&lt;br /&gt;
&lt;br /&gt;
The autopilot code is written in C while all the configuration code is translated from XML files at compile time.&lt;br /&gt;
Code is segregated into two processes respectively handling the ''fly by wire'' (manual control) and the ''autopilot'' itself (stabilization and navigation). These processes are segregated on two-processor controllers such as the [[Classix|Classix]].&lt;br /&gt;
&lt;br /&gt;
== Ground Control Station (GCS) ==&lt;br /&gt;
&lt;br /&gt;
=== Ground Computer ===&lt;br /&gt;
&lt;br /&gt;
The software is developped to be run on a i386 architecture with the [http://www.debian.org Debian GNU/linux] operating system. However a Live CD including all the software is provided: it should be able to boot any standard laptop.&lt;br /&gt;
&lt;br /&gt;
=== Ground Software ===&lt;br /&gt;
&lt;br /&gt;
The software mainly provides&lt;br /&gt;
* compiling tools to produce the airborne code from the configuration;&lt;br /&gt;
* a GUI to control and interact with the UAV(s) during flight;&lt;br /&gt;
* a basic simulator to ease the development of flight plans.&lt;br /&gt;
&lt;br /&gt;
=== Datalink ===&lt;br /&gt;
&lt;br /&gt;
Paparazzi offers several possibilities to supervise the UAV flight from the ground. The default one uses a bidirectionnal wireless modem which supports both telemetry (downlink) and telecontrol (uplink). Thanks to this datalink, flight parameters are available in real time and full control of the navigation and tuning of one or several aircraft is possible from the ground station.&lt;br /&gt;
&lt;br /&gt;
=== Safety Link ===&lt;br /&gt;
&lt;br /&gt;
The airborne hardware and software support the connection to a standard (patched) radio-control receiver. While this link is not required for actual autonomous flights, it may help during the tuning of a new aircraft and is usually considered as an important safety control redundancy.&lt;br /&gt;
&lt;br /&gt;
== Payloads ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is designed to interface with a wide variety of payloads. The airborne board can control many servos for autonomous and/or manual [[Pan_Tilt_Camera|Pan/Tilt camera systems]] or other mechanical payloads, SPI, I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C, and GPIO connections are available to connect digital devices (i.e. lights or digital camera shutter), and analog inputs are available to interface with just about any sensor imaginable. The associated software is easily integrated into the open-source code. The [[Classix]] board can also be connected to a [http://www.gumstix.com Gumstix Computer] for highly sophisticated payload software applications.&lt;br /&gt;
&lt;br /&gt;
== Disclaimers ==&lt;br /&gt;
&lt;br /&gt;
It should be understood that smooth, reliable autonomous flight is a great feat and will require significant time and effort to achieve, even with a highly evolved open system like Paparazzi. The time required will vary based on experience, aircraft, and luck. From experience however, users can expect to spend a similar amount of time learning and configuring Paparazzi as they may with any of the commercially available systems.&lt;br /&gt;
&lt;br /&gt;
Linux itself can pose quite a challenge to install, configure, and learn. To help ease the transition for those not already running Linux, the LiveCD option is available to help get you started. The LiveCD allows the user to save all configuration files as well as any user-modified source code on a pen drive or as a compressed file on your hard drive without affecting your existing OS.  We strongly urge new users to [[Contact|Contact]] someone from the Paparazzi team before beginning any hardware investment as we can help you get the most out of the system.&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/CodeEditors&amp;diff=9585</id>
		<title>DevGuide/CodeEditors</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/CodeEditors&amp;diff=9585"/>
		<updated>2011-06-13T05:33:57Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
So you want to adjust the sourcecode to your wishes, get rid of some bugs that bother you and help to improve the code, great! While theoretically it all an be done with VI and command line instructions, learning to code for Paparazzi this way is a little cumbersome. Therefore it is a good idea to set up an IDE Integrated Development Environment.&lt;br /&gt;
&lt;br /&gt;
As you may have noticed, this page is far from finished, it really would be great if you help to improve this page with even a small improvement. &lt;br /&gt;
&lt;br /&gt;
== IDE for OCAML ==&lt;br /&gt;
&lt;br /&gt;
We start of with OCAML IDE's first&lt;br /&gt;
&lt;br /&gt;
=== EMACS&lt;br /&gt;
&lt;br /&gt;
http://www-rocq.inria.fr/~acohen/tuareg/index.html.en&lt;br /&gt;
&lt;br /&gt;
=== Netbeans ===&lt;br /&gt;
&lt;br /&gt;
==== Installation ====&lt;br /&gt;
First install a reasonable new Netbeans, e.g. v6.8 via the synaptic package manager in Ubuntu or use the commandline&lt;br /&gt;
&lt;br /&gt;
==== OCAML Plugin ====&lt;br /&gt;
&lt;br /&gt;
http://ocamlplugin.loki-a.com/index.php?title=Main_Page&lt;br /&gt;
&lt;br /&gt;
# Start netbeans IDE&lt;br /&gt;
# Go to Netbean menu -Tools - Plugins&lt;br /&gt;
&lt;br /&gt;
# Select tab - Settings&lt;br /&gt;
# Click the Add button&lt;br /&gt;
&lt;br /&gt;
Name: Ocaml from Loki a&lt;br /&gt;
URL:  http://ocamlplugin.loki-a.com/ocamlplugin/updates/updates.xml&lt;br /&gt;
&lt;br /&gt;
# Then click the tab &amp;quot;Available plugins&amp;quot;&lt;br /&gt;
# Select for install from the list the &amp;quot;Ocaml Plugin&amp;quot;&lt;br /&gt;
# Click Install&lt;br /&gt;
# Click Install Then Next&lt;br /&gt;
# If you see &amp;quot;Signed but not trusted, ignore the message just click &amp;quot;continue&amp;quot;&lt;br /&gt;
# If it all worked, you will see &amp;quot;Install completed sucessfully, just click &amp;quot;Finish&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Syntax Highlighting ====&lt;br /&gt;
&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
&lt;br /&gt;
http://www.cocan.org/ocaml_and_eclipse&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
== IDE for C and CPP ==&lt;br /&gt;
&lt;br /&gt;
Next are the IDE's for C develpment&lt;br /&gt;
&lt;br /&gt;
=== Netbeans ===&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
=== Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
== Debugging tools ==&lt;br /&gt;
&lt;br /&gt;
GDB&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&amp;diff=9584</id>
		<title>Installation/FromScratch</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/FromScratch&amp;diff=9584"/>
		<updated>2011-06-13T05:32:16Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro ==&lt;br /&gt;
&lt;br /&gt;
As with all Wiki pages, also this page is a work in progress. try to be a big help to the Paparazzi project and improve this page whenever you can. If you have a distribution different from Ubuntu which doesn't satisfy any other dependency and have instructions about compiling it, packaging it, feel free to add any reference on how to do that on this wikipage.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
The goal of this page is to clarify about which version of each piece of software has to be compiled, where to find that software, patches needed to make it compile on Linux. In our case 64bit Linux. This includes compiling all paparazzi-dev, paparazzi-arm7, paparazzi-stm32 and paparazzi-bin software on your machine, running an Ubuntu Lucid Lynx or later Linux distribution or maybe even FreeBSD, or OSX.&lt;br /&gt;
&lt;br /&gt;
== The shortcut ==&lt;br /&gt;
&lt;br /&gt;
Maybe you are no so interested in the details at this moment and just want to quickly install. That's fine, for that we are working on a script and you only need to run one line to get everything installed. For this to work out you do need a working internet connection, but since you can read this text, that will probably not pose a problem.&lt;br /&gt;
&lt;br /&gt;
 $ cd ~ &amp;amp;&amp;amp; wget http://openuas.org/pub/paparazzifromscratch.sh (still not ready and a work in progress)&lt;br /&gt;
&lt;br /&gt;
If you used the line above, and it all worked out you can stop reading now since everything is installed and compiled, ready for you to use.&lt;br /&gt;
&lt;br /&gt;
== Paparazzi-dev packages ==&lt;br /&gt;
&lt;br /&gt;
For Ubuntu users, you can install the following packages from standard repository. You can just copy the line(s) and paste into your terminal. But do not copy the $ sign, this symbol is just added on this page to show that it is to be pasted at a normal terminal prompt.&lt;br /&gt;
&lt;br /&gt;
=== Whole lot in one ===&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \&lt;br /&gt;
                       liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev libpcre-ocaml \&lt;br /&gt;
                       libpcre-ocaml-dev libgnomecanvas2-0 libgnomecanvas2-dev libglade2-0 libglade2-dev make build-essential \&lt;br /&gt;
                       git-core gnuplot boa m4 libtool libftdi-dev libmpfr-dev tcl8.5-dev xutils-dev&lt;br /&gt;
&lt;br /&gt;
=== Ocaml and libraries ===&lt;br /&gt;
&lt;br /&gt;
Ocaml, short for Objective Caml is the most popular variant of the Caml language. The Paparazzi Ground Control Station (GCS) and some of it's tools are crafted in this language.&lt;br /&gt;
&lt;br /&gt;
* ocaml, ocaml-camlimages-devel, ocaml-lablgtk2-devel, ocaml-xml-light-devel, ocamlnet-ocaml-devel&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install ocaml libcamlimages-ocaml liblablgtk2-ocaml-dev liblablgtk2-gl-ocaml-dev \&lt;br /&gt;
                        liblablgtk2-gnome-ocaml-dev libxml-light-ocaml-dev libocamlnet-ocaml-dev&lt;br /&gt;
&lt;br /&gt;
=== Gnome canvas Library ===&lt;br /&gt;
&lt;br /&gt;
The GnomeCanvas is an engine for structured graphics that offers a rich imaging model, high performance rendering, and a powerful, high level API. This widget can be used for flexible display of graphics and for creating interactive user interface elements.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev&lt;br /&gt;
&lt;br /&gt;
=== USB Library ===&lt;br /&gt;
&lt;br /&gt;
The libusb project aims to create a library for use by user level applications to access USB devices regardless of OS. http://www.libusb.org&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libusb-dev&lt;br /&gt;
&lt;br /&gt;
=== Ocaml PCRE ===&lt;br /&gt;
&lt;br /&gt;
This OCaml-library interfaces the PCRE (Perl-compatibility regular expressions) C library. it can be used for matching regular expressions which are written in Perl style.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libpcre-ocaml libpcre-ocaml-dev&lt;br /&gt;
&lt;br /&gt;
=== Glade Library ===&lt;br /&gt;
&lt;br /&gt;
Libglade is a library that performs a similar job to the C source output routines in the GLADE user interface builder. Whereas GLADE's output routines create C source code that must be compiled, libglade builds the interface from an XML file (GLADE's save format) at runtime. This can allow modifying the user interface without recompiling.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libglade2-0 libglade2-dev&lt;br /&gt;
&lt;br /&gt;
=== Tcl/Tk ===&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install tcl8.5-dev&lt;br /&gt;
&lt;br /&gt;
Also the some utils are required to compile and  install Ivy.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install xutils-dev&lt;br /&gt;
&lt;br /&gt;
=== Make ===&lt;br /&gt;
&lt;br /&gt;
GNU Make is an utility which controls the generation of executables and other target files of a program from the program's source files. &lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install make&lt;br /&gt;
&lt;br /&gt;
=== Build essential ===&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install build-essential&lt;br /&gt;
&lt;br /&gt;
=== Libtool ===&lt;br /&gt;
&lt;br /&gt;
GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface. Creating the files for Paparazzi software building becomes less cumbersome by using this tool.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libtool&lt;br /&gt;
&lt;br /&gt;
=== Git Client ===&lt;br /&gt;
&lt;br /&gt;
Git is a version control system. Version control systems allow many individuals to collaborate on the Paparazzi source code. This is needed to retrieve the latest sourcecode from various packages and Paparazzi sourcecode itself.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install git-core&lt;br /&gt;
&lt;br /&gt;
=== GNU Plot ===&lt;br /&gt;
&lt;br /&gt;
A command-line driven interactive plotting program. Unknow if it is used&lt;br /&gt;
 &lt;br /&gt;
 $ sudo apt-get install gnuplot&lt;br /&gt;
&lt;br /&gt;
=== FTDI library ===&lt;br /&gt;
&lt;br /&gt;
libftdi is a library that talks to FTDI's 232 type chips, including the popular bitbang mode, using libusb. A library to be able to use with a debugging Autopilot hardware boards.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libftdi-dev &lt;br /&gt;
&lt;br /&gt;
=== MPFR library ===&lt;br /&gt;
&lt;br /&gt;
The MPFR library is a C library for multiple-precision floating-point computations with correct rounding. MPFR is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for multiple-precision floating-point computation which is both efficient and has a well-defined semantics.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libmpfr-dev&lt;br /&gt;
&lt;br /&gt;
=== ImageMagick ===&lt;br /&gt;
&lt;br /&gt;
ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. Being able to modify image based map pictures is a feature that may come in handy one time.&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install imagemagick&lt;br /&gt;
&lt;br /&gt;
=== Optional on an older OS ===&lt;br /&gt;
&lt;br /&gt;
If you have an older OS distribution it never hurts to install the following...&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install libx11-6 libx11-dev texinfo flex bison libncurses5 libncurses5-dev libncursesw5 libncursesw5-dev zlibc&lt;br /&gt;
&lt;br /&gt;
== Building the Cross compiler toolchain ==&lt;br /&gt;
&lt;br /&gt;
The goal of this part is to building an ARM and STM32 cross-toolchain with binutils gcc newlib and gdb from source. This is needed so we can compile the code that ends up onto the autopilot board. Newlib is a C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. Enter the following on your command prompt&lt;br /&gt;
&lt;br /&gt;
 $ cd ~&lt;br /&gt;
 $ nano paparazzi_from_scratch.sh&lt;br /&gt;
&lt;br /&gt;
Then copy the part below (CTRL+C) and go to your terminal window again and use CTRL+SHIFT+V to paste the text into the nano editor. Afterther save the file with CTRL+X and answer Y &lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # ******************************************************************************&lt;br /&gt;
 #&lt;br /&gt;
 # Goal: Get the ARM and STM32 cross compilers, tools and libraries installed and all &lt;br /&gt;
 #       working on 64Bit (Linux) computer system like they should&lt;br /&gt;
 # Version:  1.7 &lt;br /&gt;
 # Copyright: 2011 LGPL OpenUAS http://www.openuas.org/&lt;br /&gt;
 # Date: 20110225 14:01&lt;br /&gt;
 # Usage: $ sh ./paparazzi_from_scratch.sh 2&amp;gt;&amp;amp;1 | tee buildlog.txt  &lt;br /&gt;
 #        &lt;br /&gt;
 # I want to improve this script, what can I do?&lt;br /&gt;
 #&lt;br /&gt;
 #  IMPR: Add STM32 support&lt;br /&gt;
 #  IMPR: with automatic log filename appending date like &amp;quot;date +%y%j%H%M%S&amp;quot;&lt;br /&gt;
 #  IMPR: Set MAJOR and MINOR GCC version in make parameter automatically&lt;br /&gt;
 #  IMPR: Add all commands from this wikipage also to the script, so we have a &lt;br /&gt;
 #        full paparazzi from scratch in one script!&lt;br /&gt;
 #&lt;br /&gt;
 # Useful links:&lt;br /&gt;
 # http://fun-tech.se/stm32/gcc/index.php&lt;br /&gt;
 # http://only.mawhrin.net/~alexey/prg/lpc2103/toolchain/&lt;br /&gt;
 # http://gcc.gnu.org/install/configure.html&lt;br /&gt;
 # http://wiki.ubuntuusers.de/GNU_arm-toolchain&lt;br /&gt;
 # http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options&lt;br /&gt;
 # http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source&lt;br /&gt;
 # http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/&lt;br /&gt;
 # http://code.google.com/p/hobbycode/source/browse/trunk/gnu-arm-installer&lt;br /&gt;
 # http://www.ethernut.de/en/documents/cross-toolchain-osx.html&lt;br /&gt;
 # http://paparazzi.enac.fr/w/index.php?title=User:Roirodriguez&lt;br /&gt;
 # http://chdk.wikia.com/wiki/Gcc433&lt;br /&gt;
 # http://chdk.wikia.com/wiki/Compiling_CHDK_under_Linux&lt;br /&gt;
 #&lt;br /&gt;
 # http://gcc.gnu.org/faq.html#multiple&lt;br /&gt;
 # https://wiki.kubuntu.org/CompilerFlags&lt;br /&gt;
 #&lt;br /&gt;
 # Older compiler http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=91596&lt;br /&gt;
 # Replaced O_CREAT for S_IRWXU in the files where you get gcc-3.4.4/gcc/collect2.c&lt;br /&gt;
 #&lt;br /&gt;
 # The eBook &amp;quot;Definitive guide to GCC&amp;quot; may come in handy&lt;br /&gt;
 #&lt;br /&gt;
 # And if all went well, a command&lt;br /&gt;
 #  $ arm-elf-gcc -print-multi-lib&lt;br /&gt;
 #&lt;br /&gt;
 # Should give the following &lt;br /&gt;
 #&lt;br /&gt;
 # .;&lt;br /&gt;
 # thumb;@mthumb&lt;br /&gt;
 # interwork;@mthumb-interwork&lt;br /&gt;
 # thumb/interwork;@mthumb@mthumb-interwork&lt;br /&gt;
 #&lt;br /&gt;
 # ******************************************************************************&lt;br /&gt;
 &lt;br /&gt;
 # In case you want to recompile, and if you do not want to re-download the files&lt;br /&gt;
 # to save time and bandwith set CLEANUPDOWNLOADS to N&lt;br /&gt;
 CLEANUPDOWNLOADS=&amp;quot;N&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-elf  #Or use  TARGET=arm-none-eabi or arm_non_eabi the pararazzi makefile will figure it out&lt;br /&gt;
 PREFIX=$HOME/arm-elf-paparazzi # Install location of the final toolchain, change this to your liking&lt;br /&gt;
 &lt;br /&gt;
 # If you have a good reason to compile other versions, ONLY then change the version data below&lt;br /&gt;
 BINUTILS_VERSION=2.16.1&lt;br /&gt;
 GCC_VERSION=3.4.4&lt;br /&gt;
 NEWLIB_VERSION=1.13.0&lt;br /&gt;
 GDB_VERSION=6.8&lt;br /&gt;
 &lt;br /&gt;
 #Just in case for some reason you want the latest versions a just values here&lt;br /&gt;
 # and some more 3.4 in the rest of the script&lt;br /&gt;
 #TARGET=arm-elf&lt;br /&gt;
 #PREFIX=$HOME/arm-elf-latest # Install location of the final toolchain, change this to your liking&lt;br /&gt;
 #BINUTILS_VERSION=2.20.1&lt;br /&gt;
 #GCC_VERSION=4.4.4&lt;br /&gt;
 #NEWLIB_VERSION=1.18.0&lt;br /&gt;
 #GDB_VERSION=7.1&lt;br /&gt;
 &lt;br /&gt;
 # ******************************************************************************&lt;br /&gt;
 # * No need to change anything below this line, exept improvements             *&lt;br /&gt;
 # ******************************************************************************&lt;br /&gt;
 &lt;br /&gt;
 # On multicore Processor this value can speedup the compilation&lt;br /&gt;
 if grep -q &amp;quot;processor&amp;quot; /proc/cpuinfo || grep -q &amp;quot;siblings&amp;quot; /proc/cpuinfo&lt;br /&gt;
 then&lt;br /&gt;
   SPEEDUPCOMPILATION=&amp;quot;-j &amp;quot;$(($( grep &amp;quot;processor&amp;quot; /proc/cpuinfo | sort -u | wc -l ) * $( grep &amp;quot;siblings&amp;quot; /proc/cpuinfo | tail -1 | cut -d: -f2 )))&lt;br /&gt;
 else&lt;br /&gt;
   SPEEDUPCOMPILATION=&amp;quot;&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Install texinfo tool&lt;br /&gt;
 sudo apt-get install texinfo&lt;br /&gt;
 &lt;br /&gt;
 # A GCC v3.4 64Bit install to avoid issues whil compiling the crosscompiler, native compile use would be much better&lt;br /&gt;
 # Or, get debian packages from here http://www.openuas.org/pub/ubuntu/pool/universe/g/gcc-3.4/ or http://es.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/&lt;br /&gt;
 wget -N -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4-base_3.4.6-8ubuntu2_amd64.deb&lt;br /&gt;
 wget -N -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/cpp-3.4_3.4.6-8ubuntu2_amd64.deb&lt;br /&gt;
 wget -N -c http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4_3.4.6-8ubuntu2_amd64.deb &lt;br /&gt;
 # Must be installed in this order&lt;br /&gt;
 sudo dpkg -i gcc-3.4-base_3.4.6-8ubuntu2_amd64.deb&lt;br /&gt;
 sudo dpkg -i cpp-3.4_3.4.6-8ubuntu2_amd64.deb&lt;br /&gt;
 sudo dpkg -i gcc-3.4_3.4.6-8ubuntu2_amd64.deb&lt;br /&gt;
 if [ &amp;quot;${CLEANUPDOWNLOADS}&amp;quot; != &amp;quot;N&amp;quot; ]&lt;br /&gt;
 then&lt;br /&gt;
   rm *.deb&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 BINUTILS=binutils-$BINUTILS_VERSION&lt;br /&gt;
 GCC=gcc-$GCC_VERSION&lt;br /&gt;
 NEWLIB=newlib-$NEWLIB_VERSION&lt;br /&gt;
 GDB=gdb-$GDB_VERSION&lt;br /&gt;
 &lt;br /&gt;
 mkdir $PREFIX&lt;br /&gt;
 &lt;br /&gt;
 # ** Now set the gcc and tools to be used in environment&lt;br /&gt;
 echo 'export PATH='$PREFIX'/bin:$PATH' &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
 source ~/.bashrc&lt;br /&gt;
 &lt;br /&gt;
 rm -drf build&lt;br /&gt;
 mkdir build&lt;br /&gt;
 &lt;br /&gt;
 # Get and compile the BinUtils&lt;br /&gt;
 wget -N -c http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2&lt;br /&gt;
 tar xfvj $BINUTILS.tar.bz2 &lt;br /&gt;
 cd build&lt;br /&gt;
 unset CFLAGS &amp;amp;&amp;amp; unset LDFLAGS &amp;amp;&amp;amp; unset CPPFLAGS &amp;amp;&amp;amp; unset CXXFLAGS &amp;amp;&amp;amp;&lt;br /&gt;
 CC=gcc-3.4&lt;br /&gt;
 CXX=g++-3.4&lt;br /&gt;
 ../$BINUTILS/configure -v --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=$TARGET&lt;br /&gt;
 make $SPEEDUPCOMPILATION CC=gcc-3.4 CXX=g++-3.4 &lt;br /&gt;
 make CC=gcc-3.4 CXX=g++-3.4 install&lt;br /&gt;
 cd ..&lt;br /&gt;
 rm -rf build/* $BINUTILS&lt;br /&gt;
 if [ &amp;quot;${CLEANUPDOWNLOADS}&amp;quot; != &amp;quot;N&amp;quot; ]&lt;br /&gt;
 then&lt;br /&gt;
   rm $BINUTILS.tar.bz2&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # ** Get and compile GCC stuff&lt;br /&gt;
 wget -N -c ftp://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.bz2&lt;br /&gt;
 tar xfvj $GCC.tar.bz2&lt;br /&gt;
 &lt;br /&gt;
 # Set correct MULTILIB options in GCC config, by patching&lt;br /&gt;
 ONTHFLYPATCHFILE='gcc_thumb_interwork_settings.patch'&lt;br /&gt;
 rm -f $ONTHFLYPATCHFILE #Just to make sure&lt;br /&gt;
 echo '--- t-arm-elf	2003-09-30 12:21:41.000000000 +0200' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '+++ t-arm-elf	2010-08-07 19:17:47.000000000 +0200' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '@@ -26,8 +26,8 @@' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # MULTILIB_DIRNAMES   += 32bit 26bit' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # MULTILIB_EXCEPTIONS += *mthumb/*mapcs-26*' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # ' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '-# MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '-# MULTILIB_DIRNAMES   += normal interwork' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '+MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo '+MULTILIB_DIRNAMES   += normal interwork' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # ' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 echo ' # MULTILIB_OPTIONS    += fno-leading-underscore/fleading-underscore' &amp;gt;&amp;gt; $ONTHFLYPATCHFILE&lt;br /&gt;
 patch $GCC/gcc/config/arm/t-arm-elf &amp;lt; $ONTHFLYPATCHFILE&lt;br /&gt;
 rm -f $ONTHFLYPATCHFILE&lt;br /&gt;
 cd build&lt;br /&gt;
 &lt;br /&gt;
 # IMPR &amp;quot;../$GCC/gcc/collect2.c&amp;quot; ajust the line in this file to prevent compiler error for older gcc to &amp;quot;redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IRWXU);&amp;quot;&lt;br /&gt;
 unset CFLAGS &amp;amp;&amp;amp; unset LDFLAGS &amp;amp;&amp;amp; unset CPPFLAGS &amp;amp;&amp;amp; unset CXXFLAGS &amp;amp;&amp;amp;&lt;br /&gt;
 CC=gcc-3.4&lt;br /&gt;
 CXX=g++-3.4&lt;br /&gt;
 ../$GCC/configure -v --enable-languages=c --prefix=$PREFIX --infodir=$PREFIX&amp;quot;/share/info&amp;quot; --mandir=$PREFIX&amp;quot;/share/man&amp;quot; --enable-interwork --enable-multilib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=$TARGET&lt;br /&gt;
 make $SPEEDUPCOMPILATION CC=gcc-3.4 CXX=g++-3.4  all&lt;br /&gt;
 make CC=gcc-3.4 CXX=g++-3.4 install&lt;br /&gt;
 cd ..&lt;br /&gt;
 # NOTE: We do not delete GCC temporary build yet, we need it once more later in this script&lt;br /&gt;
 &lt;br /&gt;
 if [ &amp;quot;${CLEANUPDOWNLOADS}&amp;quot; != &amp;quot;N&amp;quot; ]&lt;br /&gt;
 then&lt;br /&gt;
   rm $GCC.tar.bz2&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Now get and compile NewLib, note that sometimes this server is to busy serving the files,&lt;br /&gt;
 # try to get the files via an FTP client with good resume if it happens&lt;br /&gt;
 wget -N -c --waitretry=20 http://www.openuas.org/pub/newlib/$NEWLIB.tar.gz&lt;br /&gt;
 tar xfvz $NEWLIB.tar.gz&lt;br /&gt;
 cd build&lt;br /&gt;
 unset CFLAGS &amp;amp;&amp;amp; unset LDFLAGS &amp;amp;&amp;amp; unset CPPFLAGS &amp;amp;&amp;amp; unset CXXFLAGS &amp;amp;&amp;amp;&lt;br /&gt;
 CC=gcc-3.4&lt;br /&gt;
 CXX=g++-3.4&lt;br /&gt;
 ../$NEWLIB/configure -v --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --build=x86_64-linux-gnu --host=x86_64-linux-gnu&lt;br /&gt;
 make $SPEEDUPCOMPILATION CC=gcc-3.4 CXX=g++-3.4 &lt;br /&gt;
 make CC=gcc-3.4 CXX=g++-3.4  install&lt;br /&gt;
 cd ..&lt;br /&gt;
 rm -rf build/* $NEWLIB &lt;br /&gt;
 if [ &amp;quot;${CLEANUPDOWNLOADS}&amp;quot; != &amp;quot;N&amp;quot; ]&lt;br /&gt;
 then&lt;br /&gt;
   rm -rf $NEWLIB.tar.gz&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # GCC needs to be build again including the real newlib now&lt;br /&gt;
 cd build&lt;br /&gt;
 unset CFLAGS &amp;amp;&amp;amp; unset LDFLAGS &amp;amp;&amp;amp; unset CPPFLAGS &amp;amp;&amp;amp; unset CXXFLAGS &amp;amp;&amp;amp;&lt;br /&gt;
 CC=gcc-3.4&lt;br /&gt;
 CXX=g++-3.4&lt;br /&gt;
 ../$GCC/configure -v --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --enable-languages=&amp;quot;c,c++&amp;quot; --with-newlib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --build=x86_64-linux-gnu --host=x86_64-linux-gnu --infodir=$PREFIX&amp;quot;/share/info&amp;quot; --mandir=$PREFIX&amp;quot;/share/man&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 make $SPEEDUPCOMPILATION CC=gcc-3.4 CXX=g++-3.4 all-gcc&lt;br /&gt;
 make CC=gcc-3.4 CXX=g++-3.4 install-gcc&lt;br /&gt;
 cd ..&lt;br /&gt;
 rm -rf build/* $GCC&lt;br /&gt;
 rm -rf build&lt;br /&gt;
 &lt;br /&gt;
 # We need a symlink to arm-elf-gcc in /usr/bin/ the way the current paparazzi AP compile script works&lt;br /&gt;
 # We need a better solution here then symlinks, any clues...plz improve&lt;br /&gt;
 # Yes, helping with a better use of shell by using arm-elf wild-cards is appreciated &lt;br /&gt;
 PREFIXBINDIR=$PREFIX/bin&lt;br /&gt;
 OURBINDIR=/usr/bin&lt;br /&gt;
 #Remove old symlinks&lt;br /&gt;
 for x in $OURBINDIR/arm-elf*; do if [ -L $x ]; then sudo rm $x; fi ; done&lt;br /&gt;
 #Make fresh symlinks so arm tools ar found by paparazzi center&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-gcc $OURBINDIR/arm-elf-gcc&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-size $OURBINDIR/arm-elf-size&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-objcopy $OURBINDIR/arm-elf-objcopy&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-objdump $OURBINDIR/arm-elf-objdump&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-nm $OURBINDIR/arm-elf-nm&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-addr2line $OURBINDIR/arm-elf-addr2line&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-ar $OURBINDIR/arm-elf-ar&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-as $OURBINDIR/arm-elf-as&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-c++filt $OURBINDIR/arm-elf-c++filt&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-cpp $OURBINDIR/arm-elf-cpp&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-gcc $OURBINDIR/arm-elf-gcc&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-gcc-3.4.4 $OURBINDIR/arm-elf-gcc-3.4.4&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-gccbug $OURBINDIR/arm-elf-gccbug&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-gcov $OURBINDIR/arm-elf-gcov&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-ld $OURBINDIR/arm-elf-ld&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-nm $OURBINDIR/arm-elf-nm&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-objcopy $OURBINDIR/arm-elf-objcopy&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-objdump $OURBINDIR/arm-elf-objdump&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-ranlib $OURBINDIR/arm-elf-ranlib&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-readelf $OURBINDIR/arm-elf-readelf&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-size $OURBINDIR/arm-elf-size&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-strings $OURBINDIR/arm-elf-strings&lt;br /&gt;
 sudo ln -s $PREFIXBINDIR/arm-elf-strip $OURBINDIR/arm-elf-strip&lt;br /&gt;
 &lt;br /&gt;
 # If you also a want to add the debugger, Uncomen the lines here. Configure could need parameter &amp;quot;--disable-werror&amp;quot; in some cases&lt;br /&gt;
 #wget -N -c ftp://ftp.gnu.org/gnu/gdb/$GDB.tar.bz2&lt;br /&gt;
 #tar xfvj $GDB.tar.bz2&lt;br /&gt;
 #cd build&lt;br /&gt;
 #../$GDB/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib&lt;br /&gt;
 #make $SPEEDUPCOMPILATION&lt;br /&gt;
 #make install&lt;br /&gt;
 #cd ..&lt;br /&gt;
 &lt;br /&gt;
 #rm -rf build $GDB&lt;br /&gt;
 #if [ &amp;quot;${CLEANUPDOWNLOADS}&amp;quot; != &amp;quot;N&amp;quot; ]&lt;br /&gt;
 #then&lt;br /&gt;
 #  rm $GDB.tar.bz2&lt;br /&gt;
 #fi&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;Misterious as this scripts progress might have looked, everything is now done, hopefully without any issue&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Then run the script in a terminal window via:&lt;br /&gt;
&lt;br /&gt;
 $ sh ./paparazzi_from_scratch.sh 2&amp;gt;&amp;amp;1 | tee buildlog.txt&lt;br /&gt;
&lt;br /&gt;
== Rest of code needed ==&lt;br /&gt;
&lt;br /&gt;
To install the rest we make a special directory &amp;quot;develop&amp;quot;. You can give it another name ofcourse.&lt;br /&gt;
&lt;br /&gt;
 $ mkdir ~/develop&lt;br /&gt;
&lt;br /&gt;
== LPC21ISP ==&lt;br /&gt;
&lt;br /&gt;
To get the software onto the main autopilot board a special tool is needed. We will use the great open-source LPC21ISP application. LPC21ISP is an in-circuit programming (ISP) tool for the microcontroller used on the Paparazzi autopilot boards. The lpc21isp project is hosted on sourceforge and one can find the source packages and information at http://sourceforge.net/projects/lpc21isp/ &lt;br /&gt;
&lt;br /&gt;
Get the SVN version via&lt;br /&gt;
 &lt;br /&gt;
 $ mkdir -p ~/develop/lpc21isp&lt;br /&gt;
 $ cd ~/develop/lpc21isp&lt;br /&gt;
 $ svn co https://lpc21isp.svn.sourceforge.net/svnroot/lpc21isp lpc21&lt;br /&gt;
&lt;br /&gt;
To compile go into the source directory and then do&lt;br /&gt;
&lt;br /&gt;
 $ cd lpc21&lt;br /&gt;
 $ make -f Makefile clean all&lt;br /&gt;
&lt;br /&gt;
To install&lt;br /&gt;
&lt;br /&gt;
 $ sudo cp lpc21isp /usr/bin/&lt;br /&gt;
&lt;br /&gt;
==  IVY ==&lt;br /&gt;
&lt;br /&gt;
IVY is a simple protocol and a set of open-source libraries and programs that allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions. The project can be found at: http://www2.tls.cena.fr/products/ivy/  &lt;br /&gt;
&lt;br /&gt;
In the paparazzi project, Ivy is used to send telemetry data to where ever you want.&lt;br /&gt;
&lt;br /&gt;
NOTE: Do not confuse this IVY with the Apache Ivy project. &lt;br /&gt;
&lt;br /&gt;
=== Ivy-python ===&lt;br /&gt;
&lt;br /&gt;
The ivy-python package makes it possible to use the IVY libraries from within the Python programming language. The ivy-python package is architecture independent, so it can be downloaded from the Ubuntu or Debian paparazzi repository. However since this is the from scratch page we will download it from the official source repository via &lt;br /&gt;
 &lt;br /&gt;
 $ mkdir -p ~/develop/ivy-python/&lt;br /&gt;
 $ cd ~/develop/ivy-python/&lt;br /&gt;
 $ svn co http://svn.tls.cena.fr/svn/ivy/ivy-python/trunk&lt;br /&gt;
&lt;br /&gt;
Now we can build and install&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/develop/ivy-python/trunk&lt;br /&gt;
 $ sudo ./setup.py install&lt;br /&gt;
&lt;br /&gt;
=== Ivy-c ===&lt;br /&gt;
&lt;br /&gt;
To be able to use IVY-c, the libraries need to be installed. Source packages of ivy-c can be downloaded via:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p ~/develop/ivy-c&lt;br /&gt;
 $ cd ~/develop/ivy-c&lt;br /&gt;
 $ svn co http://svn.tls.cena.fr/svn/ivy/ivy-c/trunk&lt;br /&gt;
&lt;br /&gt;
To compile&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/develop/ivy-c/trunk/src&lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
It is possible you get errors of the test module when compiling, just ignore the messages, it is not important for the Paparazzi project. Contact the IVY team to help them also to resolve also the testing makefile issue.&lt;br /&gt;
&lt;br /&gt;
Now install the compiled libraries&lt;br /&gt;
&lt;br /&gt;
 $ sudo make install&lt;br /&gt;
&lt;br /&gt;
=== Ivy-OCAML ===&lt;br /&gt;
&lt;br /&gt;
The Ivy-ocaml is a Library that make it possible to use Ivy via the Ocaml language.&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p ~/develop/ivy-ocaml&lt;br /&gt;
 $ cd ~/develop/ivy-ocaml/&lt;br /&gt;
 $ svn co http://svn.tls.cena.fr/svn/ivy/ivy-ocaml/trunk&lt;br /&gt;
&lt;br /&gt;
NOTE: If the above SVN repository does not work due to API incompatibilities get the ivy-ocaml source via&lt;br /&gt;
&lt;br /&gt;
 $ wget http://paparazzi.enac.fr/ubuntu/dists/lucid/main/binary-i386/ivy-ocaml_1.1-10.tar.gz &lt;br /&gt;
use newer: http://paparazzi.enac.fr/ubuntu/dists/natty/main/binary-i386/ivy-ocaml_1.1-12.tar.gz&lt;br /&gt;
&lt;br /&gt;
Now we need to compile the source via&lt;br /&gt;
&lt;br /&gt;
 $ cd ~/develop/ivy-ocaml/trunk&lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compilation works for 64 bit if you get an up-to-date version!&lt;br /&gt;
&lt;br /&gt;
Compilation doesn't work on 64bit systems, if you just run 'make'&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/ld: civyloop.o: relocation R_X86_64_32 against `timer_cb' can not be used when making a shared object; recompile with -fPIC&lt;br /&gt;
&lt;br /&gt;
That's solved by just editing the Makefile. Change the line containing&lt;br /&gt;
&lt;br /&gt;
 .c.o:&lt;br /&gt;
         $(CC) -Wall -c $(OCAMLINC) $(GLIBINC) $&amp;lt;&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 .c.o:&lt;br /&gt;
        $(CC) -Wall -c -fPIC $(OCAMLINC) $(GLIBINC) $&amp;lt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: &lt;br /&gt;
File a defect to the ivy-ocaml development team: A proper patch for the original sources would be one that checks if the system is a 64bit system, and if so set FPIC env variable. The following code at the beginning of the Makefile needs to be added just as it is done in the ivy-c Makefile&lt;br /&gt;
&lt;br /&gt;
 PERHAPS64:= $(shell uname -m | perl -ne &amp;quot;print /64/? '64' : '';&amp;quot;)''&lt;br /&gt;
 ifeq ($(PERHAPS64), &amp;quot;64&amp;quot;)&lt;br /&gt;
         FPIC=&lt;br /&gt;
 else&lt;br /&gt;
         FPIC=-fPIC&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
And then let the rule to compile all .c and .o files be like the following:&lt;br /&gt;
&lt;br /&gt;
 .c.o:&lt;br /&gt;
         $(CC) -Wall -c $(FPIC) $(OCAMLINC) $(GLIBINC) $&amp;lt;&lt;br /&gt;
&lt;br /&gt;
== Paparazzi Main sourcecode ==&lt;br /&gt;
&lt;br /&gt;
To run the Ground control station and to be able to create airborne code for the Autopilot board and more one needs to get the Paparazzi source via&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/paparazzi/paparazzi.git&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Compilation should work just fine for 64 bit with current versions, no need to change makefile anymore...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you enter the sources directory and simply run ''make'' you will get the following error in an amd64 system:&lt;br /&gt;
&lt;br /&gt;
 cd sw/ground_segment/multimon; make PAPARAZZI_SRC=/home/roi/Codigo/paparazzi-dev/lenny_versions/paparazzi/temp PAPARAZZI_HOME=/home/roi/Codigo/paparazzi-dev/lenny_versions/paparazzi/temp&lt;br /&gt;
 CC hdlc.c&lt;br /&gt;
 hdlc.c:1: error: CPU you selected does not support x86-64 instruction set&lt;br /&gt;
&lt;br /&gt;
This is because the code in sw/ground_segment/multimon/filter-i386.h which contains optimizations for some functions gets included and it doesn't work on amd64. filter.h says that filter-i386.h gets included if:&lt;br /&gt;
&lt;br /&gt;
 #ifdef ARCH_I386&lt;br /&gt;
 #include &amp;quot;filter-i386.h&amp;quot;&lt;br /&gt;
 #endif /* ARCH_I386 */&lt;br /&gt;
&lt;br /&gt;
If we take a look at the Makefile (sw/ground_segment/multimon/Makefile):&lt;br /&gt;
&lt;br /&gt;
 CFLAGS          =-Wall -Wstrict-prototypes -I/usr/X11R6/include -I `ocamlc -where`&lt;br /&gt;
 ifeq ($(DEBUG),y)&lt;br /&gt;
 CFLAGS          +=-g -O -march=i486 -falign-loops=2 -falign-jumps=2 \&lt;br /&gt;
                  -falign-functions=2 -DARCH_I386&lt;br /&gt;
 else&lt;br /&gt;
 CFLAGS          +=-O3 -march=i486 -falign-loops=2 -falign-jumps=2 \&lt;br /&gt;
                  -falign-functions=2 -DARCH_I386&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
We'll have to change it to not define ARCH_I386, not optimize for i486 and add -fPIC. So we need to leave the above lines like:&lt;br /&gt;
&lt;br /&gt;
 CFLAGS          =-Wall -fPIC -Wstrict-prototypes -I/usr/X11R6/include -I `ocamlc -where`&lt;br /&gt;
 ifeq ($(DEBUG),y)&lt;br /&gt;
 CFLAGS          +=-g -O -falign-loops=2 -falign-jumps=2 \&lt;br /&gt;
                  -falign-functions=2&lt;br /&gt;
 else&lt;br /&gt;
 CFLAGS          +=-O3 -falign-loops=2 -falign-jumps=2 \&lt;br /&gt;
                  -falign-functions=2&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
Note that leaving the sources like this won't apply the optimisations if now you take the modified source and compile it in a 32bit system...&lt;br /&gt;
&lt;br /&gt;
Now it will compile. run paparazzi and test it with a simulation via &lt;br /&gt;
&lt;br /&gt;
$ ./paparazzi&lt;br /&gt;
&lt;br /&gt;
NOTES:&lt;br /&gt;
See also the main installation page&lt;br /&gt;
&lt;br /&gt;
TIP: &lt;br /&gt;
If you get the File &amp;quot;pprz.mli&amp;quot;, line 149, characters 78-89: Error: Unbound type constructor Ivy.binding&lt;br /&gt;
...this happens when IVY libraries are not yet installed. How to do this, read the part on installing IVY on this page&lt;br /&gt;
&lt;br /&gt;
=== Set the UDev rules ===&lt;br /&gt;
&lt;br /&gt;
To be able to access the Hardware attached to your PC later on, rules must be set in your OS. By setting the correct rules a regular user can access USB and other devices, otherwise restricted for only the root user.&lt;br /&gt;
&lt;br /&gt;
Now in a terminal&lt;br /&gt;
&lt;br /&gt;
 $ sudo nano /etc/udev/rules.d/91-paparazzi.rules&lt;br /&gt;
&lt;br /&gt;
then select and copy (CTRL+V) the text below:&lt;br /&gt;
&lt;br /&gt;
 ACTION!=&amp;quot;add|change&amp;quot;, GOTO=&amp;quot;paparazzi_rules_end&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 SUBSYSTEM!=&amp;quot;usb&amp;quot;, GOTO=&amp;quot;paparazzi_rules_end&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 ENV{DEVTYPE}!=&amp;quot;usb_device&amp;quot;, GOTO=&amp;quot;paparazzi_rules_end&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 #SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{serial}==&amp;quot;*_fbw&amp;quot;, NAME=&amp;quot;test_fbw&amp;quot;, SYMLINK+=&amp;quot;paparazzi/%s{serial}&amp;quot;, MODE=&amp;quot;0666&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # MaxStream xbee pro box&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{product}==&amp;quot;MaxStream PKG-U&amp;quot;, KERNEL==&amp;quot;ttyUSB*&amp;quot;, SYMLINK+=&amp;quot;paparazzi/xbee&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # bare FTDI chip without EEPROM&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{idProduct}==&amp;quot;6001&amp;quot;, KERNEL==&amp;quot;ttyUSB*&amp;quot;, SYMLINK+=&amp;quot;paparazzi/serial&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 # all (fake VID 0x7070) LPCUSB devices (access through libusb)&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;7070&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # FTDI 2232 parallel converter / Amontec JTAG-Tiny (access through libftdi)&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;,  ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{idProduct}==&amp;quot;cff8&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # FTDI 2232 based jtag for Lisa/L&lt;br /&gt;
 SUBSYSTEM==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{idProduct}==&amp;quot;6010&amp;quot;, MODE=&amp;quot;0666&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 # make joysticks/gamepads readable on event interface (writeable for force feedback), see input_event.sh&lt;br /&gt;
 KERNEL==&amp;quot;event*&amp;quot;, IMPORT{program}=&amp;quot;input_event.sh %p&amp;quot;, NAME=&amp;quot;input/%k&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;, MODE=&amp;quot;0640&amp;quot; ENV{FF_DEVICE}==&amp;quot;1&amp;quot;, MODE=&amp;quot;0660&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 #needed for lisa usb upload&lt;br /&gt;
 SUBSYSTEM==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{idProduct}==&amp;quot;6010&amp;quot;, MODE=&amp;quot;0666&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # FTDI with uBlox direct on USB&lt;br /&gt;
 SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;1546&amp;quot;, ATTRS{idProduct}==&amp;quot;01a5&amp;quot;, KERNEL==&amp;quot;ttyACM*&amp;quot;, SYMLINK+=&amp;quot;paparazzi/acm&amp;quot;, GROUP=&amp;quot;plugdev&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 LABEL=&amp;quot;paparazzi_rules_end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Past the text in the terminal window via CTRL+SHIFT+V and save the file via CTRL+X. Test via &lt;br /&gt;
&lt;br /&gt;
 $ udevadm info -q all -n /dev/paparazzi/serial&lt;br /&gt;
&lt;br /&gt;
If you want to learn more about what UDEV is, [http://www.openuas.org/pub/writing_udev_rules.html there is a very informative page about '''udev''' here]&lt;br /&gt;
&lt;br /&gt;
== The depriciated -mapcs-32 option ==&lt;br /&gt;
&lt;br /&gt;
The option &amp;quot;-mapcs-32&amp;quot; is only available with very old tool chain versions e.g. GCC-3.3.x. More recent tool chains will either require &amp;quot;-mabi=apcs-gnu&amp;quot; (non-EABI-compliant) or &amp;quot;-mabi=aapcs-linux&amp;quot; (EABI-compliant). To have an overview of all flags go here&lt;br /&gt;
&lt;br /&gt;
http://ecos.sourceware.org/docs-1.3.1/ref/gnupro-ref/arm/ARM_COMBO_ch01.html&lt;br /&gt;
&lt;br /&gt;
By changing -mapcs-32 with -Wa,-mapcs-32 compilation will work with more recent compilers and we have backward compatibility with the old flag for older compilers. The option -Wa,-mapcs-32 is doing the following: ''-Wa,option'' : Pass option as an option to the assembler. If option contains commas, it is split into multiple options at the commas.&lt;br /&gt;
&lt;br /&gt;
The -mapcs-32 option generates code for a processor running with a 32-bit program counter and conforming to the function calling standards for the APCS 32-bit option. If interested in depth what APCS is read the following: http://www.openuas.org/site/APCS.txt&lt;br /&gt;
&lt;br /&gt;
The gcc flag -mapcs-32 was deprecated since gcc-3.4.0 and finally removed in gcc-4.0.0 which unconditionally generates 32bit ARM code. You should not need to pass this flag to the assembler either but it might not hurt for backwards compatibility with older compilers, so it's best to leave it in with the -Wa, option metho&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
https://github.com/esden/summon-arm-toolchain&lt;br /&gt;
&lt;br /&gt;
https://github.com/paparazzi/paparazzi-portability-support&lt;br /&gt;
&lt;br /&gt;
http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk/conf/Makefile.stm32&lt;br /&gt;
&lt;br /&gt;
http://wiki.ubuntuusers.de/GNU_arm-toolchain&lt;br /&gt;
&lt;br /&gt;
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/ARM-Options.html#ARM-Options&lt;br /&gt;
&lt;br /&gt;
http://mcuprogramming.com/forum/arm/gnu-arm-toolchain-installer/&lt;br /&gt;
&lt;br /&gt;
http://code.google.com/p/hobbycode/source/browse/trunk/gnu-arm-installer&lt;br /&gt;
&lt;br /&gt;
http://www.ethernut.de/en/documents/cross-toolchain-osx.html&lt;br /&gt;
&lt;br /&gt;
http://paparazzi.enac.fr/w/index.php?title=User:Roirodriguez&lt;br /&gt;
&lt;br /&gt;
http://www.hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=FirmwareArchitecture&amp;diff=9583</id>
		<title>FirmwareArchitecture</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=FirmwareArchitecture&amp;diff=9583"/>
		<updated>2011-06-13T05:28:03Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Modules ==&lt;br /&gt;
Modules use code generation in order to allow people to use them by only editing the vehicle's xml configuration as opposed to changing/adding to  the code of the autopilot. Typically, function calls are generated for initialisation and in the mainloop for timers (periodic in paparazzi slang) and events. &lt;br /&gt;
&lt;br /&gt;
[[Modules | modules page]]&lt;br /&gt;
&lt;br /&gt;
== Subsystems ==&lt;br /&gt;
Subsystems are just a convention used to provide several implementations of a peripheral (like microcontroller peripherals, an external imu board...), protocol (gps, communications...) or algorithm (control, estimation...). Function calls are written &amp;quot;by hand&amp;quot; and the build system takes care to compile the particular implementation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Discussion ==&lt;br /&gt;
Modules naturally provide the &amp;quot;several implementations&amp;quot; feature of the Subsystems. So, ideally we could have a &amp;quot;generic&amp;quot; main.c consisting only in calls to the generated functions.&lt;br /&gt;
This has the advantage of providing flexibility for specifying timing parameters from the xml, like for example the frequency of control or estimation algorithm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nevertheless, care should be taken that switching to a &amp;quot;module only&amp;quot; configuration doesn't become detrimental to the readability and debugability of the code.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fixedwing and Rotorcraft use different gps code and we'll have to decide when we merge if we make it a module or a subsystem.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/DesignOverview&amp;diff=9582</id>
		<title>DevGuide/DesignOverview</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/DesignOverview&amp;diff=9582"/>
		<updated>2011-06-13T05:26:54Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Airborne Functional Diagram ==&lt;br /&gt;
[[Image:functional_diagram.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
 -Static approach&lt;br /&gt;
 -Modularity&lt;br /&gt;
 -Hardware abstraction&lt;br /&gt;
 -Runtime efficiency&lt;br /&gt;
&lt;br /&gt;
=== Static Approach ===&lt;br /&gt;
  -only &amp;quot;things that needs to be changed during flight are changeable&lt;br /&gt;
  -maximise compilation time resolutions&lt;br /&gt;
&lt;br /&gt;
  advantages&lt;br /&gt;
    Error checking&lt;br /&gt;
    Efficiency&lt;br /&gt;
    Safety/Robustness&lt;br /&gt;
&lt;br /&gt;
=== Modularity ===&lt;br /&gt;
&lt;br /&gt;
[[Image:modularity.png]]&lt;br /&gt;
&lt;br /&gt;
  -Separation of concerns&lt;br /&gt;
  -Maintenability&lt;br /&gt;
  -Interface&lt;br /&gt;
  -C provide no dedicated mechanism for modularity&lt;br /&gt;
  -Main issues with modularity are configuration and dependancies&lt;br /&gt;
&lt;br /&gt;
[[Image:dependancies_example.png]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware abstraction ===&lt;br /&gt;
&lt;br /&gt;
  -Segregate hardware dependant modules&lt;br /&gt;
&lt;br /&gt;
[[Image:hardware_abstraction.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Runtime Efficiency ===&lt;br /&gt;
&lt;br /&gt;
We have to take care that our code runs efficient on the autopilot board microprocessor. It is for example very unlikely that we will physically change the serial port on which we connected our telemetry modem during a flight.&lt;br /&gt;
&lt;br /&gt;
'''bad''' coding practice&lt;br /&gt;
&lt;br /&gt;
 switch(UART) {&lt;br /&gt;
  case UART0 : UARTO_write(...); break;&lt;br /&gt;
  case UART1 : UART1_write(...); break;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
'''good''' coding practice&lt;br /&gt;
&lt;br /&gt;
 #define UartWrite(x) UART ## _write(x)&lt;br /&gt;
 UartWrite(...);&lt;br /&gt;
&lt;br /&gt;
== Design Solutions ==&lt;br /&gt;
&lt;br /&gt;
 * Heavy pre-processor usage&lt;br /&gt;
 * C code generation&lt;br /&gt;
 * Heavy Makefile usage&lt;br /&gt;
 * Conventions to define our own module layer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== pre-processor ===&lt;br /&gt;
&lt;br /&gt;
==== header selection ====&lt;br /&gt;
&lt;br /&gt;
conf/airframes/funjet1.xml&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
 ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4017_hw.h\&amp;quot;&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
&lt;br /&gt;
generated var/FJ1/Makefile.ac&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4017_hw.h\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sw/airborne/actuators.h&lt;br /&gt;
 #include ACTUATORS&lt;br /&gt;
&lt;br /&gt;
expanded by pre-processor to&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;servos_4017_hw.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==== macros ====&lt;br /&gt;
&lt;br /&gt;
conf/airframes/funjet1.xml&lt;br /&gt;
  ap.CFLAGS += -DXBEE_UART=Uart1&lt;br /&gt;
&lt;br /&gt;
sw/airborne/xbee.h&lt;br /&gt;
  #define __XBeeLink(dev, _x) dev##_x&lt;br /&gt;
  #define _XBeeLink(dev, _x) __XBeeLink(dev, _x)&lt;br /&gt;
  #define XBeeLink(_x) _XBeeLink(XBEE_UART, _x)&lt;br /&gt;
  #define XBeeBuffer() XBeeLink(ChAvailable())&lt;br /&gt;
&lt;br /&gt;
expanded by pre-processor to&lt;br /&gt;
 &lt;br /&gt;
 Uart1ChAvailable()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C code generation ===&lt;br /&gt;
&lt;br /&gt;
For problems too complex to solve with the pre processor, we use custom compilers to generate code from a description in xml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example 1 : command laws, aka mixers ====&lt;br /&gt;
conf/airframes/funjet1.xml&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 * AILEVON_AILERON_RATE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot; value=&amp;quot;@PITCH * AILEVON_ELEVATOR_RATE&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;&lt;br /&gt;
&lt;br /&gt;
generated var/FJ1/airframe.h&lt;br /&gt;
 #define SetActuatorsFromCommands(values) { \&lt;br /&gt;
   uint16_t servo_value;\&lt;br /&gt;
   float command_value;\&lt;br /&gt;
   int16_t _var_aileron = values[COMMAND_ROLL] * AILEVON_AILERON_RATE;\&lt;br /&gt;
   int16_t _var_elevator = values[COMMAND_PITCH] * AILEVON_ELEVATOR_RATE;\&lt;br /&gt;
 [....]&lt;br /&gt;
   command_value = _var_elevator + _var_aileron;\&lt;br /&gt;
   command_value *= command_value&amp;gt;0 ? SERVO_AILEVON_LEFT_TRAVEL_UP :   SERVO_AILEVON_LEFT_TRAVEL_DOWN;\&lt;br /&gt;
   servo_value = SERVO_AILEVON_LEFT_NEUTRAL + (int16_t)(command_value);\&lt;br /&gt;
   actuators[SERVO_AILEVON_LEFT] = ChopServo(servo_value, SERVO_AILEVON_LEFT_MIN, SERVO_AILEVON_LEFT_MAX);\&lt;br /&gt;
   Actuator(SERVO_AILEVON_LEFT) = SERVOS_TICS_OF_USEC(actuators[SERVO_AILEVON_LEFT]);\&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== example 2 : flight plan ====&lt;br /&gt;
&lt;br /&gt;
conf/flight plans/example.xml&lt;br /&gt;
   &amp;lt;block name=&amp;quot;For loop (circles wp 1)&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;for from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot; var=&amp;quot;i&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;circle radius=&amp;quot;DEFAULT_CIRCLE_RADIUS+ $i*10&amp;quot; wp=&amp;quot;1&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/for&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
generated var/flight plan.h&lt;br /&gt;
  Block(29) // For loop (circles wp 1)&lt;br /&gt;
    switch(nav_stage) {&lt;br /&gt;
      static int8_t _var_i;&lt;br /&gt;
      static int8_t _var_i_to;&lt;br /&gt;
      Stage(0)&lt;br /&gt;
        _var_i = 0 - 1;&lt;br /&gt;
        _var_i_to = 3;&lt;br /&gt;
      Label(for_11)&lt;br /&gt;
      Stage(1)&lt;br /&gt;
        if (++_var_i &amp;gt; _var_i_to) Goto(endfor_12) else NextStageAndBreak();&lt;br /&gt;
      Stage(2)&lt;br /&gt;
        NavVerticalAutoThrottleMode(RadOfDeg(0.000000));&lt;br /&gt;
        NavVerticalAltitudeMode(WaypointAlt(3), 0.);&lt;br /&gt;
        NavCircleWaypoint(3, (DEFAULT_CIRCLE_RADIUS+(_var_i*10)));&lt;br /&gt;
        if ((NavCircleCount()&amp;gt;1)) NextStageAndBreak();&lt;br /&gt;
        break;&lt;br /&gt;
      Stage(3)&lt;br /&gt;
        Goto(for_11)&lt;br /&gt;
      Label(endfor_12)&lt;br /&gt;
      Stage(5)&lt;br /&gt;
        NextBlock();&lt;br /&gt;
        break;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Makefile ===&lt;br /&gt;
&lt;br /&gt;
==== Connecting and configuring modules ====&lt;br /&gt;
&lt;br /&gt;
  ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=XBeeTransport -DXBEE_UART=Uart1&lt;br /&gt;
  ap.srcs += downlink.c xbee.c&lt;br /&gt;
  ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B9600&lt;br /&gt;
  ap.srcs += \$(SRC_ARCH)/uart_hw.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Modules configuration ====&lt;br /&gt;
&lt;br /&gt;
3 sources of configuration:&lt;br /&gt;
  * airframe configuration file ( airframe.xml ) which &amp;quot;compiled&amp;quot; to C files and Makefile&lt;br /&gt;
  * specific per module configuration file ( eg radio.xml, flightplan.xml) compiled to C code to allow factorization between airframes.&lt;br /&gt;
  * specific per board configuration file ( eg tiny.h ) to describe modules configuration imposed by board routing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:modules_configuration.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Conventions ===&lt;br /&gt;
&lt;br /&gt;
== Generating Doxygen Code Documentation ==&lt;br /&gt;
&lt;br /&gt;
A way to look at the includes and dependencies is to use the graphs generated with doxygen. After installing Paparazzi, install Doxygen:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install doxygen graphviz&lt;br /&gt;
&lt;br /&gt;
run the generation tool from the paparazzi3/ directory:&lt;br /&gt;
&lt;br /&gt;
 make doxygen&lt;br /&gt;
&lt;br /&gt;
Now Doxygen will have generated html documentation(open this with any web browser) in your paparazzi3/dox/html folder.&lt;br /&gt;
&lt;br /&gt;
To look at a list of all of the files used by the airborne software:&lt;br /&gt;
 paparazzi3/dox/html/files.html&lt;br /&gt;
The main_ap.c will also interest you.&lt;br /&gt;
 paparazzi3/dox/html/main__ap_8c.html&lt;br /&gt;
&lt;br /&gt;
This is a sample of a Doxygen Graph:&lt;br /&gt;
[[Image:Autopilot_8h_incl.png|Include dependency graph for autopilot.h]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Hardware]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Dev/Debugging&amp;diff=9581</id>
		<title>Dev/Debugging</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Dev/Debugging&amp;diff=9581"/>
		<updated>2011-06-13T05:22:35Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
GDB can be used for debugging the code on the boards.&lt;br /&gt;
&lt;br /&gt;
= Procedure =&lt;br /&gt;
# Start openocd in a new shell since this process needs to remain running.&lt;br /&gt;
#: To program the Lisa/L board run the command&lt;br /&gt;
#:&amp;lt;pre&amp;gt;openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Start GDB with an argument of the elf file created and uploaded to the board.&lt;br /&gt;
#: If you programmed with the ap target then the command would be along the lines of&lt;br /&gt;
#:&amp;lt;pre&amp;gt;arm-none-eabi-gdb var/&amp;lt;airframe&amp;gt;/ap/ap.elf&amp;lt;/pre&amp;gt;&lt;br /&gt;
#: Replace &amp;lt;airframe&amp;gt; with the name of the airframe that has been built.&lt;br /&gt;
# Now connect GDB to the board &lt;br /&gt;
#:&amp;lt;pre&amp;gt;target remote localhost:3333&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now we need to set some break points in the code.&lt;br /&gt;
#: In this example the ap target was part of the rotorcraft and main.c contains the main program. Open rotorcraft sw/airborne/firmwares/rotorcraft/main.c and find a line at which you'd like to set a break point.&lt;br /&gt;
#: &amp;lt;pre&amp;gt;break main.c:113&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Stop the currently running code&lt;br /&gt;
#: &amp;lt;pre&amp;gt;monitor reset halt&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Reset the code back to the start&lt;br /&gt;
#: &amp;lt;pre&amp;gt;monitor reset init&amp;lt;/pre&amp;gt;&lt;br /&gt;
# We probably want to ignore the interrupt calls for the moment so we can step through the code as it's being called. Note that we don't always want to do this.&lt;br /&gt;
#:&amp;lt;pre&amp;gt;monitor cortex_m3 maskisr on&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Now we can run the program which will stop at the break point we set.&lt;br /&gt;
#:&amp;lt;pre&amp;gt;continue&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful commands ==&lt;br /&gt;
* A stack trace can be printed with the command&lt;br /&gt;
*:&amp;lt;pre&amp;gt;bt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lpc21BootloaderUpload&amp;diff=9580</id>
		<title>Lpc21BootloaderUpload</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lpc21BootloaderUpload&amp;diff=9580"/>
		<updated>2011-06-13T05:21:28Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Bootloader from scatch==&lt;br /&gt;
&lt;br /&gt;
The goal of this page is to explain how to get the autopilot bootloader onto a ''brainless'' new ARM based autopilot board. Note that the bootloader only needs to be installed '''once''', when the board is first built and has never been used. Most of the times if you bought a board somewhere, the bootloader is already installed for you. If you did not make and soldered the Autopilot board yourself but bought it somewhere, chances are high the bootloader is already uploaded onto your board by the manufacturer. You could ask the supplier of your board. In that case you can just '''skip''' the steps described here and just continue the part of [http://paparazzi.enac.fr/wiki/Paparazzi_Center Uploading the Flightplan code to your autopilot board] or if you are more experienced you could go [http://paparazzi.enac.fr/wiki/Compiling here]&lt;br /&gt;
&lt;br /&gt;
[[Image:Bare_TWOG_Board.jpg|thumb|right|Bare_TWOG_Board.jpg]] &lt;br /&gt;
&lt;br /&gt;
==Why have Bootloader in the first place==&lt;br /&gt;
&lt;br /&gt;
Since the Airborne code and Flight-plans change frequently, it would be great if we could just simply upload new version with changes on the ground by connecting an USB cable to out airframes autopilot board. Well, the Bootloader makes this a simple reality.&lt;br /&gt;
&lt;br /&gt;
==How does it work==&lt;br /&gt;
&lt;br /&gt;
The Bootloader is uploaded through the serial interface UART0 (Serial1) by connecting certain point on the board to '''ground''' during power-up, sometimes referred to as: ''holding low''. On the board Tiny V1.x pin P0.14, Tiny V2.x this pin is called BOOT). 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.&lt;br /&gt;
&lt;br /&gt;
==Connecting it all==&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 Autopilot board. 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] [[Image:The_FTDI_RS232_USB_Cable.jpg|thumb|right|The FTDI RS232 USB Cable]]&lt;br /&gt;
&lt;br /&gt;
Some examples of suppliers:&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;
&lt;br /&gt;
It is strongly advised that you use a USB-serial converter with of the [[http://www.ftdichip.com/ FTDI brand]] chip, as serial chips from the FTDI brand are by default working well in Linux. As a nice bonus, 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 Bootloader uploading.&lt;br /&gt;
&lt;br /&gt;
Make up a wiring harness similar to the following. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Cable_Bootloader_Full.jpg|Bootloader cable&lt;br /&gt;
Image:Cable_Bootloader_To_FTDI_USB.jpg|Bootloader cable to FTDI USB&lt;br /&gt;
Image:Bootloader_helper_cable_to_USB_FTDI_Cable.jpg|Bootloader helper cable to USB FTDI cable&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 (Connectorname - 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;
 TWOG V1.x (Connectorname - DOWNLOAD):&amp;lt;br /&amp;gt;&lt;br /&gt;
 TWOG LPC_RXD0  &amp;lt;-- PC SERIAL TX (5V or 3.3V)&lt;br /&gt;
 TWOG LPC_TXD0  --&amp;gt; PC SERIAL RX (5V or 3.3V)&lt;br /&gt;
 TWOG BOOT      --&amp;gt; attach to ground, or wire through a pushbutton to ground&lt;br /&gt;
 TWOG GND       --&amp;gt; PC SERIAL ADAPTER GND&lt;br /&gt;
 &lt;br /&gt;
For TWOG make sure the GPS module is '''unplugged''' from the board. This is to prevent GPS serial data to disturb the uploading of the bootloader. &lt;br /&gt;
&lt;br /&gt;
[[Image:Where_To_Insert_Bootloader_Cable.jpg|thumb|right|Where to insert the Bootloader cable]]&lt;br /&gt;
&lt;br /&gt;
==Upload the firmware==&lt;br /&gt;
&lt;br /&gt;
Once this wiring is ready you will be ready to upload the bootloader to the autopilot board from your PC.&lt;br /&gt;
&lt;br /&gt;
To prepare the Autopilot board to accept uploads 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 the Bootloader firmware code upload over the serial connection.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Point_To_Connect_Ground.jpg|Point to_connect ground&lt;br /&gt;
Image:Closeup_Ground_Point.jpg|Closeup ground point&lt;br /&gt;
Image:Grounding_For_Bootloader_Closeup.jpg|closeup grounding point detail for Bootloader uploading&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step while your board is all connected and powered up is to type the commands for uploading the bootloader firmware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TWOG_Bootloader_Overview.jpg|TWOG Bootloader overview&lt;br /&gt;
Image:Powerup_Now.jpg|Everything ready to be powered-up now&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''In Linux'''&lt;br /&gt;
&lt;br /&gt;
From your Paparazzi 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 board. 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;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Wait_For_Bootloader_To_Upload.jpg|thumb|left|Wait for the bootloader to upload]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If everything is connected and setup correctly, after a while you will see the following messages &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Shell_bootloader_upload_success.jpg|thumb|left|Shell Bootloader upload success]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''In Windows'''&lt;br /&gt;
&lt;br /&gt;
If for some reason you need to program your autopilot board USB Bootloader in MS Windows you have to download the [http://www.openuas.org/site/LPC2000_Flash_ISP_Utility_v2.2.3.zip LPC2000 Flash Utility V2.2.3] or later. You will then prepare the autopilot board and start it in ISP bootloader state as described previously. This small utility will ony help uploading the Bootloder firmware. You will need to copy your compiled '''bl.hex''' file from Linux to your Windows OS. This file will be then uploaded.&lt;br /&gt;
&lt;br /&gt;
==Additional information==&lt;br /&gt;
In depth info about the bootloader can be found on the [http://paparazzi.enac.fr/wiki/Reference/bootloader Bootloader reference] page. Also the [http://paparazzi.enac.fr/wiki/DevGuide/USBDownload page here] explains some more.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lpc21BootloaderUpload&amp;diff=9579</id>
		<title>Lpc21BootloaderUpload</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lpc21BootloaderUpload&amp;diff=9579"/>
		<updated>2011-06-13T05:16:11Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Bootloader from scatch==&lt;br /&gt;
&lt;br /&gt;
The goal of this page is to explain how to get the autopilot bootloader onto a ''brainless'' new ARM based autopilot board. Note that the bootloader only needs to be installed '''once''', when the board is first built and has never been used. Most of the times if you bought a board somewhere, the bootloader is already installed for you. If you did not make and soldered the Autopilot board yourself but bought it somewhere, chances are high the bootloader is already uploaded onto your board by the manufacturer. You could ask the supplier of your board. In that case you can just '''skip''' the steps described here and just continue the part of [http://paparazzi.enac.fr/wiki/Paparazzi_Center Uploading the Flightplan code to your autopilot board] or if you are more experienced you could go [http://paparazzi.enac.fr/wiki/Compiling here]&lt;br /&gt;
&lt;br /&gt;
[[Image:Bare_TWOG_Board.jpg|thumb|right|Bare_TWOG_Board.jpg]] &lt;br /&gt;
&lt;br /&gt;
==Why have Bootloader in the first place==&lt;br /&gt;
&lt;br /&gt;
Since the Airborne code and Flight-plans change frequently, it would be great if we could just simply upload new version with changes on the ground by connecting an USB cable to out airframes autopilot board. Well, the Bootloader makes this a simple reality.&lt;br /&gt;
&lt;br /&gt;
==How does it work==&lt;br /&gt;
&lt;br /&gt;
The Bootloader is uploaded through the serial interface UART0 (Serial1) by connecting certain point on the board to '''ground''' during power-up, sometimes referred to as: ''holding low''. On the board Tiny V1.x pin P0.14, Tiny V2.x this pin is called BOOT). 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.&lt;br /&gt;
&lt;br /&gt;
==Connecting it all==&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 Autopilot board. 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] [[Image:The_FTDI_RS232_USB_Cable.jpg|thumb|right|The FTDI RS232 USB Cable]]&lt;br /&gt;
&lt;br /&gt;
Some examples of suppliers:&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;
&lt;br /&gt;
It is strongly advised that you use a USB-serial converter with of the [[www.ftdichip.com|FTDI brand]] chip, as serial chips from the FTDI brand are by default working well in Linux. As a nice bonus, 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 Bootloader uploading.&lt;br /&gt;
&lt;br /&gt;
Make up a wiring harness similar to the following. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Cable_Bootloader_Full.jpg|Bootloader cable&lt;br /&gt;
Image:Cable_Bootloader_To_FTDI_USB.jpg|Bootloader cable to FTDI USB&lt;br /&gt;
Image:Bootloader_helper_cable_to_USB_FTDI_Cable.jpg|Bootloader helper cable to USB FTDI cable&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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 (Connectorname - 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;
 TWOG V1.x (Connectorname - DOWNLOAD):&amp;lt;br /&amp;gt;&lt;br /&gt;
 TWOG LPC_RXD0  &amp;lt;-- PC SERIAL TX (5V or 3.3V)&lt;br /&gt;
 TWOG LPC_TXD0  --&amp;gt; PC SERIAL RX (5V or 3.3V)&lt;br /&gt;
 TWOG BOOT      --&amp;gt; attach to ground, or wire through a pushbutton to ground&lt;br /&gt;
 TWOG GND       --&amp;gt; PC SERIAL ADAPTER GND&lt;br /&gt;
 &lt;br /&gt;
For TWOG make sure the GPS module is '''unplugged''' from the board. This is to prevent GPS serial data to disturb the uploading of the bootloader. &lt;br /&gt;
&lt;br /&gt;
[[Image:Where_To_Insert_Bootloader_Cable.jpg|thumb|right|Where to insert the Bootloader cable]]&lt;br /&gt;
&lt;br /&gt;
==Upload the firmware==&lt;br /&gt;
&lt;br /&gt;
Once this wiring is ready you will be ready to upload the bootloader to the autopilot board from your PC.&lt;br /&gt;
&lt;br /&gt;
To prepare the Autopilot board to accept uploads 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 the Bootloader firmware code upload over the serial connection.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Point_To_Connect_Ground.jpg|Point to_connect ground&lt;br /&gt;
Image:Closeup_Ground_Point.jpg|Closeup ground point&lt;br /&gt;
Image:Grounding_For_Bootloader_Closeup.jpg|closeup grounding point detail for Bootloader uploading&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step while your board is all connected and powered up is to type the commands for uploading the bootloader firmware.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:TWOG_Bootloader_Overview.jpg|TWOG Bootloader overview&lt;br /&gt;
Image:Powerup_Now.jpg|Everything ready to be powered-up now&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''In Linux'''&lt;br /&gt;
&lt;br /&gt;
From your Paparazzi 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 board. 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;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Wait_For_Bootloader_To_Upload.jpg|thumb|left|Wait for the bootloader to upload]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If everything is connected and setup correctly, after a while you will see the following messages &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Shell_bootloader_upload_success.jpg|thumb|left|Shell Bootloader upload success]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''In Windows'''&lt;br /&gt;
&lt;br /&gt;
If for some reason you need to program your autopilot board USB Bootloader in MS Windows you have to download the [http://www.openuas.org/site/LPC2000_Flash_ISP_Utility_v2.2.3.zip LPC2000 Flash Utility V2.2.3] or later. You will then prepare the autopilot board and start it in ISP bootloader state as described in the previous. This small utility will ony help uploading the Bootloder firmware. You will need to copy your compiled '''bl.hex''' file from Linux to your Windows OS. This file will be then uploaded.&lt;br /&gt;
&lt;br /&gt;
==Additional information==&lt;br /&gt;
In depth info about the bootloader can be found on the [http://paparazzi.enac.fr/wiki/Reference/bootloader Bootloader reference] page. Also the [http://paparazzi.enac.fr/wiki/DevGuide/USBDownload page here explains some more]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lpc21iap&amp;diff=9578</id>
		<title>Lpc21iap</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lpc21iap&amp;diff=9578"/>
		<updated>2011-06-13T05:11:01Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== lpc21iap ==&lt;br /&gt;
&lt;br /&gt;
This is a download application for Philips LPC processors. So far only the LPC214x series is supported (others don't have USB function). The built-in bootloader serial download for the LPC processors is not the fastest. An USB download might be much faster and convenient.&lt;br /&gt;
&lt;br /&gt;
An entire LPC2148 is re-flashed (erase, download, flash and verify 500kB) in a couple of seconds. Multiple LPC processors can be used and flashed with specific flash images by having different serial numbers.&lt;br /&gt;
&lt;br /&gt;
Bertrik Sikken provided a neat and easy-to-use USB library lpcusb that is the base for the embedded software. The lpc21isp software from Martin Maurer inspired the PC software. The libusb package is the API to have an easy access to the USB with Linux, Cygwin and Windows.&lt;br /&gt;
&lt;br /&gt;
Get libusb from sourceforge, install it. You might have to fiddle with hotplug or udev when using Linux for appropriate USB device access rights (see conf/system in the Paparazzi cvs). Make lpc21iap and the bootloader software for the target. Flash the bootloader bl.hex with lpc21isp.&lt;br /&gt;
&lt;br /&gt;
The first four 4096 bytes sectors (=16kByte) are reserved for the bootloader. Your application should be linked to 0x4000 (don't forget the &amp;lt;b&amp;gt;'-n' option&amp;lt;/b&amp;gt; when linking to allow being located exactly there). The bootloader interrupt vectors are re-directed to 0x4000 except the reset and the irq vector (use the VIC). After a reset the bootloader will check the Vbus (P0.23) pin (or any other, change it easily in crt.s) if it is set. If yes, the bootloader is started. Otherwise it will jump to 0x4000. The irq vector will read the reset vector from the VIC register. If you want to use USB in your application, change either the bootpin in crt.s or set it to one manually by writing '1' to GPIO P0.23.&lt;br /&gt;
&lt;br /&gt;
If you want to flash the first four sectors with lpc21iap you have to use the RAM version bl_ram.elf.&lt;br /&gt;
&lt;br /&gt;
The used USB vendor/device ID is made up (0x7070/0x1234). Someone willing to donate one?&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
Get the libusb and libusb-dev (both are included with the paparazzi-dev packages). For Windows and Cygwin, get libusb and generate a .inf file with vendor ID 0x7070 and product ID 0x1234 using the libusb instructions. Build the Linux and Cygwin version with the make file or use the command line for Windows:&lt;br /&gt;
&lt;br /&gt;
 cl lpc21iap.c elf.c lpcusb.c libusb.lib&lt;br /&gt;
&lt;br /&gt;
Install it with the NXP serial tool, JTAG interface or lpc21isp. Connect USB and download your application.&lt;br /&gt;
&lt;br /&gt;
 lpc21iap myapp.elf &amp;lt;serial number&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To reflash the bootloader first load the RAM version and then the new bootloader.&lt;br /&gt;
&lt;br /&gt;
 lpc21iap bl-ram.elf&lt;br /&gt;
 lpc21iap bl.elf&lt;br /&gt;
&lt;br /&gt;
The lpc21iap and bootloader can be found in the Paparazzi cvs&lt;br /&gt;
&lt;br /&gt;
 http://cvs.savannah.nongnu.org/viewvc/paparazzi3/sw/ground_segment/lpc21iap/?root=paparazzi&lt;br /&gt;
 http://cvs.savannah.nongnu.org/viewvc/paparazzi3/sw/airborne/arm7/test/bootloader/?root=paparazzi&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
The Philips LPC21 ISP and IAP commands are used to communicate with the device. They are transparently transferred over USB. Either of the protocols can be used (each command set includes commands the other one does not support). Some proprietary bootloader BTL commands are added as well.&lt;br /&gt;
&lt;br /&gt;
Every command consists of up to three phases. In the first phase the command plus parameters are given to the device and immediately executed. The host might receive a result in the second phase (not mandatory). The third phase is used to transfer data to/from the device. Some commands consist only of one phase (eg. GO), some need all three phases (eg. WRITE_TO_RAM).&lt;br /&gt;
&lt;br /&gt;
The IAP and ISP commands are mapped to (endpoint 0) vendor requests. The switching between command and result is done by the direction bit in bmRequestType (Host-to-device = command). The bRequest is defined as:&lt;br /&gt;
&lt;br /&gt;
 REQ_ISP_COMMAND     0xF0&lt;br /&gt;
 REQ_IAP_COMMAND     0xF1&lt;br /&gt;
 REQ_BTL_COMMAND     0xF2&lt;br /&gt;
 REQ_DATA_TRANSFER   0xF3&lt;br /&gt;
&lt;br /&gt;
The wValue and wIndex of the request are reserved, write them as zero. The wLength defines the number of bytes to be transferred to/from device in this request. Command, result and data is transferred during the data phase of the vendor request. wLength is 20 bytes (5 words) in the command phase, 32 bytes (3 + 5 words) in result phase and can be any size in data phase. Little endian format is used for any data.&lt;br /&gt;
&lt;br /&gt;
The command consists of 5 words as defined by Philips IAP/ISP definition. Word 0 is the command (eg. ASCII value 'G' for ISP_GO in ISP or value 56 in IAP for IAP_COMPARE. Word 1-4 give additional parameters.&lt;br /&gt;
&lt;br /&gt;
The result size is 8 words. Word 0 gives the result and word 1-2 contains additional response information. Word 3-7 contain the original command that the result came from.&lt;br /&gt;
&lt;br /&gt;
Some commands require additional data to be transferred. This data is send with one or more DATA_TRANSFER requests. The total length of data is defined in the command (eg. READ_MEMORY) phase. Data transfer sizes bigger than 4kBytes have to be split in several data transfer requests.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
 direction   host-&amp;gt;device&lt;br /&gt;
 request     REQ_ISP_COMMAND&lt;br /&gt;
 command[0]  ISP_WRITE_TO_RAM&lt;br /&gt;
 command[1]  (startaddress)&lt;br /&gt;
 command[2]  (size)&lt;br /&gt;
 command[3]  (undefined)&lt;br /&gt;
 command[4]  (undefined)&lt;br /&gt;
&lt;br /&gt;
 direction   host&amp;lt;-device&lt;br /&gt;
 request     REQ_ISP_COMMAND&lt;br /&gt;
 result[0]   CMD_SUCCESS&lt;br /&gt;
 result[1]   (undefined)&lt;br /&gt;
 result[2]   (undefined)&lt;br /&gt;
 result[3]   ISP_WRITE_TO_RAM&lt;br /&gt;
 result[4]   (startaddress)&lt;br /&gt;
 result[5]   (size)&lt;br /&gt;
 result[6]   (undefined)&lt;br /&gt;
 result[7]   (undefined)&lt;br /&gt;
&lt;br /&gt;
 direction   host-&amp;gt;device&lt;br /&gt;
 request     REQ_DATA_TRANSFER&lt;br /&gt;
 data[0]     (data)&lt;br /&gt;
  ...&lt;br /&gt;
 data[n]     (data)&lt;br /&gt;
&lt;br /&gt;
 direction   host-&amp;gt;device&lt;br /&gt;
 request     REQ_DATA_TRANSFER&lt;br /&gt;
 data[n+1]   (data)&lt;br /&gt;
  ...&lt;br /&gt;
 data[size]  (data)&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=9577</id>
		<title>DevGuide/Values</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=9577"/>
		<updated>2011-06-13T04:58:42Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &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;
&lt;br /&gt;
The most important sensor. It gives stick movements from the safety pilot to the aircraft. The values are derived from the angle of the sticks or from position switches. The minimum configuration for a Paparazzi transmitter is two sticks and one three-position switch for 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 the middle position. These are the min and max positions and values we use for a transmitter with throttle on the right :&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 angles. The information is in the length of a pulse. Usually a 1.5ms pulse is middle position and 1ms equals -100% and 2ms 100%. The pulses are sent as a packet and 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;
Note: Proprietary PCM is not supported directly by Paparazzi at this moment. Ofcourse if one knows or reversed the specific PCMx format one can add support to handle this format also. However it has no direct benefit for the autopilot project.&lt;br /&gt;
&lt;br /&gt;
[[Image:9ch_pulses.png|9 Channel PPM signal]]&lt;br /&gt;
&lt;br /&gt;
Various brands of RC transmitter can use slightly different timings for the middle and 100% positions and sometimes also have different directions. The /conf/radio folder contains settings for different transmitters, choose one that mostly resembles yours. Then adjust the file so it is tailored to your situation. Here, also no trim should be used. Give the repeat time of the PPM pulse and the number of channels (you have one pulse more than channels!). The switches can be filtered by a low pass filter through the [http://paparazzi.enac.fr/wiki/Radio_Control#Averaging &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 diversity 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;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:RC]] [[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=9576</id>
		<title>DevGuide/Values</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Values&amp;diff=9576"/>
		<updated>2011-06-13T04:57:22Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &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;
&lt;br /&gt;
The most important sensor. It gives stick movements from the safety pilot to the aircraft. The values are derived from the angle of the sticks or from position switches. The minimum configuration for a Paparazzi transmitter is two sticks and one three-position switch for 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 the middle position. These are the min and max positions and values we use for a transmitter with throttle on the right :&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 angles. The information is in the length of a pulse. Usually a 1.5ms pulse is middle position and 1ms equals -100% and 2ms 100%. The pulses are sent as a packet and 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;
Note: Proprietary PCM is not supported directly by Paparazzi at this moment. Ofcourse if one knows or reversed the specific PCMx format one can add support to handle this format also. However it has no direct benefit for the autopilot project.&lt;br /&gt;
&lt;br /&gt;
[[Image:9ch_pulses.png|9 Channel PPM signal]]&lt;br /&gt;
&lt;br /&gt;
Various brands of RC transmitter can use slightly different timings for the middle and 100% positions and somtimes also have different directions. The /conf/radio folder contains settings for different transmitters, choose one that mostly resemles yours. Then adjust the file so it is tailored to your situation. Here, also no trim should be used. Give the repeat time of the PPM pulse and the number of channels (you have one pulse more than channels!). The switches can be filtered by a low pass filter through the [http://paparazzi.enac.fr/wiki/Radio_Control#Averaging &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;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:RC]] [[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Communications&amp;diff=9575</id>
		<title>DevGuide/Communications</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/Communications&amp;diff=9575"/>
		<updated>2011-06-13T04:56:17Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &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;field name=&amp;quot;alt&amp;quot; type=&amp;quot;uint32&amp;quot; unit=&amp;quot;mm&amp;quot; alt_unit=&amp;quot;m&amp;quot; alt_unit_coef=&amp;quot;1000&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;
The '''alt_unit''' and '''alt_unit_coef''' will be used the [[RTPlotter|Plotter]] and the [[Messages|Messages]] agents to display human readable values.&lt;br /&gt;
When '''alt_unit_coef''' is not specified, some basic default conversions are automatic:&lt;br /&gt;
* deg &amp;lt;-&amp;gt; rad&lt;br /&gt;
* deg/s &amp;lt;-&amp;gt; rad/s&lt;br /&gt;
* m &amp;lt;-&amp;gt; cm&lt;br /&gt;
* m/s &amp;lt;-&amp;gt; cm/s&lt;br /&gt;
* decideg -&amp;gt; deg&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, &amp;amp;mark_alt);&lt;br /&gt;
 &lt;br /&gt;
You can also have the autopilot send the message periodically.&lt;br /&gt;
For doing so, 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, &amp;amp;mark_alt)&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 ( &amp;lt;tt&amp;gt;ivyprobe '(.*)'&amp;lt;/tt&amp;gt; ).&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 found 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;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Contributing&amp;diff=9574</id>
		<title>Contributing</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Contributing&amp;diff=9574"/>
		<updated>2011-06-13T04:47:34Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to contribute ==&lt;br /&gt;
There are of course lots of ways to contribute to Paparazzi and get involved.&lt;br /&gt;
&lt;br /&gt;
Help is always welcome on all aspects of the project. May this be documentation, wiki, maintenance, electronics or code contributions/fixes.&lt;br /&gt;
&lt;br /&gt;
=== Wiki ===&lt;br /&gt;
Just create an account and you can start adding information, cleaning it up or just fixing some typo you just noticed :-)&lt;br /&gt;
&lt;br /&gt;
=== Software development ===&lt;br /&gt;
We use the distributed version control system [http://git-scm.com/ git]. The [http://github.com/paparazzi/paparazzi/ Papaprazzi master repository is hosted on Github].&lt;br /&gt;
&lt;br /&gt;
Please also see the [[Git|Git wiki page]] for more details about setting up Git and cloning the sourcecode and data repository.&lt;br /&gt;
&lt;br /&gt;
Here is the short version if you already know git:&lt;br /&gt;
# Create an account on [http://github.com/ github].&lt;br /&gt;
# Fork the [http://github.com/paparazzi/paparazzi/ papaprazzi repo] on github. (After logging in press the '''fork''' button).&lt;br /&gt;
# '''git clone git@github.com:&amp;lt;yourname&amp;gt;/paparazzi.git'''&lt;br /&gt;
# fix/code&lt;br /&gt;
# push your feature/bugfix branch&lt;br /&gt;
# Send us a [http://help.github.com/pull-requests/ pull request] on github. (Or send patches to the mailing list).&lt;br /&gt;
&lt;br /&gt;
=== Issue/Feature Tracker ===&lt;br /&gt;
To report bugs, issues and feature request please use either the mailing list or even better the simple [https://github.com/paparazzi/paparazzi/issues issue tracker on github]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/LearningToProgram&amp;diff=9573</id>
		<title>DevGuide/LearningToProgram</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/LearningToProgram&amp;diff=9573"/>
		<updated>2011-06-13T04:46:44Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
There sometimes comes a moment that you would like to have more functionality in the Paparazzi GCS, in the airborne code or somewhere else. This non existent functionality does not come out of the blue. It took all the people involved blood, sweat and tears to get where the paparazzi is now. Also for you, it can be very rewarding to program improvements for the paparazzi. Some words of advise: first make sure you used the already available Paparazzi Autopilot for an extensive amount of time. Also you have read a year or so in the Wiki and are comfortable with all that there is written. You also managed to compile airborne via  the command line, then there is a moment you might delve deeper into the Paparazzi and learn to code.&lt;br /&gt;
&lt;br /&gt;
If this is your first programming experience it is maybe better to learn to program some generic desktop applications first. Altering and enhancing the code is even for seasoned programmers not a trivial task. Now if all of this did not make you less motivated, great! Let's get to it.&lt;br /&gt;
&lt;br /&gt;
On this page you will not find in depth info of the languages use. There are much better resource on the internet already than we could ever provide in this Wiki. Therefore there are only link to learning these languages.&lt;br /&gt;
&lt;br /&gt;
What can be found are code snippets '''directly''' related to the paparazzi code.&lt;br /&gt;
&lt;br /&gt;
== Languages ==&lt;br /&gt;
&lt;br /&gt;
The whole of paparazzi is written in various programming languages.&lt;br /&gt;
&lt;br /&gt;
=== OCAML ===&lt;br /&gt;
&lt;br /&gt;
The Objective Caml system is the main implementation of the Caml language. It is a functional programming language, and also features a powerful module system and a full-fledged object-oriented layer. It comes with a native-code compiler that supports numerous architectures, for high performance; a bytecode compiler, for increased portability; and an interactive loop, for experimentation and rapid development. &lt;br /&gt;
&lt;br /&gt;
http://www.ocaml-tutorial.org/&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
http://www.cprogramming.com/tutorial.html&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
Python is a clear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java. &lt;br /&gt;
&lt;br /&gt;
http://wiki.python.org/moin/BeginnersGuide&lt;br /&gt;
&lt;br /&gt;
== Makefiles ==&lt;br /&gt;
&lt;br /&gt;
Makefiles also can be seen as small, sometimes even large programs. &lt;br /&gt;
&lt;br /&gt;
http://www.tutorialspoint.com/makefile/index.htm&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Dev/STM32I2C&amp;diff=9275</id>
		<title>Dev/STM32I2C</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Dev/STM32I2C&amp;diff=9275"/>
		<updated>2011-04-15T09:17:51Z</updated>

		<summary type="html">&lt;p&gt;Sergio812: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a work document about STM32 driver&lt;br /&gt;
Ideas welcome!&lt;/div&gt;</summary>
		<author><name>Sergio812</name></author>
	</entry>
</feed>