http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&user=Scdwyer&feedformat=atom
PaparazziUAV - User contributions [en]
2024-03-29T15:05:36Z
User contributions
MediaWiki 1.37.1
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=18213
Installation/MacOSX
2014-02-01T22:57:40Z
<p>Scdwyer: updated binary install process</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Update on OS X installation: Currently, arm-none-eabi-gdb on 10.6 should be broken (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work).'''<br />
<br />
'''(Feb. 1, 2014) Current OS X limitations:'''<br />
* '''10.6.* requires some manual effort to properly install gcc-arm-embedded, email the mailing list if help required (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work)'''<br />
* '''There is no cross compiler for the ARDrone2.'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.6.*, 10.7.*, 10.8.*, and 10.9.*. Support on 10.6.* requires some additional effort.<br />
<br />
== Basic Install (Binary Installer) (Support: 10.7.*, 10.8.*, 10.9.*)==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer for your OS version from [http://download.paparazziuav.org/darwin/ paparazziuav.org] </li><br />
<li>Set up your environment variables and Python appropriately using the pprz-env-set script:</li><br />
<ol><br />
<li>Get the script: <source lang="bash">curl https://raw2.github.com/paparazzi/paparazzi-portability-support/master/darwin/install/Contents/Resources/pprz-env-set > ~/Desktop/pprz-env-set</source></li><br />
<li>Move script to right location: <source lang="bash">sudo mv ~/Desktop/pprz-env-set /opt/paparazzi/bin/pprz-env-set</source></li><br />
<li>Change script permissions: <source lang="bash">sudo chmod 755 /opt/paparazzi/bin/pprz-env-set</source></li><br />
<li>Run the script: <source lang="bash">sudo pprz-set-env</source></li><br />
</ol><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Notes: <br />
* the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
* the binary installer will add a few lines to your ~/.profile for PATH modification and for default PAPARAZZI_HOME and PAPARAZZI_SRC env vars. If you have something other than the default ~/paparazzi installation, please edit your ~/.profile and comment out the env var exports.<br />
* the binary installer creates a symbolic link between the available /opt/paparazzi/bin/python2.7 and /opt/paparazzi/bin/python. Combined with the PATH modification, this will cause <source lang="bash">python something.py</source> to call /opt/paparazzi/bin/python2.7 instead of any system pythons.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
<source lang="bash"><br />
sudo pprz-env-setup -u<br />
</source><br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
</source><br />
<br />
Note that pprz-env-setup -u removes the entry from ~/.profile and also removes the /opt/paparazzi/bin/python symlink.<br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Adjusting your PATH and Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:<br />
<source lang="bash">sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=== Mavericks Notes ===<br />
<br />
'''Q:''' Can not find the command line tools package in XCode any more.<br />
<br />
'''A:''' Since Mavericks (10.9) it is not necessary to install xcode to install the command line tools package that is needed for macports and paparazzi. Just run in the command line:<br />
xcode-select --install<br />
<br />
'''Q:''' libgcc is not compiling with error:<br />
:info:build The directory that should contain system headers does not exist:<br />
:info:build /usr/include<br />
<br />
'''A:''' You probably upgraded from older OS X and are using old command line tools. Make sure to run '''xcode-select --install''' command. This should fix the libgcc compilation error.<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=16297
Installation/MacOSX
2013-11-16T03:44:35Z
<p>Scdwyer: tweak binary install and uninstall instructions</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Update on OS X installation: Currently, only launching agents from paparazzi center in 10.8 and arm-none-eabi-gdb on 10.6 should be broken (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work). The simulator should be working again. The binaries are still unavailable as there has not been time to set up a new build server. (June 4, 2013)'''<br />
<br />
'''(Nov. 15, 2013) Current OS X limitations:'''<br />
* '''[https://github.com/paparazzi/paparazzi/issues/290 Launching agents from Paparazzi Center on 10.8.* and 10.9.* is not working]'''<br />
* '''10.6.* requires some manual effort to properly install gcc-arm-embedded, email the mailing list if help required'''<br />
* '''Binary installers are currently only available for Lion'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.6.*, 10.7.*, 10.8.*, and 10.9.*. Support on 10.6.* requires some additional effort.<br />
<br />
== Basic Install (Binary Installer) (Support: 10.7.*)==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer for your OS version from [http://download.paparazziuav.org/darwin/ paparazziuav.org] </li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Notes: <br />
* the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
* the binary installer will add a few lines to your ~/.profile for PATH modification and for default PAPARAZZI_HOME and PAPARAZZI_SRC env vars. If you have something other than the default ~/paparazzi installation, please edit your ~/.profile and comment out the env var exports.<br />
* the binary installer creates a symbolic link between the available /opt/paparazzi/bin/python2.7 and /opt/paparazzi/bin/python. Combined with the PATH modification, this will cause <source lang="bash">python something.py</source> to call /opt/paparazzi/bin/python2.7 instead of any system pythons.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
<source lang="bash"><br />
sudo pprz-env-setup -u<br />
</source><br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
</source><br />
<br />
Note that pprz-env-setup -u removes the entry from ~/.profile and also removes the /opt/paparazzi/bin/python symlink.<br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:<br />
<source lang="bash">sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=== Mavericks Notes ===<br />
<br />
'''Q:''' Can not find the command line tools package in XCode any more.<br />
<br />
'''A:''' Since Mavericks (10.9) it is not necessary to install xcode to install the command line tools package that is needed for macports and paparazzi. Just run in the command line:<br />
xcode-select --install<br />
<br />
'''Q:''' libgcc is not compiling with error:<br />
:info:build The directory that should contain system headers does not exist:<br />
:info:build /usr/include<br />
<br />
'''A:''' You probably upgraded from older OS X and are using old command line tools. Make sure to run '''xcode-select --install''' command. This should fix the libgcc compilation error.<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=16260
Installation/MacOSX
2013-11-09T23:45:37Z
<p>Scdwyer: updated binary installer link and os x support status</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''Update on OS X installation: Currently, only launching agents from paparazzi center in 10.8 and arm-none-eabi-gdb on 10.6 should be broken (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work). The simulator should be working again. The binaries are still unavailable as there has not been time to set up a new build server. (June 4, 2013)'''<br />
<br />
'''(Nov. 9, 2013) Current OS X limitations:'''<br />
* '''Launching agents from Paparazzi Center on 10.8.* and 10.9.* is not working'''<br />
* '''Macports installation is currently broken on 10.9.*'''<br />
* '''10.6.* requires some manual effort to properly install gcc-arm-embedded, email the mailing list if help required'''<br />
* '''Binary installers are currently only available for Lion'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.6.*, 10.7.*, and 10.8.*. Support on 10.6.* requires some additional effort, and support for 10.9.* is in progress.<br />
<br />
== Basic Install (Binary Installer) (Support: 10.7.*)==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer for your OS version from [http://download.paparazziuav.org/darwin/ paparazziuav.org] </li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
PUT A NOTE HERE ABOUT SELECTING THE RIGHT PYTHON<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:<br />
<source lang="bash">sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Talk:NPS&diff=15722
Talk:NPS
2013-08-17T17:12:54Z
<p>Scdwyer: </p>
<hr />
<div>I could not find where this simulation speed factor can be edited in any configuration file of NPS or anywhere else<br />
<br />
-----<br />
<br />
You can not supply a simulation speed in a configuration file right now - is that something you want to do? It would be quite easy to add. --[[User:Scdwyer|Scdwyer]] 21:35, 16 August 2013 (UTC)<br />
<br />
-----<br />
<br />
Hello human. My problem is that the simulator generates the warning "Warning: The time factor is too large for efficient operation! Please reduce the time factor.". This happens with a Samsung NC10, and Quad_LisaM2, which seems by the way to be the only way for me to simulate rotor_craft.xml flight plan. So i wonder if this time factor is why the simulator doesn't work properly yet for me with rotorcrafts. All I want to do is to simulate flight plans for an ARDrone2, but since there's no such thing as an paparazzi/conf/simulator/jsbsim/aircraft/ardrone2_raw.xml file, I use Quad_LisaM2. Or is there ?<br />
Here I used https://github.com/paparazzi/paparazzi.git<br />
Changing the time code directly in the code is fine for me. Then where is it ?<br />
By the way, is there a forum for these discussions, especially for the Ardrone2 ?<br />
<br />
Ok, I have found that the simulator essentially works, but provides a sort of random position on earth for the startup GPS position instead of those in the flight plan header. And in order to have in view the waypoints, you have to press the icon "fit to window" in GCS. Not at the right place on earth, but that"s ok to test the flight plan. --[[User:Laurentc|Laurentc]] 11:29, 17 August 2013 (UTC)<br />
<br />
-----<br />
<br />
Hello - The best place for questions like these is the mailing list: [[Contact]]. You should join the list and we can continue discussion there. You can also try IRC for help, but unless there happens to be someone who can answer your questions right away, the mailing list is probably just as fast, since people are distributed around the world.<br />
<br />
For your current questions: The warning means that the simulation has zero downtime between each simulator timestep and usually indicates you are no longer running in realtime (i.e. the simulation will get further and further behind, a simulation timestep of say 0.010 seconds might actually be taking 0.015 seconds in real time). If you are already running at a time factor of 1 (realtime) then there probably isn't much you can do as your computer can't keep up with all of the calculations. You can try reducing any load possible by shutting down other programs, and not trying to use FlightGear (if you are).<br />
<br />
For the simulation start position, it usually uses whatever is set in conf/simulator/jsbsim/aircraft/reset00.xml (this is being changed to use what is in the flightplan header as the default soon). Note the initial conditions file is selected in the airframe file: conf/airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml approximately line 200 with <define name="JSBSIM_INIT" value="&quot;reset00&quot;"/>.<br />
<br />
If you have more questions, please use the mailing list (and if you can, copy this discussion into your message for good measure?)<br />
<br />
--[[User:Scdwyer|Scdwyer]] 17:12, 17 August 2013 (UTC)</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Talk:NPS&diff=15719
Talk:NPS
2013-08-16T21:35:00Z
<p>Scdwyer: </p>
<hr />
<div><br />
I could not find where this simulation speed factor can be edited in any configuration file of NPS or anywhere else<br />
<br />
You can not supply a simulation speed in a configuration file right now - is that something you want to do? It would be quite easy to add. --[[User:Scdwyer|Scdwyer]] 21:35, 16 August 2013 (UTC)</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=15487
Flight Plans
2013-07-13T22:05:40Z
<p>Scdwyer: minor typo Get not Gps</p>
<hr />
<div>A '''flight plan''' is a XML document which one can create and store aboard an autopilot. The flight plan will describe how you want your aircraft to travel if released into into the wild blue yonder.<br />
<br />
== DTD and Structure ==<br />
<br />
The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<source lang="xml"><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></source><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans via the GUI.<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
'''A flight plan is composed of two mandatory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]]'''<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt>'''<flight_plan name lat0 lon0 ground_alt security_height home_mode_height qfu alt max_dist_from_home>'''</tt><br />
; <tt>'''name'''</tt>: the name of the mission (a text string)<br />
; <tt>'''lat0, lon0'''</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
; <tt>'''ground_alt'''</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
; <tt>'''security_height'''</tt>: the height (over <tt>'''ground_alt'''</tt>) used by the circle-home failsafe procedure and in other flight procedures such as formation flight and anti-collision avoidance. Warnings are produced if you place a waypoint lower than <tt>'''security_height'''</tt> (usually the case for the landing point)<br />
; <tt>'''home_mode_height'''</tt> (optional): this optional attribute available since v4.2 allows to override <tt>'''security_height'''</tt> as failsafe height in home mode. If <tt>'''home_mode_height'''</tt> is set lower than <tt>'''security_height'''</tt>, the later is used. This attribute is useful if you need to return home at a high altitude rather than a low altitude.<br />
; <tt>'''qfu'''</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft. So if you want to take off and climb to the West you would use qfu=270. <br />
; <tt>'''alt'''</tt>: the default altitude of waypoints ([[Altitude_definitions|Above Sea Level]]). So if your ground altitude is 400 then alt needs to be a value greater than ground altitude and above any obstructions in the flight plan. <br />
; <tt>'''max_dist_from_home'''</tt>: the maximum allowed distance (in meters) from the HOME waypoint. Exceeding this value will trigger an exception.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<source lang="xml"><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250" home_mode_height="150"><br />
</source><br />
<br />
Note that a flight plan could also contain optional <tt>include</tt>'s and <tt>exceptions</tt> cases.<br />
<br />
== Waypoints ==<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified by it's name and coordinates:<br />
<tt>''' <waypoint name wpx wpy [alt] [height]/> '''</tt><br />
where wpx and wpy are real positional coordinates ( <tt>'''lat/lon'''</tt> ) '''or''' UTM coordinates ( <tt>'''utm_x0/utm_y0'''</tt> ) '''or''' relative coordinates ( <tt>'''x/y'''</tt> ) in meters from your reference point {0,0} . <tt>alt</tt> and <tt>height</tt> are optional parameters and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> parameter of the flightplan. To set the waypoint altitude relative to the [[Altitude_definitions|ground altitude]] (<tt>ground_alt</tt>) of the flight plan for this waypoint, use the <tt>height</tt> attribute instead of <tt>alt</tt>.<br />
<br />
An example:<br />
<source lang="xml"><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="BRIDGEOVERRIVER" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="MyBarn" x="-130.0" y="217.5" alt="3000."/><br />
<waypoint name="3" x="-30.0" y="50" height="50."/><br />
<waypoint name="4" x="-30.0" y="50." alt="ground_alt + 50"/><br />
<waypoint name="_MYHELPERSPOT" x="-30.0" y="60" height="50."/><br />
<waypoint name="_MYOTHERHELPERSPOT" x="-70.0" y="90" height="70."/><br />
<waypoint name="TOWER" lat="48.858249" lon="2.294494" height="324."/><br />
<waypoint name="MountainCAFE" utm_x0="360284.8" utm_y0="4813595.5" alt="1965."/><br />
</waypoints><br />
</source><br />
<br />
'''Tips'''<br />
* Waypoints are easily adjusted with the [[Flight_Plan_Editor|flight plan editor]].<br />
* If a waypoint name starts with an underscore, the waypoint is '''not displayed''' in the GCS, except in editor mode.<br />
* The maximum number of waypoints is 254.<br />
* A waypoint named <tt>HOME</tt> is required if the failsafe HOME mode procedure is used.<br />
<br />
== Sectors ==<br />
<br />
Flat ''Sectors'' can be described as an area defined by list of waypoint corners. Such an area will be displayed in the Ground Control Station (GCS) by colored lines.<br />
A function is generated to check if a point, usually the aircraft itself, is ''inside'' this sector. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>. Note that sector names are not allowed to contain spaces. The generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS. It would be great if one would help improving that part of the source code.<br />
<br />
For example, with the following element in a flight plan.<br />
<source lang="xml"><br />
<sectors><br />
<sector name="MyCosySector" color="red"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</source><br />
<br />
It is then possible to write a exception. For example if the aircraft for some reason flies outside this sector the airframe will fly to a standby waypoint. The exclamation mark (!) means the boolean operator <tt>NOT</tt> in this example. In regular language one would describe "If my airframe is NOT inside the Murret sector anymore then deroute it to the standby waypoint." In Flightplan "Speak" this is written like: <br />
<source lang="xml"><br />
<exception cond="! InsideMyCosySector(GetPosX(), GetPosY())" deroute="standby"/><br />
</source><br />
<br />
'''Tips'''<br />
* A nice option in the corner notation is that one can add an underscore in front of the name; a corner or waypoint name that starts with an underscore is not displayed in the GCS. Only in editor mode it is visible. It is visible in editor mode, because if you the could not see it, it also would be not possible to edit or drag the corner or waypoint to another position.<br />
* The color of the sector is not fixed but can be defined by oneself if wished for via the color attribute.<br />
<br />
== Includes ==<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<source lang="xml"><br />
<includes><br />
<include name="landing" procedure="landing.xml"/><br />
</includes><br />
</source><br />
<br />
== Blocks ==<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot goes to the next one. The behaviour after the last stage of the last block is undefined. <br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<source lang="xml"><br />
<!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval|home|path)*><br />
</source><br />
<br />
Example:<br />
<source lang="xml"><br />
<block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block><br />
</source><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<source lang="xml"><br />
<block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
This button will activate the block. If the attribute <tt>group</tt> is specified, all strip buttons of the same group will be placed vertically on top of each other.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<source lang="xml"><br />
<block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<source lang="xml"><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></source><br />
<br />
You can call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
==== Expressions ====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
=== Initialization Blocks ===<br />
The first three blocks of flight plan are initialization blocks. <br />
<br />
The first block waits until the GPS fix has been established, as shown below.<br />
<source lang="xml"><br />
<blocks><br />
<block name="Wait GPS"><br />
<set value="1" var="kill_throttle"/><br />
<while cond="!GpsFixValid()"/><br />
</block><br />
</source><br />
The second block updates the local waypoints with respect to the UAV.<br />
<source lang="xml"><br />
<block name="Geo init"><br />
<while cond="LessThan(NavBlockTime(), 10)"/><br />
<call fun="NavSetGroundReferenceHere()"/><br />
</block><br />
</source><br />
This next block prevents the UAV from starting the engine and taking off. <br />
<source lang="xml"><br />
<block name="Holding point"><br />
<!--set var="nav_mode" value="NAV_MODE_ROLL"/--><br />
<set value="1" var="kill_throttle"/><br />
<attitude roll="0" throttle="0" vmode="throttle"/><br />
</block><br />
</source><br />
=== Exceptions ===<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<source lang="xml"><exception cond="..." deroute="..."></source><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<source lang="xml"><br />
<exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > GetPosAlt())" deroute="go_up"/><br />
<exception cond="(autopilot_flight_time > 840)" deroute="quick_land"/><br />
</source><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<source lang="xml"><br />
<flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...<br />
</source><br />
<br />
=== Deroute ===<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<source lang="xml"><deroute block="landing"/></source><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
=== Loops ===<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<source lang="xml"><br />
<while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while><br />
</source><br />
In this example, we run an infinite loop, lettin the aircraft try to go via waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<source lang="xml"><br />
<for var="i" from="0" to="3"><br />
...<br />
</for><br />
</source><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<source lang="xml"><br />
<for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for><br />
</source><br />
<br />
In this example, the aircraft will circle around waypoint '''HOME''' for 10 seconds at and altitude above ground of 50m, 10 seconds at altitude 100 meter (50+50), ... until 250m (5x +50).<br />
<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
=== Navigation modes ===<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* path : list of waypoints linked by ''go''<br />
* circle : circle around a waypoint;<br />
* oval : two half circles with a straight between two nav points<br />
* eight : fly a figure of eight through a waypoint and around another<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
=== Attitude ===<br />
<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<source lang="xml"><attitude roll="0" vmode="throttle", throttle="0.5"/></source><br />
<br />
To fly around, holding a given altitude:<br />
<source lang="xml"><attitude roll="30" alt="ground_alt+50"/></source><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
=== Heading ===<br />
<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<source lang="xml"><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(GetPosAlt() > ground_alt+30)"/></source><br />
<br />
=== Go ===<br />
<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<source lang="xml"><go wp="HOME"/></source><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route"/></source><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<source lang="xml"><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></source><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></source><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></source><br />
<br />
=== Path ===<br />
<br />
The <tt>path</tt> primitive is just a shorthand expression for a set of <tt>go</tt> primitives. A list of waypoints defined with the <tt>wpts</tt> attribute is pre-processed into a set of <tt>go</tt> primitives with the <tt>hmode</tt> attribute. For example:<br />
<source lang="xml"><path wpts="wp1, wp2, wp3"/></source><br />
<br />
Other attributes are optional:<br />
<source lang="xml"><path wpts="wp3, w1, wp2" approaching_time="1" pitch="auto" throttle="0.5"/></source><br />
<br />
=== Circle ===<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<source lang="xml"><circle wp="HOME" radius="75"/></source><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<source lang="xml"><circle wp="wp1" radius="50+(GetPosAlt()-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></source><br />
<br />
=== Oval ===<br />
The oval consists of two half circles that are connected with two straight lines. This flight path is usefull when a IMU is used because the straights allow for level flight. <br />
<source lang="xml"> <oval p1="1" p2="2" radius="nav_radius"/> </source><br />
<br />
=== Eight ===<br />
Fly a figure of eight that consists of two straight legs that pass though the center and the center of the half circle at the end of the two legs is in the turn around waypoint. The altitude of the center waypoint is used for the entire figure. The turn around waypoint is moved to match radius given. <br />
<source lang="xml"> <eight center="1" radius="nav_radius" turn_around="2"/> </source><br />
<br />
=== Follow ===<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<source lang="xml"><follow ac_id="4" distance="50" height="20"/></source><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
=== Stay ===<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<source lang="xml"><stay wp="HOME" alt="10"/></source><br />
<br />
=== XYZ ===<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<source lang="xml"><xyz radius="40"/></source><br />
<br />
=== Set ===<br />
<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<source lang="xml"><set var="ground_alt" value="ground_alt+50"/></source><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
=== Call ===<br />
<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<source lang="xml"><br />
<call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/><br />
</source><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<source lang="xml"><br />
<header><br />
#include "nav_line.h"<br />
</header><br />
</source><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
You can also call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<source lang="xml"><br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
</source><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<source lang="xml"><br />
<set var="h_ctl_disabled" value="TRUE"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="FALSE"/><br />
</source><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<source lang="xml"><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></source><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<source lang="xml"><br />
<param name="alt"/><br />
<param name="radius" default_value="75"/><br />
</source><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<source lang="xml"><include name="landing" procedure="landing.xml"/></source><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<source lang="xml"><br />
<!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(GetPosAlt()- WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</procedure><br />
</source><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<source lang="xml"><deroute block="landing.land"/></source><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<source lang="xml"><exception cond="..." deroute="go-around"/></source><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<source lang="xml"><br />
<include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include><br />
</source><br />
<br />
== Tips and Tricks ==<br />
<br />
There are many ways to skin a cat just as there are many ways to craft your flight plan. Following the best practices tips can save you from a lot of frustration and mishap.<br />
<br />
* Simulate your flight plan before taking it to the sky. Flight plans should always be carefully tested prior to flight, take a look at the [[Simulation|simulation]] page for details on how to simulate your plan.<br />
* Make an subdirectory in the Flight_plan directory with your own name and add your flight plans there. Make sure that the location of the DTD is correct, e.g by using relative directory double dots as in <tt><!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd"></tt><br />
<br />
* Take a good look at other flight plans included with Paparazzi. To learn from example flight plans please visit the [[Flight_Plan_Examples|flight plan examples]] page<br />
* There are several option to build failsafe features into you flightplan, [[Failsafe|for some examples visit the Failsafe page]].<br />
* Some flight plan examples define waypoint locations using relative coordinates. These are relative positions from the fixed lat and lon in the header of the flight plan. When simulating your flight plan the aircraft always use the lat/lon as defined in the flight plan since a regular simulation has no notion of you current position of you local PC where you simulate on. This is something to keep in mind if you test your flight plan in real flights.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Release_Upgrades&diff=15486
Release Upgrades
2013-07-13T22:04:26Z
<p>Scdwyer: /* Flightplans */ minor typo Get not Gps</p>
<hr />
<div>The latest stable release is: '''v5.0.0_stable'''<br />
<br />
This page is help guide any software configuration changes in airframe files or configuration files, as well as provides hints around any behaviour or workflow changes.<br />
<br />
In any codeblocks, a leading '''-''' indicates one should remove the line, while a leading '''+''' indicates one should add the line. In other cases, only names have changed.<br />
<br />
DISCLAIMER: This page is by no means guaranteed to be complete. If you find another required change that was missed, please add it!<br />
<br />
== Upgrading from v4.2.0_stable to v5.0.0_stable ==<br />
<br />
Changelog for this release on GitHub: [https://github.com/paparazzi/paparazzi/blob/v5.0/CHANGELOG.md changelog]<br />
<br />
=== Control Panel ===<br />
<br />
A '''new simulator launcher''' has been added to better select between the different types of simulator (OCAML fixed-wing, JSBSim fixed-wing, NPS, etc). The launcher path must be changed to support this:<br />
{{Box Code|conf/controlpanel.xml|<br />
<source lang="xml"><br />
- <program name="Simulator" command="sw/simulator/launchsitl"><br />
+ <program name="Simulator" command="sw/simulator/pprzsim-launch"><br />
</source><br />
}}<br />
<br />
=== Flightplans ===<br />
<br />
The adoption of the '''state interface''' means a number of functions and variables previously used in the flightplans are no longer valid, and must be replaced by their equivalent:<br />
<br />
* <tt>'''GetPosAlt()'''</tt> replaces <tt>'''estimator_z'''</tt><br />
* <tt>'''GetPosX()'''</tt> replaces <tt>'''estimator_x'''</tt><br />
* <tt>'''GetPosY()'''</tt> replaces <tt>'''estimator_y'''</tt><br />
* <tt>'''autopilot_flight_time'''</tt> replaces <tt>'''estimator_flight_time'''</tt><br />
<br />
Advanced flightplans will likely require additional changes.<br />
<br />
=== Airframes ===<br />
<br />
A number of changes to clarify names and clean up subsystems and modules means airframe files must be updated:<br />
<br />
==== All Airframes ====<br />
<br />
* <tt>'''CONTROL_FREQUENCY'''</tt> replaces <tt>'''CONTROL_RATE'''</tt><br />
<br />
==== Fixedwing Airframes ====<br />
<br />
The altitude/climb estimator has been cleaned up.<br />
<br />
Change the way the altitude kalman filter is enabled:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="MISC"><br />
...<br />
+ <define name="ALT_KALMAN_ENABLED" value="TRUE"/> <!-- can also be set to FALSE (default if not present) --><br />
</section><br />
<br />
<firmware name="fixedwing"><br />
...<br />
- <define name="ALT_KALMAN"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
Add the altitude INS subsystem if there is an <tt>ALT_KALMAN_ENABLED</tt> define or if you use a barometer:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="alt_float" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
'''Alternatively''', use the <tt>gps_passthrough</tt> subsystem to use direct GPS data (remove all <tt>ALT_KALMAN_ENABLED</tt>):<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="gps_passthrough" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
==== Rotorcraft Airframes ====<br />
<br />
The motor mixing has been updated and renamed:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
- <section name="SUPERVISION" prefix="SUPERVISION_"><br />
+ <section name="MIXING" prefix="MOTOR_MIXING_"><br />
...<br />
</section><br />
</source><br />
}}<br />
<br />
* servos need a driver <servos driver="Asctec"><br />
<command_laws><br />
<call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/><br />
<set servo="FRONT" value="motor_mixing.commands[SERVO_FRONT]"/><br />
<set servo="BACK" value="motor_mixing.commands[SERVO_BACK]"/><br />
<set servo="RIGHT" value="motor_mixing.commands[SERVO_RIGHT]"/><br />
<set servo="LEFT" value="motor_mixing.commands[SERVO_LEFT]"/><br />
</command_laws><br />
<br />
- <define name="TRIM_A" value="0"/><br />
- <define name="TRIM_E" value="0"/><br />
- <define name="TRIM_R" value="0"/><br />
+ <define name="TRIM_ROLL" value="0"/><br />
+ <define name="TRIM_PITCH" value="0"/><br />
+ <define name="TRIM_YAW" value="0"/><br />
<br />
- <define name="MIN_MOTOR" value="3"/> replaced by min value in servo<br />
- <define name="MAX_MOTOR" value="200"/> replaced by neutral value in servo<br />
<br />
* an INS subsystem is now compulsory<br />
<br />
=== Advanced Code and Makefile ===<br />
<br />
==== Board Makefiles ====<br />
<br />
In any <tt>conf/boards/''board_name''.makefile</tt>:<br />
* add <tt>$(TARGET).LDSCRIPT</tt><br />
* <tt>'''?='''</tt> can replace <tt>ifndef</tt> statements or <tt>=</tt> statements to allow overrides<br />
* add a default actuator configuration (can be overridden by a configure option in the firmware section)<br />
** <tt>ACTUATORS ?= actuators_pwm</tt><br />
<br />
==== Board Header Files ====<br />
In all <tt>sw/airborne/boards/'board_name''.h</tt>:<br />
* add EXT_CLK<br />
* change to libopencm3<br />
* Default actuator driver<br />
* ADC_CHANNEL_X -> X</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Main_Page&diff=15485
Main Page
2013-07-13T21:53:37Z
<p>Scdwyer: Add link in v5 news post to Release Upgrades page</p>
<hr />
<div>__NOTOC__<br />
__NOEDITSECTION__<br />
<br />
{|style="border-spacing:8px;margin:0px -8px" class="MainPageBG" style="width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;"<br />
|-<br />
|align="center" colspan="2"| <h2 style="margin:0;background-color:#82add9;font-size:150%;font-weight:bold;border:0px solid #a3bfb1;text-align:center;color:#ffffff;padding:0.2em 0.4em;">Welcome To Paparazzi</h2><br />
<br />
|-valign="top"<br />
|<br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[General|General]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{General}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Hardware|Hardware]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Hardware}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em; <br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Software|Software]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Software}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Miscellaneous|Miscellaneous]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Miscellaneous}}<br />
</div><br />
<!-- Start of right-column --><br />
| class="MainPageBG" style="width:70%;border:1px solid #cedff2;background-color:#f5faff;vertical-align:top"|<br />
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#f5fffa"<br />
|-<br />
|align="center" colspan="2" background-color=#82add9 | {{Hotbar}}<br />
|-valign="top"<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">The Paparazzi Project</h2><br />
|-<br />
|style="color:#000"|'''Paparazzi''' is a free and open-source hardware and software project intended to create an exceptionally powerful and versatile autopilot system for fixedwing aircrafts as well as multicopters by allowing and encouraging input from the community. The project includes not only the airborne hardware and software, from voltage regulators and GPS receivers to [http://en.wikipedia.org/wiki/Kalman_filtering Kalman filtering] code, but also a powerful and ever-expanding array of ground hardware and software including modems, antennas, and a highly evolved user-friendly ground control software interface.<br />
|-<br />
|All hardware and software is open-source and freely available to anyone under the [http://www.gnu.org GNU] licencing agreement. [[Get_Hardware| Several vendors]] are currently producing and selling Paparazzi autopilots and popular accessories, making the system easy and affordable to all.<br />
|-<br />
|The key feature of the paparazzi autopilot is its unique combination of inertial measurement and/or infrared thermopiles for attitude sensing, providing a robust and accurate attitude estimate that requires no ground calibration and can recover from any launch attitude.<br />
|-<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">The Paparazzi project at ENAC</h2><br />
|-<br />
|The Paparazzi [http://en.wikipedia.org/wiki/Unmanned_Aircraft_System UAS] project is now being used and developed at [http://www.enac.fr/ ENAC University] and the MAVlab of the TU-Delft.<br />
|-<br />
|style="color:#000"|<br />
* [http://paparazzi.enac.fr/debian/ Debian repository] and [https://launchpad.net/~paparazzi-uav/+archive/ppa Ubuntu repository] containing some packages not in the official distribution and required to run Paparazzi.<br />
|-<br />
| <h2 style="margin:0;background-color:#ff9b00;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">Legal disclaimer</h2><br />
|-<br />
|The Paparazzi software and hardware are distributed without any guarantee, in particular they are not certified by any national or international authorities. Before flying, please refer to your country national aviation regulation for Unmanned Aerial Systems, or the one of the country you intend to overfly.<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#ebf5ff;border:1px solid #9dcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#6daef2;font-size:120%;font-weight:bold;border:1px solid #8fa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">Latest stable release</h2><br />
|-<br />
|<h3>v5.0.0_stable</h3><br />
|-<br />
|Download as [http://paparazzi.enac.fr/tarballs/paparazzi_v5.0.0_stable.tar.gz tarball] or checkout the '''v5.0''' branch from [[git]].<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#ebf5ff;border:1px solid #9dcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#9dcef2;font-size:120%;font-weight:bold;border:1px solid #8fa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">Upcoming</h2><br />
<br />
|-<br />
|<h3>September 17-20th, 2013</h3><br />
|-<br />
|<br />
<br />
[[Image:imav2013.png|600px]]<br />
<br />
The [http://www.imav2013.org International Conference and Competition on Micro Air Vehicle] will be held at ENAC (Toulouse, France) in September 2013.<br />
<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#faf5ff;border:1px solid #ddcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">News</h2><br />
<br />
|-<br />
|<h3>June 17th, 2013</h3><br />
|-<br />
|[[Image:Penguin.gif|thumb|left]]<br />
<br />
<span style="color:red">'''NEW RELEASE!'''</span><br />
<br />
For the opening of the Paris Air Show at Le Bourget, the Paparazzi Development Team is pleased to announce the release of the '''Paparazzi v5.0 stable''' version, including the support of the [http://ardrone2.parrot.com/ Parrot AR.Drone2]. See this [[AR_Drone_2/getting_started|page]] for more instructions.<br />
<br />
See the [https://github.com/paparazzi/paparazzi/blob/v5.0/CHANGELOG.md changelog] for an overview of new features and bugfixes.<br />
<br />
See the [[Release Upgrades]] page for hints on configuration changes that may be required if you are moving to v5.0.0 from v4.2.0.<br />
<br />
If you are already using paparazzi with [[Git]], you can switch to this new branch with<br />
<br />
'''<code>git remote update && git checkout v5.0</code>'''.<br />
<br />
For new user, you can download a [http://paparazzi.enac.fr/tarballs/paparazzi_v5.0.0_stable.tar.gz tarball] or get the source code with<br />
<br />
'''<code>git clone https://github.com/paparazzi/paparazzi.git && git checkout -b v5.0 origin/v5.0</code>'''.<br />
<br />
|-<br />
|<h3>January 22nd, 2013</h3><br />
|-<br />
<br />
|[[Image:Parrot_AR_Drone_2_TUDelft_Paparazzi.jpg|thumb|left|Paparazzi on the Parrot AR Drone 2]]<br />
<br />
<span style="color:red">'''Parrot AR Drone flies autonomous'''</span><br />
<br />
At the [http://www.tudelft.nl/en/ TU Delft university of technology] student teams made the impossible; possible. Now you can turn your AR Drone v2 into an autonomous drone, '''controlled by Paparazzi autopilot''' software. It's simple, Insert GPS receiver into USB port, build and upload your flightplan via WiFi, and you are done! No hardware modification needed.<br />
<br />
[[AR_Drone_2/getting_started|Detailed instructions to get your own drone fly with a Paparazzi autopilot brain can be found '''by following this link''']]<br />
<br />
...and remember, it is a Wiki, you are invited to improve the contents, as a matter of fact, we would love it!<br />
<br />
|-<br />
|<h3>December 12th, 2012</h3><br />
|-<br />
|[[Image:penguin_logo.gif|thumb|left|Paparazzi<br>The Free Autopilot<br>v4.2 released]]<br />
<br />
<span style="color:red">'''NEW RELEASE!'''</span><br />
<br />
Just before the end of the world, discover '''Paparazzi v4.2.0 stable''' version.<br />
<br />
Based on the last stable branch '''v4.0''', this new release offer several improvements, especially the [http://paparazzi.github.com/docs/latest/energy__ctrl_8c.html#details total energy control] developed by TUDelft. See the [https://github.com/paparazzi/paparazzi/blob/v4.2/CHANGELOG.md changelog] for an overview of new features and bugfixes.<br />
<br />
If you are already using paparazzi with [[Git]], you can switch to this new branch with<br />
<br />
'''<code>git remote update && git checkout v4.2</code>'''.<br />
<br />
For new user, it will be the default branch when getting the [[Installation#Getting_the_Source_Code|source code from Github]]. You can also download a [https://github.com/paparazzi/paparazzi/tarball/v4.2.0_stable tarball] or [https://github.com/paparazzi/paparazzi/zipball/v4.2.0_stable Zip file] of the <tt>v4.2.0_stable</tt> source code.<br />
<br />
|-<br />
|<h3>July 26th, 2012</h3><br />
|-<br />
|[[Image:Dc20-logo_smsq.png|thumb|left|DefCon 20]]<br />
<br />
Paparazzi was at the [https://www.defcon.org/html/defcon-20/dc-20-index.html DefCon 20] conference in Las Vegas, USA from July 26th - 29th 2012 and [http://www.defcon.org/html/links/dc-archives/dc-20-archive.html#Esden presented] the project.<br />
<br />
|-<br />
|<h3>July 26th, 2012</h3><br />
|-<br />
|[[Image:penguin_logo.gif|thumb|left|Paparazzi<br>The Free Autopilot]]<br />
<br />
<span style="color:red">'''NEW RELEASE!'''</span><br />
<br />
The Paparazzi Development Team is pleased to announce the release of the '''Paparazzi v4.0 stable''' version.<br />
<br />
After several months of testing and debugging, the [[RepositoryStructure|release preparation branch v3.9]] has been released as v4.0. See the [https://github.com/paparazzi/paparazzi/blob/v4.0/CHANGELOG.md changelog] for an overview of new features and bugfixes.<br />
<br />
If you are already using paparazzi with [[Git]], you can switch to this new branch with<br />
<br />
'''<code>git remote update && git checkout v4.0</code>'''.<br />
<br />
For new user, it will be the default branch when getting the [[Installation#Getting_the_Source_Code|source code from Github]]. You can also download a [https://github.com/paparazzi/paparazzi/tarball/v4.0_stable tarball] or [https://github.com/paparazzi/paparazzi/zipball/v4.0_stable Zip file] of the <tt>v4.0_stable</tt> source code.<br />
<br />
|-<br />
|<h3>July 2-6th, 2012</h3><br />
|-<br />
|[[Image:Blender_at_IMAV2012.JPG|thumb|left|Blender: 312mm / 340g]]<br />
<br />
'''Blender''', the small but deserving quadrotor of ENAC Paparazzi Team took the 1st place in "Outdoor autonomy" and 3rd place in "Outdoor dynamics" during [http://www.imav2012.org/ IMAV2012] competition in Braunschweig (Germany). Completing its missions with overflowing enthusiasm thanks to the new [[NavGo_v3|'''NavGo''']] autopilot. NavGo is the latest in the long line of award winning Paparazzi hardware available. See the list of Paparazzi hardware [[Autopilots |here]].<br />
<br />
<br />
|-<br />
|<h3>July 6th, 2012</h3><br />
|-<br />
|[[Image:Atmos.png|thumb|left|[ATMOS|http://www.teamatmos.nl/]]]<br />
<br />
<br />
'''[http://www.teamatmos.nl/ ATMOS]''', a hybrid [http://www.teamatmos.nl/video airplane-quadrotor] developed at the MAVlab of TU-Delft, was awarded third place (out of 140) in the [http://www.uavforge.net/ UAVForge] Competition. There were more than 140 initial [http://www.uavforge.net/uavhtml/milestones.php contestants] and after several selection rounds with only 12 finalists, the paparazzi [[Lisa/M]] powered [http://www.teamatmos.nl/ ATMOS] was one of the few that could actually make it to the remote target site miles away in an RF unfriendly environment. No team fully completed the baseline objectives which is why no prices were issued. The vertical takeoff and landing, together with long range thanks to the wing and flexibility thanks to opensource paparazzi were key factors in this event [http://www.youtube.com/watch?v=81NvfLFzhqQ]. <br />
<br />
But probably more important, the development of [http://www.teamatmos.nl/ ATMOS] has added a new [https://github.com/tudelft/paparazzi/tree/atmos-master4-flyoff code-base] to paparazzi to enable the control of any hybrid [https://github.com/tudelft/paparazzi/blob/atmos-master4-flyoff/sw/airborne/firmwares/rotorcraft/force_allocation_laws.c multi-lifting] device vehicle. ATMOS can take-off vertically as a quadrotor, transition to full forward flight as an airplane but also fly in any intermediate transition stage fully autonomously. So let your imagination go loose!<br />
<br />
|-<br />
|<h3>May 9th, 2012</h3><br />
|-<br />
|[[Image:Git-Logo-2Color.png|thumb|left|[[RepositoryStructure|New git branching model]]]]<br />
<br />
'''In order to improve the development workflow and provide stable releases we have changed our git branching model.'''<br />
<br />
<span style="color:red">'''The branch "master" is now our development branch.'''</span><br />
<br />
* The "dev" branch was renamed to the release preparation branch "v3.9". Switch to this branch if you want stable code.<br />
* "master" was reset to the previous "locm3" branch, where development will happen now with libopencm3 for the STM32 architecture.<br />
<br />
Please see the [[RepositoryStructure]] page for more details.<br />
<br />
As soon as we are ready to release v4.0 the will be tarballs available if you don't want to use [[Git]].<br />
<br />
|-<br />
|<h3>May 8th, 2012</h3><br />
|-<br />
|[[Image:Youtube.png|thumb|left|[http://www.youtube.com/playlist?list=PL91197EBE66E78E38 link to youtube video collection]]]<br />
<br />
A lot of cool stuff is done with paparazzi driven UAV`s<br />
To share the world what the paparazzi community is doing a [http://www.youtube.com/playlist?list=PL91197EBE66E78E38 youtube video play list] generated. If you want your video in there send a youtube link to the mailing list.<br />
<br />
|-<br />
|<h3>April 9th, 2012</h3><br />
|-<br />
|[[Image:Mini-Horus_Launch_in_Mada.jpg|thumb|left|Take off in Madagascar]]<br />
<br />
In March 2012, Paparazzi flew in southern Madagascar in the frame of a multi-university project to study and improve the ecosystem in one of the poorest regions of the world ([http://www.sulama.de Project]). More than 4000 hectares of farm and grassland were photographed in visible and near infrared spectra. More than 8500 photos were taken. Surely one of the biggest missions for science ever flown with Paparazzi.<br />
<br />
|-<br />
|<h3>March 7th, 2012</h3><br />
|-<br />
|[[Image:Sumo_launch.jpg|thumb|left|Take off in Antarctica]]<br />
<br />
In the Antarctic summer of 2011/2012 two teams flew Paparazzi-driven UAS on the southernmost continent. The University of Bergen flew at the Norwegian Troll station ([http://www.youtube.com/watch?v=0T9fyCNLllI video]) and the University of Colorado near the US McMurdo station ([http://dl.dropbox.com/u/53700947/Antarctic_blog/blog_20120124.htm blog], [http://alices-wonderland-adventures.blogspot.com/2012/01/uav-flights-take-2.html blog]). They measured temperature, humidity, pressure, infrared radiation and wind with a Multiplex Funjet plane.<br />
<br />
|-<br />
|<h3>December 26th, 2011</h3><br />
|-<br />
|[[Image:28C3_logo.png|thumb|left|Paparazzi at 28C3]]<br />
<br />
We had a table at the [http://events.ccc.de/congress/2011/wiki/Welcome 28C3] conference.<br />
<br />
|-<br />
|<h3>December 25th, 2011</h3><br />
|-<br />
|[[Image:Cre187-paparazzi.png|thumb|left|CRE187 - Paparazzi]]<br />
<br />
Martin Müller gave a great interview about the history and the inner workings of Paparazzi on [http://cre.fm/cre187 CRE Podcast].<br />
<br />
|-<br />
|<h3>October 5th, 2011</h3><br />
|-<br />
|[[Image:Umarim_v1-0_bottom_side.jpg|thumb|left|Umarim v1.0]]<br />
<br />
ENAC Team [http://paparazzi.enac.fr/wiki/Umarim_v10 Umarim V1.0 autopilot] is now released: LPC based, on-board IMU & barometer, narrow fuselage form factor (56x25mm) and lightweight (9gr) are its main features. Add your favorite GPS receiver and it will fit in your stupidly thin light UAV prototype. But it will also do the job for a big fat one. [http://paparazzi.enac.fr/wiki/Umarim_v10 More info here...]<br />
<br />
|-<br />
|<h3>September 18th, 2011</h3><br />
|-<br />
|[[Image:enac_imav11_1.jpg|thumb|left|IMAV 2011 Outdoor Competition ]]<br />
<br />
This year [http://www.imav2011.org/ IMAV 2011] went really well for all of the participants, we have seen lots of successful flights. ENAC Paparazzi Team took the 2nd place in general "Outdoor Challenge" and [http://paparazzi.enac.fr/wiki/Fire-Storm Fire Storm] demonstrated 105+ minutes of flight and took the "Best Outdoor Endurance Award". He was waiting this day for 2 years since the cancelation of IMAV09. <br />
As an additional information, Fire Storm flew its endurance mission with the new [http://paparazzi.enac.fr/wiki/Umarim_v10 Umarim V1.0] autopilot board which will be released soon.<br />
<br />
|-<br />
|<h3>August 31st, 2011</h3><br />
|-<br />
|[[Image:Quadshot_picture.jpg|thumb|left|The Quadshot]]<br />
<br />
Paparazzi is used in the [http://thequadshot.com Quadshot]: A blend between a quadrocopter and a flying wing. The Quadshot and Paparazzi are also featured in an [http://revision3.com/hak5/backtothestudio episode of Hak5]. You can also skip directly to the [http://www.youtube.com/watch?v=YeP7MMnP33g interview with Piotr] talking about how Paparazzi is used in the Quadshot, and briefly [http://www.youtube.com/watch?v=ANPX3UwRMnw explains the XML airframe file and the GCS].<br />
<br />
|-<br />
|<h3>February 15th, 2011</h3><br />
|-<br />
|[[Image:Finnarp.jpg|thumb|left|Paparazzi in Antarctica]]<br />
<br />
Paparazzi has flown on the southernmost continent: Antarctica. Scientists from the [http://en.ilmatieteenlaitos.fi/press-release/127535 Finnish Meteorological Institute] took three modified Funjets to the Finnish Aboa station and brought them back safely after more than 25 flights. They measured temperature, humidity, pressure, wind direction and speed in altitudes up to 1000m.<br />
<br />
|-<br />
|<h3>February 10th, 2011</h3><br />
|-<br />
|[[Image:ScreenShot.jpg|thumb|left|Paparazzi on OS X]]<br />
<br />
Paparazzi now on OS X. Thanks to the tireless efforts of Eric and Bernard we can all run [http://paparazzi.enac.fr/wiki/InstallationMacOSX Paparazzi on OS X]. Stay tuned Windows fans. Paparazzi on Windows is coming soon.<br />
<br />
|-<br />
|<h3>November 26th, 2010</h3><br />
|-<br />
|[[Image:Wingdrop.png|thumb|left|[http://www.youtube.com/watch?v=TFrognLZ2Ak wingdrop]]]<br />
<br />
There is a [http://www.youtube.com/watch?v=TFrognLZ2Ak video] available that shows how Paparazzis adaptive control loops keep a Twinstar in the air that drops 30% of its right wing with 50% of the aileron and then also switches the right engine off. Another [http://www.youtube.com/watch?v=N0H9xWckeYQ video] shows a Paparazzi quadcopter using adaptive control to stay level after dropping 50% of its total weight.<br />
<br />
|-<br />
<br />
|-<br />
|<h3>November 19th, 2010</h3><br />
|-<br />
|[[Image:Github.png|thumb|left|[[Git]]]]<br />
'''WE MOVED TO GIT!'''<br />
<br />
The paparazzi software repository now has a new happy life on github:<br />
<br />
'''https://github.com/paparazzi/paparazzi'''<br />
<br />
We believe the switch from Subversion to the fast [http://git-scm.com/ git] version control system will make development easier, faster and more fun. It also makes it easier for YOU to contribute. You can easily fork paparazzi on github, commit your bugfixes and new features and send us a pull request.<br />
<br />
More info on how to get the paparazzi code from github can be found [[Git|here]].<br />
<br />
We also want to encourage you to submit bugs or feature requests on the simple [https://github.com/paparazzi/paparazzi/issues github issue tracker].<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
|<h3>August, 2010</h3><br />
|-<br />
|[[Image:OrganizedCode.png|thumb|left|[[User/AirborneCodeReorg|Code Reorganization]]]]<br />
After many years of development, so many new autopilot boards and aircraft types have been added that a [http://en.wikipedia.org/wiki/Source_code sourcecode] reorganization was needed. This undertaking is started and will simplify the continuous evolution of the project.<br />
<br />
To benefit from these important changes, it only requires you to update your airframe configuration document once. After you have updated, you should not notice the significant reorganization that is going on behind the scenes. This change will benefit your aircrafts flying successfully for the years to come. The required changes are described on [[User/AirborneCodeReorg| Update Your Airframe Configuration]]. <br />
<br />
At this point several developments are blocked because of this. Therefor we kindly request you to upgrade your airframe configuration documents as soon as possible and thank you in advance for doing so.<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
|<h3>May 22th, 2010</h3><br />
|-<br />
|[[Image:PascalTPS.jpg|thumb|left|[[Hecto| Pascal Brisset]]]]<br />
Pascal Brisset, also known as Hecto, and the father of the Paparazzi project died in an accident while climbing in the Pyrénées mountains in the south of France.<br />
He had dedicated the last seven years of his life to the success of the project. He was taking care by himself of a huge part of the project. To name only a few : development and maintenance of the entire ground segment, navigation and flight plan algorithms, code generation and build system, distribution packaging, server infrastructure...<br />
<br />
To express your grief, you may want to [[Hecto| leave a note on his wiki page]]<br />
<br />
In respect for his commitment, the Paparazzi project must go on and volunteers wanting to take over tasks are hereby asked to do so.<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
<br />
|<h3>February 19th, 2010</h3><br />
|-<br />
|[[Image:Adler_c.jpg|thumb|left|[[Adler_Uni_Stuttgart| The 'Stuttgarter Adler']]]]<br />
The [http://www.irs.uni-stuttgart.de Institute of space systems] of [http://www.uni-stuttgart.de/index.en.html University of Stuttgart] is using the paparazzi system for large remote sensing aircrafts.<br> <br />
The missions include basic research and environmental monitoring. Payloads of up to 7kg are carried.<br><br><br />
More information can be found on the [[Adler_Uni_Stuttgart|Wiki page]].<br />
|<br />
|-<br />
<br />
<br />
|-<br />
<br />
<br />
|-<br />
|<h3>[[News Archives]]</h3><br />
|-<br />
| style="color:#000"|<br />
[[Image:One_Small_Step.jpg|thumb|left|[[News Archives]]]] [[News Archives|Browse the archives]] for a look back at the earlier days of Paparazzi.<br />
|-<br />
<br />
|}<br />
|}</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Release_Upgrades&diff=15484
Release Upgrades
2013-07-13T21:47:24Z
<p>Scdwyer: Updated for v5.0.0_stable changes to use state interface in a number of variables useful in flightplans</p>
<hr />
<div>The latest stable release is: '''v5.0.0_stable'''<br />
<br />
This page is help guide any software configuration changes in airframe files or configuration files, as well as provides hints around any behaviour or workflow changes.<br />
<br />
In any codeblocks, a leading '''-''' indicates one should remove the line, while a leading '''+''' indicates one should add the line. In other cases, only names have changed.<br />
<br />
DISCLAIMER: This page is by no means guaranteed to be complete. If you find another required change that was missed, please add it!<br />
<br />
== Upgrading from v4.2.0_stable to v5.0.0_stable ==<br />
<br />
Changelog for this release on GitHub: [https://github.com/paparazzi/paparazzi/blob/v5.0/CHANGELOG.md changelog]<br />
<br />
=== Control Panel ===<br />
<br />
A '''new simulator launcher''' has been added to better select between the different types of simulator (OCAML fixed-wing, JSBSim fixed-wing, NPS, etc). The launcher path must be changed to support this:<br />
{{Box Code|conf/controlpanel.xml|<br />
<source lang="xml"><br />
- <program name="Simulator" command="sw/simulator/launchsitl"><br />
+ <program name="Simulator" command="sw/simulator/pprzsim-launch"><br />
</source><br />
}}<br />
<br />
=== Flightplans ===<br />
<br />
The adoption of the '''state interface''' means a number of functions and variables previously used in the flightplans are no longer valid, and must be replaced by their equivalent:<br />
<br />
* <tt>'''GpsPosAlt()'''</tt> replaces <tt>'''estimator_z'''</tt><br />
* <tt>'''GpsPosX()'''</tt> replaces <tt>'''estimator_x'''</tt><br />
* <tt>'''GpsPosY()'''</tt> replaces <tt>'''estimator_y'''</tt><br />
* <tt>'''autopilot_flight_time'''</tt> replaces <tt>'''estimator_flight_time'''</tt><br />
<br />
Advanced flightplans will likely require additional changes.<br />
<br />
=== Airframes ===<br />
<br />
A number of changes to clarify names and clean up subsystems and modules means airframe files must be updated:<br />
<br />
==== All Airframes ====<br />
<br />
* <tt>'''CONTROL_FREQUENCY'''</tt> replaces <tt>'''CONTROL_RATE'''</tt><br />
<br />
==== Fixedwing Airframes ====<br />
<br />
The altitude/climb estimator has been cleaned up.<br />
<br />
Change the way the altitude kalman filter is enabled:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="MISC"><br />
...<br />
+ <define name="ALT_KALMAN_ENABLED" value="TRUE"/> <!-- can also be set to FALSE (default if not present) --><br />
</section><br />
<br />
<firmware name="fixedwing"><br />
...<br />
- <define name="ALT_KALMAN"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
Add the altitude INS subsystem if there is an <tt>ALT_KALMAN_ENABLED</tt> define or if you use a barometer:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="alt_float" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
'''Alternatively''', use the <tt>gps_passthrough</tt> subsystem to use direct GPS data (remove all <tt>ALT_KALMAN_ENABLED</tt>):<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="gps_passthrough" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
==== Rotorcraft Airframes ====<br />
<br />
The motor mixing has been updated and renamed:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
- <section name="SUPERVISION" prefix="SUPERVISION_"><br />
+ <section name="MIXING" prefix="MOTOR_MIXING_"><br />
...<br />
</section><br />
</source><br />
}}<br />
<br />
* servos need a driver <servos driver="Asctec"><br />
<command_laws><br />
<call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/><br />
<set servo="FRONT" value="motor_mixing.commands[SERVO_FRONT]"/><br />
<set servo="BACK" value="motor_mixing.commands[SERVO_BACK]"/><br />
<set servo="RIGHT" value="motor_mixing.commands[SERVO_RIGHT]"/><br />
<set servo="LEFT" value="motor_mixing.commands[SERVO_LEFT]"/><br />
</command_laws><br />
<br />
- <define name="TRIM_A" value="0"/><br />
- <define name="TRIM_E" value="0"/><br />
- <define name="TRIM_R" value="0"/><br />
+ <define name="TRIM_ROLL" value="0"/><br />
+ <define name="TRIM_PITCH" value="0"/><br />
+ <define name="TRIM_YAW" value="0"/><br />
<br />
- <define name="MIN_MOTOR" value="3"/> replaced by min value in servo<br />
- <define name="MAX_MOTOR" value="200"/> replaced by neutral value in servo<br />
<br />
* an INS subsystem is now compulsory<br />
<br />
=== Advanced Code and Makefile ===<br />
<br />
==== Board Makefiles ====<br />
<br />
In any <tt>conf/boards/''board_name''.makefile</tt>:<br />
* add <tt>$(TARGET).LDSCRIPT</tt><br />
* <tt>'''?='''</tt> can replace <tt>ifndef</tt> statements or <tt>=</tt> statements to allow overrides<br />
* add a default actuator configuration (can be overridden by a configure option in the firmware section)<br />
** <tt>ACTUATORS ?= actuators_pwm</tt><br />
<br />
==== Board Header Files ====<br />
In all <tt>sw/airborne/boards/'board_name''.h</tt>:<br />
* add EXT_CLK<br />
* change to libopencm3<br />
* Default actuator driver<br />
* ADC_CHANNEL_X -> X</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Flight_Plan_Examples&diff=15483
Flight Plan Examples
2013-07-13T21:44:49Z
<p>Scdwyer: Updated for v5.0.0_stable changes to use state interface in a number of variables useful in flightplans</p>
<hr />
<div>This page will detail a number of flight plan examples.<br />
<br />
== Takeoff ==<br />
<br />
The block of code:<br />
<br />
<block key="t" name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png"><br />
<set value="0" var="kill_throttle"/><br />
<set value="0" var="autopilot_flight_time"/><br />
<go from="START" pitch="-10" throttle="1.0" vmode="throttle" wp="ER"/><br />
</block><br />
<br />
Below is an explanation of the code - left to right, top to bottom.<br />
<br />
key accelerator to select the block with the keyboard (press t for takeoff)<br />
key="t"<br />
<br />
the name of the block<br />
name="Takeoff"<br />
<br />
This shows as the name when you hover your mouse over the button<br />
strip_button="Takeoff"<br />
<br />
The name of the icon picture shown in the GCS<br />
strip_icon="takeoff.png"<br />
<br />
This turns on the option to change the throttle<br />
<set value="0" var="kill_throttle"/> <br />
<br />
This turns on the flight time estimator<br />
<set value="0" var="autopilot_flight_time"/><br />
<br />
<br />
<go from="START" pitch="-10" throttle="1.0" vmode="throttle" wp="ER"/><br />
<br />
This says for the aircraft to go from "START" waypoint towards "ER" (end runway) waypoint with a pitch angle setpoint of -10&nbsp;degrees (to keep the aircraft on the ground) and throttle at 100%.<br />
You would also add a deroute option to change to the "CLIMB" waypoint (the waypoint that gets the aircraft up to the correct height) once the aircraft was moving above stall speed. I will add the code for this soon. <br />
<br />
vmode="throttle" switches the vertical control into autothrottle mode; possible other values are climb, alt, xyz, or glide.<br />
<br />
This code will work in theory, but may not in practice, especially if you only have a narrow runway or your aircraft takes a long time to get up to speed. This is because the autopilot is not exact in its estimation of where it is.<br />
<br />
== Surveying an area ==<br />
<br />
There are two types of survey, two waypoint survey or Polysurvey. PolySurvey can be called multiple times during a flight plan but I am not sure how to do this (SOMEONE PLEASE UPDATE).<br />
<br />
<block name="Initialize Poly Survey"><br />
<call fun="InitializePolygonSurvey(WP_S1, 5, 150, 45)"/><br />
</block><br />
<br />
<block name="Run Poly Survey"><br />
<call fun="PolygonSurvey()"/><br />
</block><br />
<br />
You will notice that there are two blocks of code instead of a single block. This because when you are surveying an area you may want to stop the survey and take a closer look at something (for instance you may wish to circle something of interest). If you want to continue the survey from the point where you stopped to look closer at the thing of interest all you need to do is call the "Run Poly Survey" block.<br />
<br />
<call fun="InitializePolygonSurvey(WP_S1, 5, 150, 45)"/><br />
This initializes the PolySurvey starting with Waypoint S1 and using 5 waypoints (in sequence, eg S1, S2, S3, S4, S5), with a distance between each survey line of 150 meters and an angle of survey of 45 degrees from the initial waypoint.<br />
<br />
<call fun="PolygonSurvey()"/><br />
This calls the PolySurvey, you may want to call this either via a button on the GCS or by calling it in external code for example an automated IR sensor (if you are looking for a person).<br />
<br />
=== Mission Actions ===<br />
<br />
During the survey, polygonsurvey and the oval, mission actions can be triggered during the straight parts using the <br />
<br />
#define LINE_START_FUNCTION<br />
#define LINE_STOP_FUNCTION<br />
<br />
defines in the flight plan. One example would be to start taking pictures or even limit the maximal roll angle (be careful with the roll angle limit: if the aircraft does not follow the circle very well, it might still need to turn the first part of the line: make a button to restore max_roll in case of problems). At the top of the flight plan file you can define:<br />
<br />
<header><br />
#include "dc.h"<br />
#include "fw_h_ctl.h"<br />
#define LINE_START_FUNCTION {dc_shoot = 1; h_ctl_roll_max_setpoint = DEG2RAD(15);}<br />
#define LINE_STOP_FUNCTION {dc_shoot = 0; h_ctl_roll_max_setpoint = H_CTL_ROLL_MAX_SETPOINT;}<br />
</header><br />
<br />
== Landing your aircraft ==<br />
<br />
<block name="final"><br />
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/><br />
<go from="AF" hmode="route" vmode="glide" wp="TD"/><br />
</block><br />
<br />
Above is the final Block. This block is used to bring the aircraft towards the end of the runway (or landing area) which is the "AF".<br />
<br />
<go from="AF" hmode="route" vmode="glide" wp="TD"/><br />
Fly from waypoint "AF" to waypoint "TD" and glide between them to maintain the angle between them. You may want these two waypoints to be a significant distance between them if you want the aircraft to come in on a very shallow angle.<br />
<br />
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/><br />
"flare" is the deroute condition and it is implemented when the aircraft is 10 meters from the ground. <br />
<br />
<block name="flare"><br />
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/><br />
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/><br />
</block><br />
<br />
You would want the aircraft to flare just before hitting the ground. If your aircraft is not very stable at low speeds you may want to make the distance above ground lower.<br />
<br />
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/><br />
This lets the aircraft fly with roll controlled at neutral (0°) and throttle off.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=15482
Flight Plans
2013-07-13T21:43:18Z
<p>Scdwyer: Updated for v5.0.0_stable changes to use state interface in a number of variables useful in flightplans</p>
<hr />
<div>A '''flight plan''' is a XML document which one can create and store aboard an autopilot. The flight plan will describe how you want your aircraft to travel if released into into the wild blue yonder.<br />
<br />
== DTD and Structure ==<br />
<br />
The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<source lang="xml"><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></source><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans via the GUI.<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
'''A flight plan is composed of two mandatory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]]'''<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt>'''<flight_plan name lat0 lon0 ground_alt security_height home_mode_height qfu alt max_dist_from_home>'''</tt><br />
; <tt>'''name'''</tt>: the name of the mission (a text string)<br />
; <tt>'''lat0, lon0'''</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
; <tt>'''ground_alt'''</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
; <tt>'''security_height'''</tt>: the height (over <tt>'''ground_alt'''</tt>) used by the circle-home failsafe procedure and in other flight procedures such as formation flight and anti-collision avoidance. Warnings are produced if you place a waypoint lower than <tt>'''security_height'''</tt> (usually the case for the landing point)<br />
; <tt>'''home_mode_height'''</tt> (optional): this optional attribute available since v4.2 allows to override <tt>'''security_height'''</tt> as failsafe height in home mode. If <tt>'''home_mode_height'''</tt> is set lower than <tt>'''security_height'''</tt>, the later is used. This attribute is useful if you need to return home at a high altitude rather than a low altitude.<br />
; <tt>'''qfu'''</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft. So if you want to take off and climb to the West you would use qfu=270. <br />
; <tt>'''alt'''</tt>: the default altitude of waypoints ([[Altitude_definitions|Above Sea Level]]). So if your ground altitude is 400 then alt needs to be a value greater than ground altitude and above any obstructions in the flight plan. <br />
; <tt>'''max_dist_from_home'''</tt>: the maximum allowed distance (in meters) from the HOME waypoint. Exceeding this value will trigger an exception.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<source lang="xml"><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250" home_mode_height="150"><br />
</source><br />
<br />
Note that a flight plan could also contain optional <tt>include</tt>'s and <tt>exceptions</tt> cases.<br />
<br />
== Waypoints ==<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified by it's name and coordinates:<br />
<tt>''' <waypoint name wpx wpy [alt] [height]/> '''</tt><br />
where wpx and wpy are real positional coordinates ( <tt>'''lat/lon'''</tt> ) '''or''' UTM coordinates ( <tt>'''utm_x0/utm_y0'''</tt> ) '''or''' relative coordinates ( <tt>'''x/y'''</tt> ) in meters from your reference point {0,0} . <tt>alt</tt> and <tt>height</tt> are optional parameters and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> parameter of the flightplan. To set the waypoint altitude relative to the [[Altitude_definitions|ground altitude]] (<tt>ground_alt</tt>) of the flight plan for this waypoint, use the <tt>height</tt> attribute instead of <tt>alt</tt>.<br />
<br />
An example:<br />
<source lang="xml"><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="BRIDGEOVERRIVER" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="MyBarn" x="-130.0" y="217.5" alt="3000."/><br />
<waypoint name="3" x="-30.0" y="50" height="50."/><br />
<waypoint name="4" x="-30.0" y="50." alt="ground_alt + 50"/><br />
<waypoint name="_MYHELPERSPOT" x="-30.0" y="60" height="50."/><br />
<waypoint name="_MYOTHERHELPERSPOT" x="-70.0" y="90" height="70."/><br />
<waypoint name="TOWER" lat="48.858249" lon="2.294494" height="324."/><br />
<waypoint name="MountainCAFE" utm_x0="360284.8" utm_y0="4813595.5" alt="1965."/><br />
</waypoints><br />
</source><br />
<br />
'''Tips'''<br />
* Waypoints are easily adjusted with the [[Flight_Plan_Editor|flight plan editor]].<br />
* If a waypoint name starts with an underscore, the waypoint is '''not displayed''' in the GCS, except in editor mode.<br />
* The maximum number of waypoints is 254.<br />
* A waypoint named <tt>HOME</tt> is required if the failsafe HOME mode procedure is used.<br />
<br />
== Sectors ==<br />
<br />
Flat ''Sectors'' can be described as an area defined by list of waypoint corners. Such an area will be displayed in the Ground Control Station (GCS) by colored lines.<br />
A function is generated to check if a point, usually the aircraft itself, is ''inside'' this sector. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>. Note that sector names are not allowed to contain spaces. The generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS. It would be great if one would help improving that part of the source code.<br />
<br />
For example, with the following element in a flight plan.<br />
<source lang="xml"><br />
<sectors><br />
<sector name="MyCosySector" color="red"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</source><br />
<br />
It is then possible to write a exception. For example if the aircraft for some reason flies outside this sector the airframe will fly to a standby waypoint. The exclamation mark (!) means the boolean operator <tt>NOT</tt> in this example. In regular language one would describe "If my airframe is NOT inside the Murret sector anymore then deroute it to the standby waypoint." In Flightplan "Speak" this is written like: <br />
<source lang="xml"><br />
<exception cond="! InsideMyCosySector(GetPosX(), GetPosY())" deroute="standby"/><br />
</source><br />
<br />
'''Tips'''<br />
* A nice option in the corner notation is that one can add an underscore in front of the name; a corner or waypoint name that starts with an underscore is not displayed in the GCS. Only in editor mode it is visible. It is visible in editor mode, because if you the could not see it, it also would be not possible to edit or drag the corner or waypoint to another position.<br />
* The color of the sector is not fixed but can be defined by oneself if wished for via the color attribute.<br />
<br />
== Includes ==<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<source lang="xml"><br />
<includes><br />
<include name="landing" procedure="landing.xml"/><br />
</includes><br />
</source><br />
<br />
== Blocks ==<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot goes to the next one. The behaviour after the last stage of the last block is undefined. <br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<source lang="xml"><br />
<!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval|home|path)*><br />
</source><br />
<br />
Example:<br />
<source lang="xml"><br />
<block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block><br />
</source><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<source lang="xml"><br />
<block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
This button will activate the block. If the attribute <tt>group</tt> is specified, all strip buttons of the same group will be placed vertically on top of each other.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<source lang="xml"><br />
<block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<source lang="xml"><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></source><br />
<br />
You can call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
==== Expressions ====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
=== Initialization Blocks ===<br />
The first three blocks of flight plan are initialization blocks. <br />
<br />
The first block waits until the GPS fix has been established, as shown below.<br />
<source lang="xml"><br />
<blocks><br />
<block name="Wait GPS"><br />
<set value="1" var="kill_throttle"/><br />
<while cond="!GpsFixValid()"/><br />
</block><br />
</source><br />
The second block updates the local waypoints with respect to the UAV.<br />
<source lang="xml"><br />
<block name="Geo init"><br />
<while cond="LessThan(NavBlockTime(), 10)"/><br />
<call fun="NavSetGroundReferenceHere()"/><br />
</block><br />
</source><br />
This next block prevents the UAV from starting the engine and taking off. <br />
<source lang="xml"><br />
<block name="Holding point"><br />
<!--set var="nav_mode" value="NAV_MODE_ROLL"/--><br />
<set value="1" var="kill_throttle"/><br />
<attitude roll="0" throttle="0" vmode="throttle"/><br />
</block><br />
</source><br />
=== Exceptions ===<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<source lang="xml"><exception cond="..." deroute="..."></source><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<source lang="xml"><br />
<exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > GpsPosAlt())" deroute="go_up"/><br />
<exception cond="(autopilot_flight_time > 840)" deroute="quick_land"/><br />
</source><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<source lang="xml"><br />
<flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...<br />
</source><br />
<br />
=== Deroute ===<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<source lang="xml"><deroute block="landing"/></source><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
=== Loops ===<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<source lang="xml"><br />
<while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while><br />
</source><br />
In this example, we run an infinite loop, lettin the aircraft try to go via waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<source lang="xml"><br />
<for var="i" from="0" to="3"><br />
...<br />
</for><br />
</source><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<source lang="xml"><br />
<for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for><br />
</source><br />
<br />
In this example, the aircraft will circle around waypoint '''HOME''' for 10 seconds at and altitude above ground of 50m, 10 seconds at altitude 100 meter (50+50), ... until 250m (5x +50).<br />
<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
=== Navigation modes ===<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* path : list of waypoints linked by ''go''<br />
* circle : circle around a waypoint;<br />
* oval : two half circles with a straight between two nav points<br />
* eight : fly a figure of eight through a waypoint and around another<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
=== Attitude ===<br />
<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<source lang="xml"><attitude roll="0" vmode="throttle", throttle="0.5"/></source><br />
<br />
To fly around, holding a given altitude:<br />
<source lang="xml"><attitude roll="30" alt="ground_alt+50"/></source><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
=== Heading ===<br />
<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<source lang="xml"><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(GpsPosAlt() > ground_alt+30)"/></source><br />
<br />
=== Go ===<br />
<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<source lang="xml"><go wp="HOME"/></source><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route"/></source><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<source lang="xml"><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></source><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></source><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></source><br />
<br />
=== Path ===<br />
<br />
The <tt>path</tt> primitive is just a shorthand expression for a set of <tt>go</tt> primitives. A list of waypoints defined with the <tt>wpts</tt> attribute is pre-processed into a set of <tt>go</tt> primitives with the <tt>hmode</tt> attribute. For example:<br />
<source lang="xml"><path wpts="wp1, wp2, wp3"/></source><br />
<br />
Other attributes are optional:<br />
<source lang="xml"><path wpts="wp3, w1, wp2" approaching_time="1" pitch="auto" throttle="0.5"/></source><br />
<br />
=== Circle ===<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<source lang="xml"><circle wp="HOME" radius="75"/></source><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<source lang="xml"><circle wp="wp1" radius="50+(GpsPosAlt()-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></source><br />
<br />
=== Oval ===<br />
The oval consists of two half circles that are connected with two straight lines. This flight path is usefull when a IMU is used because the straights allow for level flight. <br />
<source lang="xml"> <oval p1="1" p2="2" radius="nav_radius"/> </source><br />
<br />
=== Eight ===<br />
Fly a figure of eight that consists of two straight legs that pass though the center and the center of the half circle at the end of the two legs is in the turn around waypoint. The altitude of the center waypoint is used for the entire figure. The turn around waypoint is moved to match radius given. <br />
<source lang="xml"> <eight center="1" radius="nav_radius" turn_around="2"/> </source><br />
<br />
=== Follow ===<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<source lang="xml"><follow ac_id="4" distance="50" height="20"/></source><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
=== Stay ===<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<source lang="xml"><stay wp="HOME" alt="10"/></source><br />
<br />
=== XYZ ===<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<source lang="xml"><xyz radius="40"/></source><br />
<br />
=== Set ===<br />
<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<source lang="xml"><set var="ground_alt" value="ground_alt+50"/></source><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
=== Call ===<br />
<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<source lang="xml"><br />
<call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/><br />
</source><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<source lang="xml"><br />
<header><br />
#include "nav_line.h"<br />
</header><br />
</source><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
You can also call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<source lang="xml"><br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
</source><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<source lang="xml"><br />
<set var="h_ctl_disabled" value="TRUE"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="FALSE"/><br />
</source><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<source lang="xml"><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></source><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<source lang="xml"><br />
<param name="alt"/><br />
<param name="radius" default_value="75"/><br />
</source><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<source lang="xml"><include name="landing" procedure="landing.xml"/></source><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<source lang="xml"><br />
<!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(GpsPosAlt()- WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</procedure><br />
</source><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<source lang="xml"><deroute block="landing.land"/></source><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<source lang="xml"><exception cond="..." deroute="go-around"/></source><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<source lang="xml"><br />
<include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include><br />
</source><br />
<br />
== Tips and Tricks ==<br />
<br />
There are many ways to skin a cat just as there are many ways to craft your flight plan. Following the best practices tips can save you from a lot of frustration and mishap.<br />
<br />
* Simulate your flight plan before taking it to the sky. Flight plans should always be carefully tested prior to flight, take a look at the [[Simulation|simulation]] page for details on how to simulate your plan.<br />
* Make an subdirectory in the Flight_plan directory with your own name and add your flight plans there. Make sure that the location of the DTD is correct, e.g by using relative directory double dots as in <tt><!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd"></tt><br />
<br />
* Take a good look at other flight plans included with Paparazzi. To learn from example flight plans please visit the [[Flight_Plan_Examples|flight plan examples]] page<br />
* There are several option to build failsafe features into you flightplan, [[Failsafe|for some examples visit the Failsafe page]].<br />
* Some flight plan examples define waypoint locations using relative coordinates. These are relative positions from the fixed lat and lon in the header of the flight plan. When simulating your flight plan the aircraft always use the lat/lon as defined in the flight plan since a regular simulation has no notion of you current position of you local PC where you simulate on. This is something to keep in mind if you test your flight plan in real flights.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Release_Upgrades&diff=15481
Release Upgrades
2013-07-13T21:32:13Z
<p>Scdwyer: Drafted some guidelines to upgrade between v4.2 and v5.0</p>
<hr />
<div>The latest stable release is: '''v5.0.0_stable'''<br />
<br />
This page is help guide any software configuration changes in airframe files or configuration files, as well as provides hints around any behaviour or workflow changes.<br />
<br />
In any codeblocks, a leading '''-''' indicates one should remove the line, while a leading '''+''' indicates one should add the line. In other cases, only names have changed.<br />
<br />
DISCLAIMER: This page is by no means guaranteed to be complete. If you find another required change that was missed, please add it!<br />
<br />
== Upgrading from v4.2.0_stable to v5.0.0_stable ==<br />
<br />
Changelog for this release on GitHub: [https://github.com/paparazzi/paparazzi/blob/v5.0/CHANGELOG.md changelog]<br />
<br />
=== Control Panel ===<br />
<br />
A '''new simulator launcher''' has been added to better select between the different types of simulator (OCAML fixed-wing, JSBSim fixed-wing, NPS, etc). The launcher path must be changed to support this:<br />
{{Box Code|conf/controlpanel.xml|<br />
<source lang="xml"><br />
- <program name="Simulator" command="sw/simulator/launchsitl"><br />
+ <program name="Simulator" command="sw/simulator/pprzsim-launch"><br />
</source><br />
}}<br />
<br />
=== Flightplans ===<br />
<br />
The adoption of the '''state interface''' means a number of functions and variables previously used in the flightplans are no longer valid, and must be replaced by their equivalent:<br />
<br />
* <tt>'''GpsPosAlt()'''</tt> replaces <tt>'''estimator_z'''</tt><br />
* <tt>'''autopilot_flight_time'''</tt> replaces <tt>'''estimator_flight_time'''</tt><br />
<br />
Advanced flightplans will likely require additional changes.<br />
<br />
=== Airframes ===<br />
<br />
A number of changes to clarify names and clean up subsystems and modules means airframe files must be updated:<br />
<br />
==== All Airframes ====<br />
<br />
* <tt>'''CONTROL_FREQUENCY'''</tt> replaces <tt>'''CONTROL_RATE'''</tt><br />
<br />
==== Fixedwing Airframes ====<br />
<br />
The altitude/climb estimator has been cleaned up.<br />
<br />
Change the way the altitude kalman filter is enabled:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="MISC"><br />
...<br />
+ <define name="ALT_KALMAN_ENABLED" value="TRUE"/> <!-- can also be set to FALSE (default if not present) --><br />
</section><br />
<br />
<firmware name="fixedwing"><br />
...<br />
- <define name="ALT_KALMAN"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
Add the altitude INS subsystem if there is an <tt>ALT_KALMAN_ENABLED</tt> define or if you use a barometer:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="alt_float" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
'''Alternatively''', use the <tt>gps_passthrough</tt> subsystem to use direct GPS data (remove all <tt>ALT_KALMAN_ENABLED</tt>):<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="gps_passthrough" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
==== Rotorcraft Airframes ====<br />
<br />
The motor mixing has been updated and renamed:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
- <section name="SUPERVISION" prefix="SUPERVISION_"><br />
+ <section name="MIXING" prefix="MOTOR_MIXING_"><br />
...<br />
</section><br />
</source><br />
}}<br />
<br />
* servos need a driver <servos driver="Asctec"><br />
<command_laws><br />
<call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/><br />
<set servo="FRONT" value="motor_mixing.commands[SERVO_FRONT]"/><br />
<set servo="BACK" value="motor_mixing.commands[SERVO_BACK]"/><br />
<set servo="RIGHT" value="motor_mixing.commands[SERVO_RIGHT]"/><br />
<set servo="LEFT" value="motor_mixing.commands[SERVO_LEFT]"/><br />
</command_laws><br />
<br />
- <define name="TRIM_A" value="0"/><br />
- <define name="TRIM_E" value="0"/><br />
- <define name="TRIM_R" value="0"/><br />
+ <define name="TRIM_ROLL" value="0"/><br />
+ <define name="TRIM_PITCH" value="0"/><br />
+ <define name="TRIM_YAW" value="0"/><br />
<br />
- <define name="MIN_MOTOR" value="3"/> replaced by min value in servo<br />
- <define name="MAX_MOTOR" value="200"/> replaced by neutral value in servo<br />
<br />
* an INS subsystem is now compulsory<br />
<br />
=== Advanced Code and Makefile ===<br />
<br />
==== Board Makefiles ====<br />
<br />
In any <tt>conf/boards/''board_name''.makefile</tt>:<br />
* add <tt>$(TARGET).LDSCRIPT</tt><br />
* <tt>'''?='''</tt> can replace <tt>ifndef</tt> statements or <tt>=</tt> statements to allow overrides<br />
* add a default actuator configuration (can be overridden by a configure option in the firmware section)<br />
** <tt>ACTUATORS ?= actuators_pwm</tt><br />
<br />
==== Board Header Files ====<br />
In all <tt>sw/airborne/boards/'board_name''.h</tt>:<br />
* add EXT_CLK<br />
* change to libopencm3<br />
* Default actuator driver<br />
* ADC_CHANNEL_X -> X</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Release_Upgrades&diff=15480
Release Upgrades
2013-07-13T21:29:22Z
<p>Scdwyer: Created page with "The latest stable release is: '''v5.0.0_stable''' This page is help guide any software configuration changes in airframe files or configuration files, as well as provides hints …"</p>
<hr />
<div>The latest stable release is: '''v5.0.0_stable'''<br />
<br />
This page is help guide any software configuration changes in airframe files or configuration files, as well as provides hints around any behaviour or workflow changes.<br />
<br />
In any codeblocks, a leading '''-''' indicates one should remove the line, while a leading '''+''' indicates one should add the line. In other cases, only names have changed.<br />
<br />
DISCLAIMER: This page is by no means guaranteed to be complete. If you find another required change that was missed, please add it!<br />
<br />
== Upgrading from v4.2.0_stable to v5.0.0_stable ==<br />
<br />
Changelog for this release on GitHub: [https://github.com/paparazzi/paparazzi/blob/v5.0/CHANGELOG.md changelog]<br />
<br />
=== Control Panel ===<br />
<br />
A '''new simulator launcher''' has been added to better select between the different types of simulator (OCAML fixed-wing, JSBSim fixed-wing, NPS, etc). The launcher path must be changed to support this:<br />
{{Box Code|conf/controlpanel.xml|<br />
<source lang="xml"><br />
- <program name="Simulator" command="sw/simulator/launchsitl"><br />
+ <program name="Simulator" command="sw/simulator/pprzsim-launch"><br />
</source><br />
}}<br />
<br />
=== Flightplans ===<br />
<br />
The adoption of the '''state interface''' means a number of functions and variables previously used in the flightplans are no longer valid, and must be replaced by their equivalent:<br />
<br />
* <tt>'''GpsPosAlt()'''</tt> replaces <tt>'''estimator_z'''</tt><br />
* <tt>'''autopilot_flight_time'''</tt> replaces <tt>'''estimator_flight_time'''</tt><br />
<br />
Advanced flightplans will likely require additional changes.<br />
<br />
=== Airframes ===<br />
<br />
A number of changes to clarify names and clean up subsystems and modules means airframe files must be updated:<br />
<br />
==== All Airframes ====<br />
<br />
* <tt>'''CONTROL_FREQUENCY'''</tt> replaces <tt>'''CONTROL_RATE'''</tt><br />
<br />
==== Fixedwing Airframes ====<br />
<br />
The altitude/climb estimator has been cleaned up.<br />
<br />
Change the way the altitude kalman filter is enabled:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="MISC"><br />
...<br />
+ <define name="ALT_KALMAN_ENABLED" value="TRUE"/> <!-- can also be set to FALSE (default if not present) --><br />
</section><br />
<br />
<firmware name="fixedwing"><br />
...<br />
- <define name="ALT_KALMAN"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
Add the altitude INS subsystem if there is an <tt>ALT_KALMAN_ENABLED</tt> define or if you use a barometer:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="alt_float" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
'''Alternatively''', use the <tt>gps_passthrough</tt> subsystem to use direct GPS data (remove all <tt>ALT_KALMAN_ENABLED</tt>):<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing"><br />
...<br />
+ <subsystem name="ins" type="gps_passthrough" /><br />
</firmware><br />
</source><br />
}}<br />
<br />
==== Rotorcraft Airframes ====<br />
<br />
The motor mixing has been updated and renamed:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
- <section name="SUPERVISION" prefix="SUPERVISION_"><br />
+ <section name="MIXING" prefix="MOTOR_MIXING_"><br />
...<br />
</section><br />
</source><br />
}}<br />
<br />
- <section name="MIXING" prefix="MOTOR_MIXING_"> instead of <section name="SUPERVISION" prefix="SUPERVISION_"><br />
- servos need a driver <servos driver="Asctec"><br />
- <command_laws><br />
<call fun="motor_mixing_run(autopilot_motors_on,FALSE,values)"/><br />
<set servo="FRONT" value="motor_mixing.commands[SERVO_FRONT]"/><br />
<set servo="BACK" value="motor_mixing.commands[SERVO_BACK]"/><br />
<set servo="RIGHT" value="motor_mixing.commands[SERVO_RIGHT]"/><br />
<set servo="LEFT" value="motor_mixing.commands[SERVO_LEFT]"/><br />
</command_laws><br />
<br />
- <define name="TRIM_A" value="0"/><br />
- <define name="TRIM_E" value="0"/><br />
- <define name="TRIM_R" value="0"/><br />
+ <define name="TRIM_ROLL" value="0"/><br />
+ <define name="TRIM_PITCH" value="0"/><br />
+ <define name="TRIM_YAW" value="0"/><br />
<br />
- <define name="MIN_MOTOR" value="3"/> replaced by min value in servo<br />
- <define name="MAX_MOTOR" value="200"/> replaced by neutral value in servo<br />
<br />
+ an INS subsystem is now compulsory<br />
<br />
<br />
=== Advanced Code and Makefile ===<br />
<br />
==== Board Makefiles ====<br />
<br />
In any <tt>conf/boards/''board_name''.makefile</tt>:<br />
* add <tt>$(TARGET).LDSCRIPT</tt><br />
* <tt>'''?='''</tt> can replace <tt>ifndef</tt> statements or <tt>=</tt> statements to allow overrides<br />
* add a default actuator configuration (can be overridden by a configure option in the firmware section)<br />
** <tt>ACTUATORS ?= actuators_pwm</tt><br />
<br />
==== Board Header Files ====<br />
In all <tt>sw/airborne/boards/'board_name''.h</tt>:<br />
* add EXT_CLK<br />
* change to libopencm3<br />
* Default actuator driver<br />
* ADC_CHANNEL_X -> X</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=15213
Installation/MacOSX
2013-06-04T17:25:06Z
<p>Scdwyer: updated status of os x install - sim working again</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
<br />
'''Update on OS X installation: Macports install should be working fine for 10.6, 10.7 and 10.8, but the binary installer is still not available. arm-none-eabi-gdb will not run properly on 10.6 at the moment. The simulator in master is currently broken, and launching agents from paparazzi center in 10.8 is also broken. (April 9, 2013)'''<br />
<br />
'''Update on OS X installation: Currently, only launching agents from paparazzi center in 10.8 and arm-none-eabi-gdb on 10.6 should be broken (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work). The simulator should be working again. The binaries are still unavailable as there has not been time to set up a new build server. (June 4, 2013)'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:<br />
<source lang="bash">sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=14763
Installation/MacOSX
2013-04-10T03:58:39Z
<p>Scdwyer: update current status of os x install (macports working...kind of) and note about uninstalling old toolchain prior to upgrading</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
'''Update on OS X installation: Macports install should be working fine for 10.6, 10.7 and 10.8, but the binary installer is still not available. arm-none-eabi-gdb will not run properly on 10.6 at the moment. The simulator in master is currently broken, and launching agents from paparazzi center in 10.8 is also broken. (April 9, 2013)'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:<br />
<source lang="bash">sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=14747
Installation/MacOSX
2013-04-09T00:23:50Z
<p>Scdwyer: /* Installing from source */ added step to install x11 on mountain lion</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=14685
Installation/MacOSX
2013-03-27T22:38:37Z
<p>Scdwyer: install from source, final steps, added sample command for changing gtk theme</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
<li> After installation, we need to set the correct python to override the default OS X python:</li><br />
<source lang="bash">sudo port select --set python python27</source><br />
<li> You can also [[#Changing the GTK look and feel|change the GTK theme]]<br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
A good choice is:<br />
<source lang="bash">switch2 /opt/local/share/themes/ClearlooksClassic/</source><br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=14684
Installation/MacOSX
2013-03-27T22:25:36Z
<p>Scdwyer: /* Installing from source */ only paparazzi-tools macport now, no paparazzi port</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:</li><br />
<source lang="bash">sudo port selfupdate</source><br />
<li>To install all of the paparazzi prerequisites:</li><br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].<br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=14661
Installation/MacOSX
2013-03-21T02:00:49Z
<p>Scdwyer: noted os x install is temporarily broken</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
'''The OS X installation is may be temporarily broken, as well as the links to the binary installer. This is being actively resolved, and hopefully will be finished soon. (March 20, 2013).'''<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=FirmwareArchitecture&diff=14435
FirmwareArchitecture
2013-02-21T23:41:28Z
<p>Scdwyer: /* Creating a new Module */</p>
<hr />
<div>== Subsystems ==<br />
[[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 "by hand" and the build system takes care to compile the particular implementation.<br />
<br />
They are selected and configured with a <source lang="xml" enclose="none"><subsystem name="foo" type="bar"></source> in the [[Airframe_Configuration#Firmware_and_Hardware_definitions|firmware section of the airframe file]]. All this does is basically include a makefile <tt>foo_bar.makefile</tt> that adds the respective sources and adds a few configuration options. (See <tt>conf/autopilot/subsystems/...</tt>)<br />
This makes it easier to put an airframe file together (they replace the old raw makefile section) and also allows us to change the code and move/rename files behind the scenes without breaking everyones airframe files.<br />
<br />
=== Creating a new Subsystem ===<br />
A new subsystem is required when adding support for new or alternate core functionalities, as listed above. Some new subsystems will relay on underlying peripheral or MCU peripheral drivers (for example a new IMU subsystem), others do not need this (for example a new set of control loops). An MCU peripheral uses on-chip hardware peripherals in the main microcontroller (such as the SPI hardware), while normal peripherals are external hardware such as an analog to digital converter integrated circuit (such as the MAX1168).<br />
<br />
The general strategy for adding a new subsystem should be something along the lines of:<br />
*(if required) write a peripheral driver for the specific device or device family in <tt>sw/airborne/peripherals/</tt><br />
*(if required) in the peripheral driver, use the <tt>sw/airborne/mcu_periph/*.[c|h]</tt> arch-independent mcu peripheral drivers to handle the communication and input-output operations<br />
*(if required) you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*write a subsystem driver for the new functionality, device or device family in <tt>sw/airborne/subsystems/TYPE/</tt><br />
*you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*if you need to add complex features (for example, use a gpio for a reset, use an interrupt for data ready, etc), you will need to add some arch specific files in the correct location to handle some of the extra initialization and operation, for example in <tt>sw/airborne/arch/ARCHTYPE/subsystems|peripherals|mcu_periph|ETC/</tt><br />
*write a subsystem makefile to aid in building the code, found in <tt>conf/firmwares/subsystems/fixedwing|rotorcraft|shared/</tt><br />
*even though you technically need to make a new one, you can undoubtedly use existing examples to make your life easier. For example, for an IMU, try looking at the adxl345 peripheral driver, or possibly the imu_b2.[c|h] (which uses for example the ms2100 and max1168 peripherals) for some ideas<br />
*last thing, make sure you USE MASTER for all development, and take a look at the [[Contributing]] page, and be sure to review the coding style guidelines<br />
*heavily comment the code, especially regarding any magic numbers and operations (for example, scaling the input of a sensor)<br />
Finally, master is always being updated and changed, so if you aren't quite sure about something, don't hesitate to ask on the mailing list. In addition, there may be style differences between newer, updated subsystems and older subsystems.<br />
<br />
== Modules ==<br />
[[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. The event and periodic functions of the Modules get called at the end of event_task_ap and periodic_task_ap respectively.<br />
<br />
=== Creating a new Module ===<br />
*See [[Modules]] for more information<br />
<br />
== Discussion ==<br />
So the difference is that with subsystems you explicitly call the functions (e.g. control loops) from the main ap loop, whereas the event/periodic functions of the Modules get called at the end of the main event/periodic tasks. So Modules are perfect to add stuff like extra payload and sensors, but Subsystems give you tighter control over when and in what order to call functions (e.g. for estimation/control).<br />
<br />
Modules naturally provide the "several implementations" feature of the Subsystems. So, we could have a "generic" main.c consisting only in calls to the generated functions.<br />
Nevertheless, care should be taken that switching to a "module only" configuration doesn't become detrimental to the readability and debugability of the code.<br />
<br />
You can also wrap some subsystem code as a modules (e.g. infrared), or the other way round (e.g. imu_ppzuav). As you can see with the imu_ppzuav module it also still expects a direct ImuEvent call from main_ap, so you could say it's not a "pure" module.<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Subsystems&diff=14434
Subsystems
2013-02-21T23:40:43Z
<p>Scdwyer: </p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages hideprefix=always>Subsystems</categorytree><br />
<br />
Mostly a subsystem is a part offering a specific functionality with a<br />
defined interface and can have multiple different implementations. (See <tt>sw/airborne/subsystems/...</tt>)<br />
<br />
They are selected and configured with a <source lang="xml" enclose="none"><subsystem name="foo" type="bar"></source> in the [[Airframe_Configuration#Firmware_and_Hardware_definitions|firmware section of the airframe file]].<br />
<br />
All this does is basically include a makefile <tt>foo_bar.makefile</tt> that adds the respective sources and adds a few configuration options. (See <tt>conf/firmwares/subsystems/...</tt>)<br />
<br />
This makes it easier to put an airframe file together (they replace the old raw makefile section) and also allows us to change the code and move/rename files behind the scenes without breaking everyones airframe files.<br />
<br />
See [[FirmwareArchitecture]] for the differences to [[Modules]], as well as how to write a new subsystem.<br />
<br />
== Available Subsystems ==<br />
<br />
{| class="wikitable" border="1"<br />
! Name !! Types !! Firmwares !! Architecture !! Description<br />
|-<br />
|[[Subsystem/gps|gps]]<br />
||<br />
* ublox<br />
* ublox_utm<br />
* nmea<br />
* mediatek_diy<br />
* skytraq <br />
|<br />
* all<br />
* fixedwing<br />
* all<br />
* fixedwing<br />
* rotorcraft<br />
|<br />
* all<br />
| GPS drivers<br />
|-<br />
|[[Subsystem/imu|imu]]<br />
||<br />
* aspirin_v1.0<br />
* aspirin_v1.5<br />
* aspirin_v2.1<br />
* b2_v1.0<br />
* b2_v1.1<br />
* b2_v1.2<br />
* yai<br />
* aspirin_i2c<br />
* aspirin2_i2c<br />
* analog<br />
* ppzuav<br />
* crista<br />
* crista_hmc5843<br />
|<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* fixedwing<br />
* fixedwing<br />
* fixedwing<br />
* fixedwing<br />
* rotorcraft<br />
* rotorcraft<br />
|<br />
* STM32<br />
* STM32<br />
* STM32<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
|| IMU drivers<br />
Traditional IR sensors can be used for fixedwing<br />
<br />
but an IMU subsystem is not required<br />
|-<br />
|-<br />
|[[Subsystem/ahrs|ahrs]]<br />
||<br />
* float_dcm <br />
* int_cmpl_euler<br />
* int_cmpl_quat<br />
* infrared<br />
|<br />
* all<br />
|<br />
* all<br />
|| AHRS algorithms<br />
|-<br />
|[[Subsystem/radio_control|radio_control]]<br />
||<br />
* ppm<br />
* spektrum<br />
* datalink<br />
| <br />
* all<br />
* all<br />
* fixedwing<br />
| <br />
* all<br />
* STM32<br />
* all<br />
| Radio Control implementations<br />
|-<br />
|[[Subsystem/telemetry|telemetry]]<br />
||<br />
* transparent<br />
* transparent_usb<br />
* xbee_api<br />
| <br />
* all<br />
|<br />
* all<br />
* LPC21xx<br />
* all<br />
| Telemetry implementations<br />
|-<br />
|[[Subsystem/actuators|actuators]]<br />
||<br />
* mkk<br />
* asctec<br />
* asctec_v2<br />
* pwm_supervision<br />
* skiron<br />
* heli<br />
| <br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
| <br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
* all<br />
| Drivers for different ESCs for rotorcraft<br />
Fixedwing ESCs and servos are<br />
<br />
possible on all firmwares/architectures<br />
|-<br />
|[[Subsystem/stabilization|stabilization]]<br />
||<br />
* int_quat<br />
* float_quat<br />
* euler<br />
| <br />
* rotorcraft<br />
* rotorcraft<br />
* rotorcraft<br />
<br />
| <br />
* all<br />
* all<br />
* all<br />
| Attitude control system for rotorcraft<br />
|}<br />
<br />
<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]] [[Category:Subsystems]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=FirmwareArchitecture&diff=14433
FirmwareArchitecture
2013-02-21T23:37:41Z
<p>Scdwyer: added info about creating a new subsystem</p>
<hr />
<div>== Subsystems ==<br />
[[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 "by hand" and the build system takes care to compile the particular implementation.<br />
<br />
They are selected and configured with a <source lang="xml" enclose="none"><subsystem name="foo" type="bar"></source> in the [[Airframe_Configuration#Firmware_and_Hardware_definitions|firmware section of the airframe file]]. All this does is basically include a makefile <tt>foo_bar.makefile</tt> that adds the respective sources and adds a few configuration options. (See <tt>conf/autopilot/subsystems/...</tt>)<br />
This makes it easier to put an airframe file together (they replace the old raw makefile section) and also allows us to change the code and move/rename files behind the scenes without breaking everyones airframe files.<br />
<br />
=== Creating a new Subsystem ===<br />
A new subsystem is required when adding support for new or alternate core functionalities, as listed above. Some new subsystems will relay on underlying peripheral or MCU peripheral drivers (for example a new IMU subsystem), others do not need this (for example a new set of control loops). An MCU peripheral uses on-chip hardware peripherals in the main microcontroller (such as the SPI hardware), while normal peripherals are external hardware such as an analog to digital converter integrated circuit (such as the MAX1168).<br />
<br />
The general strategy for adding a new subsystem should be something along the lines of:<br />
*(if required) write a peripheral driver for the specific device or device family in <tt>sw/airborne/peripherals/</tt><br />
*(if required) in the peripheral driver, use the <tt>sw/airborne/mcu_periph/*.[c|h]</tt> arch-independent mcu peripheral drivers to handle the communication and input-output operations<br />
*(if required) you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*write a subsystem driver for the new functionality, device or device family in <tt>sw/airborne/subsystems/TYPE/</tt><br />
*you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*if you need to add complex features (for example, use a gpio for a reset, use an interrupt for data ready, etc), you will need to add some arch specific files in the correct location to handle some of the extra initialization and operation, for example in <tt>sw/airborne/arch/ARCHTYPE/subsystems|peripherals|mcu_periph|ETC/</tt><br />
*write a subsystem makefile to aid in building the code, found in <tt>conf/firmwares/subsystems/fixedwing|rotorcraft|shared/</tt><br />
*even though you technically need to make a new one, you can undoubtedly use existing examples to make your life easier. For example, for an IMU, try looking at the adxl345 peripheral driver, or possibly the imu_b2.[c|h] (which uses for example the ms2100 and max1168 peripherals) for some ideas<br />
*last thing, make sure you USE MASTER for all development, and take a look at the [[Contributing]] page, and be sure to review the coding style guidelines<br />
*heavily comment the code, especially regarding any magic numbers and operations (for example, scaling the input of a sensor)<br />
Finally, master is always being updated and changed, so if you aren't quite sure about something, don't hesitate to ask on the mailing list. In addition, there may be style differences between newer, updated subsystems and older subsystems.<br />
<br />
== Modules ==<br />
[[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. The event and periodic functions of the Modules get called at the end of event_task_ap and periodic_task_ap respectively.<br />
<br />
=== Creating a new Module ===<br />
*TODO<br />
<br />
== Discussion ==<br />
So the difference is that with subsystems you explicitly call the functions (e.g. control loops) from the main ap loop, whereas the event/periodic functions of the Modules get called at the end of the main event/periodic tasks. So Modules are perfect to add stuff like extra payload and sensors, but Subsystems give you tighter control over when and in what order to call functions (e.g. for estimation/control).<br />
<br />
Modules naturally provide the "several implementations" feature of the Subsystems. So, we could have a "generic" main.c consisting only in calls to the generated functions.<br />
Nevertheless, care should be taken that switching to a "module only" configuration doesn't become detrimental to the readability and debugability of the code.<br />
<br />
You can also wrap some subsystem code as a modules (e.g. infrared), or the other way round (e.g. imu_ppzuav). As you can see with the imu_ppzuav module it also still expects a direct ImuEvent call from main_ap, so you could say it's not a "pure" module.<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=DevGuide/GDB_OpenOCD_Debug&diff=14420
DevGuide/GDB OpenOCD Debug
2013-02-12T17:55:27Z
<p>Scdwyer: how to load new binaries from inside gdb with bmp</p>
<hr />
<div>== JTAG adapters ==<br />
Recently some new [[JTAG]] adapters that use the FTDI2232 USB-parallel converter were introduced through OpenOCD (you can try your Wiggler with that, too). USB JTAG adapters include Floss-JTAG, Olimex or Amontec and also fine with Windows (Yagarto).<br />
<br />
'''Also see [[DevGuide/OpenOCD]] for installation and configuration instructions.'''<br />
<br />
== Debugging with GDB over JTAG ==<br />
=== Procedure ===<br />
# Start openocd in a new shell since this process needs to remain running.<br />
#: To connect to the Lisa/L board run the command<br />
#:<pre>openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg</pre><br />
#: To connect to the Lisa/M board via FLOSS-JTAG run the command:<br />
#:<pre>openocd -f interface/flossjtag.cfg -f board/lisa-l.cfg</pre><br />
<br />
# Start GDB with an argument of the elf file created and uploaded to the board.<br />
#: If you programmed with the ap target then the command would be along the lines of<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb var/<airframe>/ap/ap.elf</pre><br />
#: Replace <airframe> with the name of the airframe that has been built.<br />
# Now connect GDB to the board <br />
#:<pre>target remote localhost:3333</pre><br />
# Now we need to set some break points in the code.<br />
#: 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.<br />
#: <pre>break main.c:113</pre><br />
# Stop the currently running code<br />
#: <pre>monitor reset halt</pre><br />
# Reset the code back to the start<br />
#: <pre>monitor reset init</pre><br />
# Now we can run the program which will stop at the break point we set.<br />
#:<pre>continue</pre><br />
<br />
=== Black Magic Probe ===<br />
# Start GDB for arm<br />
#: Open GDB with the correct binary file<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb ./var/AIRFRAME/ap/ap.elf</pre><br />
#: Set Black Magic Probe as Target over the serial link (see ls /dev/ttyACM*):<br />
#:<pre>target extended-remote /dev/ttyACM0</pre><br />
#: Probe via JTAG to get a list of devices:<br />
#:<pre>mon jtag_scan</pre><br />
#: Attach to a device:<br />
#:<pre>attach 1</pre><br />
# Happy Debugging!<br />
<br />
-this information was merged from:<br />
--ht tp :// sourceforge. net/apps/mediawiki/blackmagicdebug/index.php?title=Main_Page<br />
--[[JTAG]]<br />
<br />
=== Useful commands ===<br />
* 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. (STM32 command only)<br />
*:<pre>monitor cortex_m3 maskisr on</pre><br />
* A stack trace can be printed with the command<br />
*:<pre>bt</pre><br />
* show the variable of a variable<br />
*:<pre>print i2c1.status</pre><br />
* Show (eXamine) the value of the 9 bytes hardware register at address 0x40005800 and show them in hex format:<br />
*:<pre>x/9x 0x40005800</pre><br />
* In some cases you may not be able to access some memory areas in the mcu, in that case you should try:<br />
*:<pre>set mem inaccessible-by-default off</pre><br />
<br />
Commands can often be issued without typing the entire command. Here are some commonly used commands; many of them can be invoked using only the first letter:<br />
(gdb) quit – exit the debugger<br />
(gdb) file – load an executable file<br />
(gdb) break line-number/function name -- Set a break-point on a line/at start of function<br />
(gdb) run <args> -- start running the program; if there are command-line arguments, put them after the run invocation<br />
(gdb) cont -- continue running, after a break<br />
(gdb) next -- Next program line (step over function calls)<br />
(gdb) step -- Step into function calls.<br />
(gdb) finish - Step out of the present function<br />
(gdb) print expression -- Show value of a variable or expression<br />
(gdb) list – List 10 lines of the program being debugged. The sixth line is the preset statement. Subsequent, consecutive entry of list will list the next 10 lines.<br />
(gdb) where – obtain a backtrace showing all function calls before the current statement<br />
(gdb) up – Move to the function that called the present function. Useful if your program crashes in a library function; use up to get to the last function call in your program<br />
(gdb) down – Reverses the action of up<br />
(gdb) delete – Removes breakpoint by number (see example following). If no number, all deleted.<br />
(gdb) kill – Terminates the program.<br />
<br />
=== Setting up .gdbinit for BMP and gdb-regview ===<br />
If you use gdb just with a BMP, you can set some initialization commands in ~/.gdbinit that will run when gdb is started, improving workflow.<br />
<br />
A very useful plug-in called gdb-regview [https://github.com/fnoble/gdb-regview (available on GitHub)] can really speedup debugging stm32 processors by providing a pretty-printed summary of register contents.<br />
<br />
A sample file for debugging Lisa/M 2.0 would be:<br />
<pre><br />
set target-async on<br />
set mem inaccessible-by-default off<br />
#for gdb-regview plugin<br />
source /path/to/gdb-regview/gdb-regview.py<br />
regview load /path/to/gdb-regview/defs/STM32F10X_CL.xml<br />
tar ext /dev/BMP_DEVICE<br />
mon version<br />
mon swdp_scan<br />
att 1<br />
</pre><br />
<br />
This should be saved in <tt>~/.gdbinit</tt>.<br />
<br />
Then, after one starts gdb as described above, you can view registers easily, for example:<br />
<pre>(gdb) regview show ADC_CR1</pre><br />
<br />
=== Easily load new binaries from inside gdb with BMP ===<br />
It is also easy to rebuild and reload a program from inside gdb. Calling make from the gdb command line will call make in your current directory:<br />
<pre>(gdb) make</pre><br />
<br />
To load a new elf file into gdb after compiling elsewhere (only required when changing the name of the file):<br />
<pre>(gdb) file file_name.elf</pre><br />
<br />
To upload the binary as per the currently loaded elf:<br />
<pre>(gdb) load</pre><br />
This assumes you have attached to the target already (as per the .gdbinit example just above).<br />
<br />
To restart the program from the beginning:<br />
<pre>(gdb) run</pre><br />
and enter <tt>y</tt>.<br />
<br />
gdb should detect that the elf has changed when loading the new binary, so if the file name has not changed, one should just be able to rebuild (make from inside gdb if appropriate) and then call load and run.<br />
<br />
[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Contact&diff=14337
Contact
2013-02-06T17:52:33Z
<p>Scdwyer: /* The IRC Chat Channel */</p>
<hr />
<div>Get in touch with active members of the group through any of the following means:<br />
<br />
== Mailing List ==<br />
<br />
The Paparazzi electronic mailing list is a special usage of email that allows for widespread distribution of information to many Paparazzi users. It is similar to a traditional mailing list — a list of names and addresses — as might be kept by an organization for sending publications to its members or customers, but typically refers to four things: a list of email addresses, the people ("subscribers") receiving mail at those addresses, the publications (e-mail messages) sent to those addresses, and a reflector, which is a single e-mail address that, when designated as the recipient of a message, will send a copy of that message to all of the subscribers. (Wikipedia)<br />
<br />
Maybe get some answers already, browse the mailing list archives at:<br><br />
[http://lists.gnu.org/archive/html/paparazzi-devel/ http://lists.gnu.org/archive/html/paparazzi-devel/]<br />
<br />
Or join the Paparazzi mailing list for burning new questions at:<br><br />
[http://lists.nongnu.org/mailman/listinfo/paparazzi-devel http://lists.nongnu.org/mailman/listinfo/paparazzi-devel]<br />
<br />
After registering, you can send an e-mail to the entire group by using the address: paparazzi-devel@nongnu.org<br />
<br />
Use the list wisely and it can help you getting answers to your questions. Once you learned about paparazzi, be nice and try to help out others in the future.<br />
<br />
<br />
There are two more lists that are meant for developers:<br />
* Receive commit logs on [http://lists.nongnu.org/mailman/listinfo/paparazzi-commits paparazzi-commits]<br />
* Get notified when builds on the [[Builds|CI server]] fail or are fixed again [http://lists.nongnu.org/mailman/listinfo/paparazzi-builds paparazzi-builds]<br />
<br />
== The IRC Chat Channel ==<br />
Network: Freenode<br />
Network Host: irc.freenode.net<br />
Channel: #paparazzi<br />
<br />
On the '''freenode''' [http://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] server in the '''#paparazzi''' channel a dozen or so members are typically online, although often distracted. Stop by anytime and '''say hello''' to the group, but don't be discouraged by hours of inactivity at certain times of day. If you have a question, a member will typically see it, though sometimes much later, after you are offline. You can check for replies by remaining connected (even if you aren't around), by viewing the log, or by using a bouncer. Feel free to use the mailing list as well if you don't seem to get any response on IRC.<br />
<br />
The IRC conversations are also logged and available [http://colabti.org/irclogger/irclogger_logs/paparazzi here].<br />
<br />
We also have an [[IRC_Bouncer|IRC bouncer]] running.<br />
<br />
=== Web Based Access ===<br />
<br />
You can use a [http://webchat.freenode.net/?channels=paparazzi&uio=d4 web-based IRC portal] that makes it easy for people to jump in from any computer. Simply enter a unique ''nickname'', and '''say hello''' to the team! More active users will benefit from the power of conventional client software such as [http://www.xchat.org Xchat] or [http://www.mirc.com mIRC].<br />
<br />
=== Client Software ===<br />
<br />
A full featured IRC chat program is essential for active users. Download one of the many freeware/shareware IRC clients and put [irc://irc.freenode.net/#paparazzi irc://irc.freenode.net/#paparazzi] at the top of your favorites list!<br />
<br />
* [http://www.xchat.org xchat-gnome] is a popular and easy to use application for Linux. To install run<br />
sudo aptitude install xchat-gnome<br />
* [http://www.silverex.org/download Xchat2] is a free version of Xchat for windows or download a [http://b0at.tx0.org/xchat/ XChat Windows build] or use closed source [http://www.mirc.com mIRC]<br />
* [http://sourceforge.net/projects/xchataqua/ xchat-aqua] is an opensource free IRC client for OS-X<br />
<br />
=== Usage ===<br />
<br />
Choose '''FreeNode''' and some nicknames in the network list and click '''Edit''' to enter the '''#paparazzi''' channel and a Nicserv password. Follow the instructions below to register your chosen nickname and password on the network.<br />
<br />
==== Registering on the Freenode IRC Network ====<br />
<br />
Registering is optional but is required for private one-on-one chats. Private chats are useful for pasting large amounts of code back and forth without flooding the group or for any off-topic discussion you may wish to have. Commands in IRC begin with a forward slash '/'. Type these two commands into your IRC client to register and log on.<br />
<br />
Select your own unique password and use it in place of ''<password>''. Make sure you are currently using the "nickname" that you would like to use.<br />
<br />
/msg NickServ REGISTER <password><br />
<br />
You will now have registered your nickname to your hostmask (or IP address) and the Freenode IRC network will attempt to prevent others from using your nickname. You will need to identify yourself to the system now every time you log onto IRC with the command below. This can be added to the "perform" section of your software to be run automatically every time you log on.<br />
<br />
/msg NickServ IDENTIFY <password><br />
<br />
These commands return output results as well, depending on what IRC client you are using to chat it may have appeared in either your main chat window or a separate server window where other server related messages appear. Check this window for confirmation.<br />
<br />
Note: You may find that your IRC connection will occasionally be interrupted, leaving your nic floating on the server. When this happens the server will not let you log back on using the same nic until that nic has been dropped, usually within 30 minutes. The convention is to append an underscore to your original nic for temporary use.<br />
'''Bold text'''<br />
<br />
<br />
[[Category:Community]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&diff=14254
Sensors/GPS
2013-01-30T05:19:55Z
<p>Scdwyer: /* SPK GS406 */ added 407 note</p>
<hr />
<div>{| align=right<br />
|-<br />
|<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Sensors</categorytree><br />
|}<br />
{|align=left<br />
|-<br />
|__TOC__<br />
|}<br />
<br />
[[Image:U-blox_color_warm_60.gif|100px]]<br />
<br />
Paparazzi autopilots can by default simply use the popular [http://www.u-blox.com u-blox] brand of receivers.<br />
<br />
*Features:<br />
**Small size<br />
**Excellent performance<br />
**4Hz position update rate<br />
<br />
The '''[[Tiny]]''' series features an onboard LEA series GPS receiver and patch antenna, while most other boards boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]]. Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. <br />
<br />
{|align = center<br />
|-<br />
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]<br />
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-Blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]<br />
|[[Image:UBlox_LEA-6H_Sarantel_Helix_s.jpg|200px|thumb|center|u-Blox LEA-6H GPS receiver with Sarantel Helix Antenna]]<br />
|}<br />
<br />
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol. The protocol is parsed in <tt>sw/airborne/subsystems/gps/gps_ubx.c</tt>.<br />
<br />
==GPS Receivers==<br />
<br />
===u-Blox LEA Series Receivers===<br />
<!-- [[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]] --><br />
[[Image:Lea5htiny13.jpg|thumb|left|250px|LEA-5H installed on the Tiny]]<br />
The '''[[Lisa]]''' series, '''[[Twog_v1|TWOG]]''', '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external GPS module and antenna. The '''[[Tiny]]''' features an integrated receiver and antenna. Either type is designed for [http://www.u-blox.com/ u-blox] 4, 5 and 6 series GPS receivers and the proprietary UBX binary protocol. An external battery or capacitor is typically used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition. Any of the LEA-4, LEA-5 and LEA-6 series receivers can be used including the less expensive LEA-4A, 4S, 5A and 5S and similar low cost 6-series models as the special boot configuration code required for these models is already written as a [[Module/GPS_UBlox_UCenter|module]].<br />
<br />
<!-- autobaud - runtime configuration of - ROM-only modules: use ucenter-module to configure your UBlox with no cable nor windows u-center --><br />
<load name="gps_ubx_ucenter.xml" /><br />
<br />
*4Hz Position update rate<br />
*Supports active or passive antennas<br />
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]<br />
*Low position noise figure<br />
<br />
<br style="clear:both"><br />
<br />
===Paparazzi Stand-alone GPS Receivers===<br />
<gallery><br />
Image:Ppzgps13med01.jpg|Top<br />
Image:Ppzgps13_lrg_02.jpg|Bottom<br />
</gallery><br />
<p>Paparazzi source provides a design for an external GPS board. An external GPS board is required for Lisa, TWOG and Classix Autopilot board.<br />
Programming it is similar to the Tiny2.11 GPS configuration. If you build your own you will want to upload the latest u-blox firmware before you configure. See [[Get Hardware]] for sources of assembled boards.</p><br />
<p><br />
The Paparazzi design in https://github.com/paparazzi/paparazzi-hardware/tree/master/sensors/gps/gps_13. The board is very small and light as it has only the components required. It is powered from the 5v line on the "downloads" connector of a TWOG. Also note it is a 4-layer PCB that means better noise resistance. The board has pins for USB connection but requires a different cable and a solder jumper to be move from the ground (default) to 3.3v input to enable the USB port on the module. <br />
</p><br />
<p><br />
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM.xls]<br><br />
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output.txt]<br><br />
See [[Get_Hardware|Get Hardware]] page for suppliers.<br />
</p><br />
==== Wiring Diagram ====<br />
<br />
{|align = none<br />
|-<br />
|[[Image:TWOG to GPS.jpg|200px|thumb|center|TWOG to Standalone GPS Cable Schematic]]<br />
|[[Image:gps13v09FTDIcable.jpg|200px|thumb|center|GPS13 v0.9 Ucenter cable (ftdi)]]<br />
|[[Image:booz gps.jpg|200px|thumb|center|BoozGPS (quadrotor gps V1.1 2009/5) Ucenter cable (ftdi)]]<br />
|}<br />
<br />
===3rd Party u-blox Reference Design Boards===<br />
<p><br />
[[Image:LEA5HExternalModulePinout.jpg|100px|thumb|right|LEA-5H Full Board Pinout]]<br />
The only other GPS board in use seems to be u-blox reference designs or similar to it. They have LEA-4H, LEA-5H and LEA-6H (typically) and several interfaces. Often a larger antenna as well. <br />
</p><br />
<p><br />
The board in the photo is a [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp RF DESIGN] LEA-5H-SMART. <br />
</p><br />
<p><br />
The jumpers adjacent to the TTL interface connectors need to be closed with low value resistors for paparazzi uart port use. Also a [http://nz.element14.com/jsp/search/productdetail.jsp?SKU=1514218 battery] has to be added with an appropriate charging resistor to enable RTC functionality.<br />
</p> <br />
<br />
<br style="clear:both;" /><br />
<br />
===NAVILOCK NL-507ETTL===<br />
[[Image:Navilock NL-507ETTL.jpg|thumb|left|NAVILOCK NL-507TTL]]<br />
The NAVILOCK NL-507TTL u-blox TTL Modul 60416 features an LEA-4 series receiver and 25mm patch antenna on a 30mm x 30mm board.<br />
* Datasheet: [http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481 http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481]<br />
* Purchase: Available for 28€ at [http://www.amazon.de/Navilock-NL-507TTL-u-blox-TTL-Modul/dp/B0011E6VQG www.amazon.de]<br />
<br style="clear:both;" /><br />
<br />
===SPK GS406 or GS407===<br />
[[Image:GS406.jpg|thumb|left|SPK GS406 with LEA-5]]<br />
[http://www.sparkfun.com/commerce/product_info.php?products_id=8889 Sparkfun] sells a nice small module featuring the newer 5-series receiver (6-series in the GS407) and the highly rated Sarantel antenna for about $90. The design is based around the active version of the Sarantel instead of the more appropriate passive model and there's some potentially tricky soldering involved to get around the ribbon cable but the price is great for this hardware.<br />
<br />
[http://store.diydrones.com/ProductDetails.asp?ProductCode=BR-0008-01 DIYDrones] has build a adapter board for this GPS module. It looks like a great solution to use this GPS module with Paparazzi.<br />
<br style="clear:both;"/><br />
<br />
===u-Blox C04-6H Reference Design===<br />
[[Image:abavimage.jpg|100px|thumb|left|u-blox C04-5H]]<br />
u-Blox sells a complete module with antenna for around $200 and will also provide complete schematics, BOM, and PCB files for free if you wish to make your own. Two versions are offered, one with an 18mm patch antenna and the other with the Sarantel P2 helical antenna.<br />
See [http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html] for more info.<br />
<br style="clear:both;" /><br />
<br />
====Connecting external receivers====<br />
For Classix, 1.2.1, Lite, and RoboStix boards.<br />
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.[http://www.u-blox.com/products/Data_Sheets/TIM-LL_Data_Sheet(GPS.G3-MS3-04035).pdf] The Classix and Lite boards feature a 3.3V regulator to power the GPS.<br />
To open the casing on a SAM-LS, remove the bottom of the casing by pulling gently, then work around popping off the solder joints (they are fairly weak) by pressing a small screwdriver against each tab in turn until it pops off. You should then be able to access the GPS chip directly.<br />
<br />
===LS20031 GPS Receiver===<br />
[[Image:ls20031.jpg|100px|thumb|left|LS20031]]<br />
Sparkfun sells the LS20031 GPS module which uses NMEA (Paparazzi support for NMEA is BETA right now.) This Locosys GPS module supports WAAS (U.S. DGPS), EGNOS (EU DGPS), and MSAS (Japanese DGPS).<br />
<br />
More information on configuring the GPS via PMTK can be found [http://dallasmakerspace.org/wiki/LS20031_GPS here]<br />
<br style="clear:both;" /><br />
<br />
==GPS configuration using U-Center==<br />
<br />
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]<br />
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. <br />
* [http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html Download u-center]<br />
<br />
* Note 1: You must [[Compiling#UART_tunnel|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].<br />
<br />
* Note 2: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found [http://www.ftdichip.com/Drivers/D2XX.htm here].<br />
<br />
* Note 3: You can run u-center on Linux by installing "Wine" ([http://www.winehq.org/site/download-deb Installation of Wine]) and set up COM1 as /dev/ttyUSB0. You need to create a symbolic link from the COM device to TTY like this: <br />
ln -s /dev/ttyUSB0 ~/.wine/dosdevices/COM1<br />
<br />
or what worked in Ubuntu 9.10<br />
<br />
ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1<br />
This command will create the symbolic link from ttyUSB0 to COM1. See Info on Wine for "dosdevices" setup. Just download the u-setup.exe and run it with Wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.<br />
<br />
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant. You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port. The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI. Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun]. A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.<br />
<br />
* U-blox occasionally releases firmware updates. Log on to the u-blox website using ''paparazzi'' for username & password to view or download the latest firmware images. There have 'never' been any updates released for the Antaris-4 series used in the Tiny.<br />
<br />
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that. U-blox default is 9600 baud. This must be changed to 19200 or higher to accomodate the 4Hz update rate.<br />
<br>[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]<br />
<br style="clear:both"><br />
<br />
===Uploading the Configuration File===<br />
<br />
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''. Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File>>GPS''. A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.<br />
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]<br />
* [[Media:Tim-LL-V5.zip|TIM-LL]]<br />
* [[Media:Tiny_LEA-5H-v5.zip|LEA-5H (For Use w/ Firmware V5 ONLY!)]]<br />
<br />
===Automatic Configuration at Startup===<br />
You can also use the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] which will take over the task of initializing the GPS for you when you power your autopilot.<br />
<br />
===Manual Configuration===<br />
<br />
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.<br />
Open the message window (menu View->messages view) to start the configuration process by changing the following settings:<br />
<br />
====LEA-4P====<br />
<br />
1. Right Click on the '''NMEA''' Icon and choose '''disable child'''<br />
2. Choose UBX->CFG->NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)<br />
3. UBX->CFG->PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])<br />
4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point<br />
5. UBX->CFG->RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)<br />
6. UBX->CFG->RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)<br />
7. UBX->CFG->SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)<br />
8. UBX->NAV (not UBX->CFG->NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black<br />
9. UBX->CFG->CFG : '''save current config''', click '''"send"''' in the lower left corner to permanently save these settings to the receiver <br />
<br />
====LEA-5H====<br />
<br />
1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''<br />
2. Choose UBX->CFG->NAV5(Navigation 5) - set it to use '''Airborne 8 <4G'''. This tells the Kalman filter to expect significant changes in direction. <br />
Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better<br />
3. UBX->CFG->PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])<br />
4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point<br />
5. UBX->CFG->RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.<br />
6. UBX->CFG->SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)<br />
7. UBX->NAV (not UBX->CFG->NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black<br />
8. UBX->CFG->CFG : '''save current config''', click '''"send"''' in the lower left corner to permanently save these settings to the receiver<br />
<br />
* Cycle the power and verify that the new configuration was saved<br />
* To reset the receiver to the factory defaults go to ''UBX->CFG->CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner. To permanently save these values choose 'Save current configuration' and click ''Send''.<br />
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS>>file. This file can be re-loaded in a similar manner to configure additional identical receivers. Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.<br />
* To update the firmware on a LEA-5H get u-center >= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-Blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.<br />
<br />
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).<br />
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH.<br />
<br />
====LEA-6H====<br />
<br />
1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''<br />
2. ... NOTE: More setting will be added if the full configurations are know. Test will be performed with Rotorcrafts and Fixedwing.<br />
<br />
* Cycle the power and verify that the new configuration was saved<br />
* To reset the receiver to the factory defaults go to ''UBX->CFG->CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner. To permanently save these values choose 'Save current configuration' and click ''Send''.<br />
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS>>file. This file can be re-loaded in a similar manner to configure additional identical receivers. Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.<br />
* To update the firmware on a LEA-6H get u-center >= 6.21, revert the GPS receiver to the default configuration, get an appropriate firmaware file from u-Blox, find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.(seriously)<br />
<br />
===Reset to Default Settings===<br />
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.<br />
<br />
===DGPS (Differential GPS)===<br />
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit. DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals. The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms. Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever. SBAS is currently available in 3 regions, [http://www.esa.int/esaNA/ESAF530VMOC_egnos_1.html WAAS, EGNOS, and MSAS regions] though only WAAS and EGNOS are officially operational. U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].<br />
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''. Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.<br />
<br />
====WAAS issues====<br />
<br />
WAAS has been officially operational and "suitable for safety-of-life applications" since 2003. The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite. U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America. In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification. Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution. Our advice is to completely disable WAAS.<br />
<br />
====EGNOS ====<br />
<br />
EGNOS augments the GPS satellite navigation system and makes it suitable for safety critical UAS applications. EGNOS became operational on 1 October 2009. ESA claims that it can determine position to within 2 meters compared with about 20 meters for GPS alone. Note that the service is currently provided only in western Europe. For further information take a look on the [http://www.esa.int/esaNA/egnos.html ESA EGNOS website].<br />
<br />
For the latest update about functionality of EGNOS please check the website: [http://www.gsa.europa.eu European GNSS Supervisory Authority]"<br />
<br />
===Troubleshooting===<br />
<br />
Problem: I keep getting this error with my nice shiny Tiny v2.1 with a LEA-5H:<br />
Invalid_argument("Latlong.of_utm")<br />
<br />
Solution: Select the correct [[Subsystem/gps|GPS subsystem]].<br />
<br />
== Antenna options for the Tiny and Paparazzi GPS units ==<br />
See [[GPS/Antenna]].<br />
<br />
== Acquiring ==<br />
<br />
To obtain a GPS receiver for use with your Autopilot board, take a look on the [[Get Hardware]] page.<br />
<br />
[[Category:Hardware]] [[Category:Sensors]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&diff=14253
Sensors/GPS
2013-01-30T05:17:53Z
<p>Scdwyer: /* u-Blox LEA Series Receivers */ added lea6 series to lists</p>
<hr />
<div>{| align=right<br />
|-<br />
|<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Sensors</categorytree><br />
|}<br />
{|align=left<br />
|-<br />
|__TOC__<br />
|}<br />
<br />
[[Image:U-blox_color_warm_60.gif|100px]]<br />
<br />
Paparazzi autopilots can by default simply use the popular [http://www.u-blox.com u-blox] brand of receivers.<br />
<br />
*Features:<br />
**Small size<br />
**Excellent performance<br />
**4Hz position update rate<br />
<br />
The '''[[Tiny]]''' series features an onboard LEA series GPS receiver and patch antenna, while most other boards boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]]. Please note that the receivers must be configured (prior to use with the autopilot) as indicated below. Both modules have proven reliable and robust. <br />
<br />
{|align = center<br />
|-<br />
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]<br />
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-Blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]<br />
|[[Image:UBlox_LEA-6H_Sarantel_Helix_s.jpg|200px|thumb|center|u-Blox LEA-6H GPS receiver with Sarantel Helix Antenna]]<br />
|}<br />
<br />
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol. The protocol is parsed in <tt>sw/airborne/subsystems/gps/gps_ubx.c</tt>.<br />
<br />
==GPS Receivers==<br />
<br />
===u-Blox LEA Series Receivers===<br />
<!-- [[Image:Lea big.jpg|100px|thumb|right|u-blox LEA]] --><br />
[[Image:Lea5htiny13.jpg|thumb|left|250px|LEA-5H installed on the Tiny]]<br />
The '''[[Lisa]]''' series, '''[[Twog_v1|TWOG]]''', '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external GPS module and antenna. The '''[[Tiny]]''' features an integrated receiver and antenna. Either type is designed for [http://www.u-blox.com/ u-blox] 4, 5 and 6 series GPS receivers and the proprietary UBX binary protocol. An external battery or capacitor is typically used to enable the GPS to retain data while powered off for significantly faster signal re-aquisition. Any of the LEA-4, LEA-5 and LEA-6 series receivers can be used including the less expensive LEA-4A, 4S, 5A and 5S and similar low cost 6-series models as the special boot configuration code required for these models is already written as a [[Module/GPS_UBlox_UCenter|module]].<br />
<br />
<!-- autobaud - runtime configuration of - ROM-only modules: use ucenter-module to configure your UBlox with no cable nor windows u-center --><br />
<load name="gps_ubx_ucenter.xml" /><br />
<br />
*4Hz Position update rate<br />
*Supports active or passive antennas<br />
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]<br />
*Low position noise figure<br />
<br />
<br style="clear:both"><br />
<br />
===Paparazzi Stand-alone GPS Receivers===<br />
<gallery><br />
Image:Ppzgps13med01.jpg|Top<br />
Image:Ppzgps13_lrg_02.jpg|Bottom<br />
</gallery><br />
<p>Paparazzi source provides a design for an external GPS board. An external GPS board is required for Lisa, TWOG and Classix Autopilot board.<br />
Programming it is similar to the Tiny2.11 GPS configuration. If you build your own you will want to upload the latest u-blox firmware before you configure. See [[Get Hardware]] for sources of assembled boards.</p><br />
<p><br />
The Paparazzi design in https://github.com/paparazzi/paparazzi-hardware/tree/master/sensors/gps/gps_13. The board is very small and light as it has only the components required. It is powered from the 5v line on the "downloads" connector of a TWOG. Also note it is a 4-layer PCB that means better noise resistance. The board has pins for USB connection but requires a different cable and a solder jumper to be move from the ground (default) to 3.3v input to enable the USB port on the module. <br />
</p><br />
<p><br />
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM.xls]<br><br />
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output.txt]<br><br />
See [[Get_Hardware|Get Hardware]] page for suppliers.<br />
</p><br />
==== Wiring Diagram ====<br />
<br />
{|align = none<br />
|-<br />
|[[Image:TWOG to GPS.jpg|200px|thumb|center|TWOG to Standalone GPS Cable Schematic]]<br />
|[[Image:gps13v09FTDIcable.jpg|200px|thumb|center|GPS13 v0.9 Ucenter cable (ftdi)]]<br />
|[[Image:booz gps.jpg|200px|thumb|center|BoozGPS (quadrotor gps V1.1 2009/5) Ucenter cable (ftdi)]]<br />
|}<br />
<br />
===3rd Party u-blox Reference Design Boards===<br />
<p><br />
[[Image:LEA5HExternalModulePinout.jpg|100px|thumb|right|LEA-5H Full Board Pinout]]<br />
The only other GPS board in use seems to be u-blox reference designs or similar to it. They have LEA-4H, LEA-5H and LEA-6H (typically) and several interfaces. Often a larger antenna as well. <br />
</p><br />
<p><br />
The board in the photo is a [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp RF DESIGN] LEA-5H-SMART. <br />
</p><br />
<p><br />
The jumpers adjacent to the TTL interface connectors need to be closed with low value resistors for paparazzi uart port use. Also a [http://nz.element14.com/jsp/search/productdetail.jsp?SKU=1514218 battery] has to be added with an appropriate charging resistor to enable RTC functionality.<br />
</p> <br />
<br />
<br style="clear:both;" /><br />
<br />
===NAVILOCK NL-507ETTL===<br />
[[Image:Navilock NL-507ETTL.jpg|thumb|left|NAVILOCK NL-507TTL]]<br />
The NAVILOCK NL-507TTL u-blox TTL Modul 60416 features an LEA-4 series receiver and 25mm patch antenna on a 30mm x 30mm board.<br />
* Datasheet: [http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481 http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481]<br />
* Purchase: Available for 28€ at [http://www.amazon.de/Navilock-NL-507TTL-u-blox-TTL-Modul/dp/B0011E6VQG www.amazon.de]<br />
<br style="clear:both;" /><br />
<br />
===SPK GS406===<br />
[[Image:GS406.jpg|thumb|left|SPK GS406 with LEA-5]]<br />
[http://www.sparkfun.com/commerce/product_info.php?products_id=8889 Sparkfun] sells a nice small module featuring the newer 5-series receiver and the highly rated Sarantel antenna for about $90. The design is based around the active version of the Sarantel instead of the more appropriate passive model and there's some potentially tricky soldering involved to get around the ribbon cable but the price is great for this hardware.<br />
<br />
[http://store.diydrones.com/ProductDetails.asp?ProductCode=BR-0008-01 DIYDrones] has build a adapter board for this GPS module. It looks like a great solution to use this GPS module with Paparazzi.<br />
<br style="clear:both;"/><br />
<br />
===u-Blox C04-6H Reference Design===<br />
[[Image:abavimage.jpg|100px|thumb|left|u-blox C04-5H]]<br />
u-Blox sells a complete module with antenna for around $200 and will also provide complete schematics, BOM, and PCB files for free if you wish to make your own. Two versions are offered, one with an 18mm patch antenna and the other with the Sarantel P2 helical antenna.<br />
See [http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html] for more info.<br />
<br style="clear:both;" /><br />
<br />
====Connecting external receivers====<br />
For Classix, 1.2.1, Lite, and RoboStix boards.<br />
The u-blox receivers require 3.3v power and all current models have 5V tolerant data lines. The best way to connect to the SAM-LS is to remove the bottom case and solder the 4 wires directly to the TIM-LL module (GND (pin 1) ,VCC (pin 2),TX (Pin 5),RX (pin 4)) check the TIM-LL datasheet for pinout diagrams.[http://www.u-blox.com/products/Data_Sheets/TIM-LL_Data_Sheet(GPS.G3-MS3-04035).pdf] The Classix and Lite boards feature a 3.3V regulator to power the GPS.<br />
To open the casing on a SAM-LS, remove the bottom of the casing by pulling gently, then work around popping off the solder joints (they are fairly weak) by pressing a small screwdriver against each tab in turn until it pops off. You should then be able to access the GPS chip directly.<br />
<br />
===LS20031 GPS Receiver===<br />
[[Image:ls20031.jpg|100px|thumb|left|LS20031]]<br />
Sparkfun sells the LS20031 GPS module which uses NMEA (Paparazzi support for NMEA is BETA right now.) This Locosys GPS module supports WAAS (U.S. DGPS), EGNOS (EU DGPS), and MSAS (Japanese DGPS).<br />
<br />
More information on configuring the GPS via PMTK can be found [http://dallasmakerspace.org/wiki/LS20031_GPS here]<br />
<br style="clear:both;" /><br />
<br />
==GPS configuration using U-Center==<br />
<br />
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]<br />
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. <br />
* [http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html Download u-center]<br />
<br />
* Note 1: You must [[Compiling#UART_tunnel|install the UART tunnel]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].<br />
<br />
* Note 2: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found [http://www.ftdichip.com/Drivers/D2XX.htm here].<br />
<br />
* Note 3: You can run u-center on Linux by installing "Wine" ([http://www.winehq.org/site/download-deb Installation of Wine]) and set up COM1 as /dev/ttyUSB0. You need to create a symbolic link from the COM device to TTY like this: <br />
ln -s /dev/ttyUSB0 ~/.wine/dosdevices/COM1<br />
<br />
or what worked in Ubuntu 9.10<br />
<br />
ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1<br />
This command will create the symbolic link from ttyUSB0 to COM1. See Info on Wine for "dosdevices" setup. Just download the u-setup.exe and run it with Wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.<br />
<br />
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant. You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port. The easiest and most recommended method is to connect to a USB port instead of serial with the $20 [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI. Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun]. A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.<br />
<br />
* U-blox occasionally releases firmware updates. Log on to the u-blox website using ''paparazzi'' for username & password to view or download the latest firmware images. There have 'never' been any updates released for the Antaris-4 series used in the Tiny.<br />
<br />
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that. U-blox default is 9600 baud. This must be changed to 19200 or higher to accomodate the 4Hz update rate.<br />
<br>[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]<br />
<br style="clear:both"><br />
<br />
===Uploading the Configuration File===<br />
<br />
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''. Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File>>GPS''. A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.<br />
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]<br />
* [[Media:Tim-LL-V5.zip|TIM-LL]]<br />
* [[Media:Tiny_LEA-5H-v5.zip|LEA-5H (For Use w/ Firmware V5 ONLY!)]]<br />
<br />
===Automatic Configuration at Startup===<br />
You can also use the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] which will take over the task of initializing the GPS for you when you power your autopilot.<br />
<br />
===Manual Configuration===<br />
<br />
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.<br />
Open the message window (menu View->messages view) to start the configuration process by changing the following settings:<br />
<br />
====LEA-4P====<br />
<br />
1. Right Click on the '''NMEA''' Icon and choose '''disable child'''<br />
2. Choose UBX->CFG->NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)<br />
3. UBX->CFG->PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])<br />
4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point<br />
5. UBX->CFG->RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)<br />
6. UBX->CFG->RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)<br />
7. UBX->CFG->SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)<br />
8. UBX->NAV (not UBX->CFG->NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black<br />
9. UBX->CFG->CFG : '''save current config''', click '''"send"''' in the lower left corner to permanently save these settings to the receiver <br />
<br />
====LEA-5H====<br />
<br />
1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''<br />
2. Choose UBX->CFG->NAV5(Navigation 5) - set it to use '''Airborne 8 <4G'''. This tells the Kalman filter to expect significant changes in direction. <br />
Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better<br />
3. UBX->CFG->PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])<br />
4. Change the baudrate of U-Center to 38400bps if the connection is lost at this point<br />
5. UBX->CFG->RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.<br />
6. UBX->CFG->SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)<br />
7. UBX->NAV (not UBX->CFG->NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black<br />
8. UBX->CFG->CFG : '''save current config''', click '''"send"''' in the lower left corner to permanently save these settings to the receiver<br />
<br />
* Cycle the power and verify that the new configuration was saved<br />
* To reset the receiver to the factory defaults go to ''UBX->CFG->CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner. To permanently save these values choose 'Save current configuration' and click ''Send''.<br />
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS>>file. This file can be re-loaded in a similar manner to configure additional identical receivers. Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.<br />
* To update the firmware on a LEA-5H get u-center >= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-Blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.<br />
<br />
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).<br />
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH.<br />
<br />
====LEA-6H====<br />
<br />
1. Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''<br />
2. ... NOTE: More setting will be added if the full configurations are know. Test will be performed with Rotorcrafts and Fixedwing.<br />
<br />
* Cycle the power and verify that the new configuration was saved<br />
* To reset the receiver to the factory defaults go to ''UBX->CFG->CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner. To permanently save these values choose 'Save current configuration' and click ''Send''.<br />
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS>>file. This file can be re-loaded in a similar manner to configure additional identical receivers. Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.<br />
* To update the firmware on a LEA-6H get u-center >= 6.21, revert the GPS receiver to the default configuration, get an appropriate firmaware file from u-Blox, find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.(seriously)<br />
<br />
===Reset to Default Settings===<br />
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.<br />
<br />
===DGPS (Differential GPS)===<br />
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit. DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals. The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms. Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever. SBAS is currently available in 3 regions, [http://www.esa.int/esaNA/ESAF530VMOC_egnos_1.html WAAS, EGNOS, and MSAS regions] though only WAAS and EGNOS are officially operational. U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].<br />
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''. Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.<br />
<br />
====WAAS issues====<br />
<br />
WAAS has been officially operational and "suitable for safety-of-life applications" since 2003. The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite. U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America. In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification. Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution. Our advice is to completely disable WAAS.<br />
<br />
====EGNOS ====<br />
<br />
EGNOS augments the GPS satellite navigation system and makes it suitable for safety critical UAS applications. EGNOS became operational on 1 October 2009. ESA claims that it can determine position to within 2 meters compared with about 20 meters for GPS alone. Note that the service is currently provided only in western Europe. For further information take a look on the [http://www.esa.int/esaNA/egnos.html ESA EGNOS website].<br />
<br />
For the latest update about functionality of EGNOS please check the website: [http://www.gsa.europa.eu European GNSS Supervisory Authority]"<br />
<br />
===Troubleshooting===<br />
<br />
Problem: I keep getting this error with my nice shiny Tiny v2.1 with a LEA-5H:<br />
Invalid_argument("Latlong.of_utm")<br />
<br />
Solution: Select the correct [[Subsystem/gps|GPS subsystem]].<br />
<br />
== Antenna options for the Tiny and Paparazzi GPS units ==<br />
See [[GPS/Antenna]].<br />
<br />
== Acquiring ==<br />
<br />
To obtain a GPS receiver for use with your Autopilot board, take a look on the [[Get Hardware]] page.<br />
<br />
[[Category:Hardware]] [[Category:Sensors]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&diff=14098
Airframe Configuration
2013-01-17T06:32:33Z
<p>Scdwyer: added info about GCS section including changing ALT_SHIFT values and using a SPEECH_NAME</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Airframe_Configuration</categorytree><br />
== About ==<br />
The airframe file is the most important configuration file and contains all the hardware and software settings for your airframe. It describes what hardware you have and which firmware, sensors, algorithms, etc. you want to use and also holds your configuration parameters. All gains, trims, and behavior settings are defined with standard XML elements.<br />
<br />
The XML airframe configuration file is located in <tt>conf/airframes/<yourairframe>.xml</tt> and always begins with a <!DOCTYPE airframe SYSTEM "airframe.dtd"> line.<br />
<br />
<b>Also see the wiki pages for [[Fixedwing_Configuration|fixedwing specific configuration]] and [[Rotorcraft_Configuration|rotorcraft specific configuration]].</b><br />
<br />
== Creating a new Aircraft ==<br />
While the airframe file is where you configure most aspects of your aircraft, a fully specified aircraft needs several XML configuration files:<br />
* Airframe (what this page is about)<br />
* [[Flight_Plans|Flight Plan]]<br />
* [[Settings]]<br />
* [[Radio_Control|Radio]] (if you use a PPM based R/C system)<br />
* [[Telemetry]]<br />
Each aircraft is assigned a name, unique ID and the associated configuration files in [[Conf.xml|<tt>conf/conf.xml</tt>]]. To create a new Aircraft, click new in the menu A/C in the [[Paparazzi_Center|Paparazzi Center]] and select your new airframe file, etc. (or specify it by hand in [[Conf.xml|<tt>conf/conf.xml</tt>]]).<br />
<br />
== Firmware and Hardware definitions ==<br />
First you should specify which firmware you want to use, i.e. if you have a <tt>[[Fixedwing_Configuration|fixedwing]]</tt> aircraft or a <tt>[[Rotorcraft_Configuration|rotorcraft]]</tt>:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
</firmware><br />
</source><br />
}}<br />
=== Select your Board ===<br />
To specify autopilot hardware you are using and it's low-level settings you have to add a ''target'' "ap" (autopilot) with ''board'' attribute.<br />
<br />
Select the appropriate hardware autopilot board you are going to use in your airframe:<br />
"booz_1.0", <br />
"classix", <br />
"hb_1.1", <br />
"lisa_l_1.0", <br />
"lisa_l_1.1", <br />
"lisa_m_1.0", <br />
"lisa_m_2.0", <br />
"logom_2.6", <br />
"navgo_1.0", <br />
"pc", <br />
"sdlog_1.0", <br />
"tiny_0.99", <br />
"tiny_1.1", <br />
"tiny_2.1", <br />
"tiny_2.11", <br />
"twog_1.0", <br />
"yapa_2.0",<br />
"umarim_1.0",<br />
"umarim_lite_2.0"<br />
<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
<target name="sim" board="pc"/><br />
<target name="ap" board="lisa_m_1.0"/><br />
...<br />
</firmware><br />
</source><br />
}}<br />
<br />
Note that the "pc" is a special kind of "board", and is mostly used only for simulation flights of an autopilot via your computer.<br />
<br />
==== Direct Makefile ====<br />
Optionally you can also add a raw [http://en.wikipedia.org/wiki/Makefile Makefile] section. This is only needed in very advanced setups. For example when testing newly developed hardware.<br />
<br />
=== LEDs ===<br />
You can configure the LEDs on the autopilot to be used for different status indicators:<br />
; ''SYS_TIME_LED'': blinks with 1Hz<br />
; ''AHRS_ALIGNER_LED'': blinks until the AHRS is aligned (gyro bias initilalized) and then stays on<br />
; ''GPS_LED'': blinking if trying to get a fix, on if 3D fix<br />
; ''RADIO_CONTROL_LED'': on if RC signal is ok<br />
; ''BARO_LED'' : only on booz and navgo boards: blinks until baro offset is initialized and then stays on<br />
<br />
Depending on your board some of the LEDs on it are already assigned to some indicators by default, check the appropriate autopilot board page for the defaults.<br />
Use a configure node in the firmware section to assign an indicator to a LED number or disable that with ''none'':<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<configure name="SYS_TIME_LED" value="1"/><br />
<configure name="RADIO_CONTROL_LED" value="2"/><br />
<configure name="GPS_LED" value="none"/><br />
</firmware><br />
</source><br />
}}<br />
Beware that you can only assign '''one''' indicator to a LED number. So if the LED you want to use is already in use because another indicator is set to that number by default you have to disable that other indicator by setting it to ''none''.<br />
<br />
=== IMU ===<br />
Add the [[Subsystem/imu|imu subsystem]] with the type you are using.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<subsystem name="imu" type="aspirin_v1.5"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
See the [[Subsystem/imu|imu subsystem]] page for more details.<br />
Also see the [[ImuCalibration|IMU calibration]] page.<br />
<br />
=== AHRS ===<br />
The [[Subsystem/ahrs|AHRS subsystem]] specifies which attitude estimation filter you are using, e.g. for the complementary filter:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<subsystem name="ahrs" type="int_cmpl_euler"/><br />
</firmware><br />
</source><br />
}}<br />
All AHRS algorithms depend on an imu subsystem, except for the ahrs_infrared which depends on the infrared module.<br />
See the [[Subsystem/ahrs|AHRS subsystem page]] for more details.<br />
<br />
=== Radio Control ===<br />
<br />
Supported types are:<br />
* ''ppm''<br />
* ''spektrum''<br />
* ''datalink''<br />
<br />
Just specify the appropriate [[Subsystem/radio_control|radio control subsystem]] in your firmware section, e.g.:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<subsystem name="radio_control" type="ppm"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
=== Telemetry (Modem) ===<br />
The modem protocol and baud rate must be set in both the airframe file and ground station. Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis. The actual data rate is determined by the number of messages being sent and the period of each message as defined in your [[Telemetry|telemetry file]], e.g. <tt>conf/telemetry/default.xml</tt>. Those wishing to experiment with "alternative" modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.<br />
<br />
The [[Subsystem/telemetry|telemetry subsystem]] supports the following modem protocols:<br />
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.<br />
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee. This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.<br />
<br />
Just specify the appropriate [[Subsystem/telemetry|telemetry subsystem]] in your firmware section. You can currently choose between the types ''transparent'', ''transparent_usb'' and ''xbee_api''.<br />
<br />
'''The default baudrate is 57600 baud, see the [[Subsystem/telemetry|telemetry subsystem]] page for more details and configuration options.'''<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<subsystem name="telemetry" type="transparent"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
=== GPS ===<br />
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:<br />
<br />
Just specify the appropriate [[Subsystem/gps|gps subsystem]] in your firmware section. You can currently choose between the types '''ublox''' and '''ublox_utm''' for the older series 4 modules which still provide a UTM message.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<subsystem name="gps" type="ublox"/><br />
</firmware><br />
</source><br />
}}<br />
<br />
The correct UART is already defined by default according to your board.<br />
The default GPS baudrate is 38400baud.<br />
<br />
If you need to set different baud rates or UART see the [[Subsystem/gps]] page for the options.<br />
<br />
'''Note:'''<br />
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes. The GPS can be accessed directly thrugh the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center|Configured with u-center]]<br />
<br />
== XML Parameters ==<br />
'''When defining parameters you can use [[Units|automatic unit conversion]] to conveniently set it in e.g. degrees.'''<br />
<br />
=== Commands ===<br />
<br />
The <b><tt>commands</tt></b> lists the abstract commands you need to control the aircraft. In a simple fixed-wing example, we have only three:<br />
<source lang="xml"><br />
<commands><br />
<axis name="THROTTLE" failsafe_value="0"/><br />
<axis name="ROLL" failsafe_value="0"/><br />
<axis name="PITCH" failsafe_value="0"/><br />
</commands><br />
</source><br />
For rotorcraft, it is usually:<br />
<source lang="xml"><br />
<commands><br />
<axis name="PITCH" failsafe_value="0"/><br />
<axis name="ROLL" failsafe_value="0"/><br />
<axis name="YAW" failsafe_value="0"/><br />
<axis name="THRUST" failsafe_value="0"/><br />
</commands><br />
</source><br />
<br />
Each command is also associated with a failsafe value which will be used if no controller is active, for example during initialization of the autopilot board. The range of these values is [-9600:9600]. For <tt>"THROTTLE"</tt>, the range is [0, 9600] and in the corresponding <b><tt>servo</tt></b> definition the <b><tt>neutral</tt></b> and <b><tt>min</tt></b> are usually the same for PWM based servos (see below). Note that these commands do not necessarily match the servo actuators. For example, the <tt>"ROLL"</tt> command is typically linked to two aileron actuators.<br />
<br />
=== Servos ===<br />
<br />
The above commands get translated to the <b><tt>servos</tt></b> here. In the example below we use two elevons and a motor. ([http://en.wikipedia.org/wiki/Elevon ''Elevons''] are surfaces used for both pitch and roll as on a flying wing.) These servos are listed in the <b><tt>servos</tt></b> section:<br />
<source lang="xml"><br />
<servos><br />
<servo name="THROTTLE" no="0" min="1000" neutral="1000" max="2000"/><br />
<servo name="ELEVON_LEFTSIDE" no="1" min="2000" neutral="1500" max="1000"/><br />
<servo name="ELEVON_RIGHTSIDE" no="2" min="1000" neutral="1500" max="2000"/><br />
</servos><br />
</source><br />
Names are associated to the corresponding '''real physical connector''' to which a servo is connected '''on the autopilot board'''. For example no="2" means connector two on the board. Also the servo neutral value, total range and direction are defined. Min/max/neutral values are expressed in milliseconds. The direction of travel can be reversed by exchanging min with max (as in <tt>"ELEVON_LEFTSIDE"</tt>, above). The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral. Trim can be added by changing this neutral value. Absolute servo travel limits can be increased or reduced with the min/max values. The <tt>"THROTTLE"</tt> servo typically has the same value for the <b><tt>neutral</tt></b> and <b><tt>min</tt></b>.<br />
<br />
The attribute <b><tt>driver</tt></b> for <b><tt>servos</tt></b> node tells which actuators' driver is associated the the listed servos. After the version '''v4.9_devel-164-gdb0d004''', multiple servos sections can be defined and used together, if the correct [[Subsystem/actuators| actuators subsystems]] are loaded. Some boards are automatically loading a default driver, the one used when no <b><tt>driver</tt></b> attribute is specified.<br />
<br />
Note the following important tips:<br />
* Reverse the servo direction by exchanging min/max<br />
* Trim should always be adjusted mechanically if possible to avoid asymmetrical travel<br />
* Any reduction of the total travel range should be done mechanically to maintain precision<br />
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.<br />
* Board connector numbering starts with <b>zero (0)</b> not with one<br />
* Servos are also known under the synonym <b>actuators</b><br />
* (after version '''v4.9_devel-164-gdb0d004''') For I2C based motor speed control using the [[Rotorcraft_Configuration#Motor_Mixing|motor mixing]]:<br />
** min: command to stop the motor<br />
** neutral: motor idle command<br />
** max: max thrust command<br />
<br />
The <b><tt>servos</tt></b> are then linked to the commands in the <b><tt>command_laws</tt></b> section:<br />
<source lang="xml"><br />
<command_laws><br />
<let var="aileron" value="@ROLL * 0.3"/><br />
<let var="elevator" value="@PITCH * 0.7"/> <br />
<set servo="THROTTLE" value="@THROTTLE"/><br />
<set servo="ELEVON_LEFTSIDE" value="$elevator + $aileron"/><br />
<set servo="ELEVON_RIGHTSIDE" value="$elevator - $aileron"/><br />
</command_laws><br />
</source><br />
<br />
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]<br />
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing. Elevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the <b><tt>let</tt></b> element. The '''@''' symbol is used to reference a command value in the <b><tt>value</tt></b> attribute of the <b><tt>set</tt></b> and <b><tt>let</tt></b> elements. In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection. Note that these numbers ''should add up 100% or more, never less''. For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit. If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.<br />
<br />
<br />
Note that the signs used in the description follow the standard convention.<br />
<br />
After '''v4.9_devel-164-gdb0d004''', the <b><tt>command_laws</tt></b> section is mandatory for both fixedwing and rotorcraft firmwares, only for fixedwing otherwise.<br />
<br />
=== Bat === <br />
This section gives characteristics for monitoring the main power battery.<br />
<br />
<b><tt>MILLIAMP_AT_FULL_THROTTLE</tt></b> represents the actual current (in mA) when full THROTTLE is applied. Note that when flying the current typically is significantly lower than in static tests at home on your workbench. <b><tt>MILLIAMP_AT_FULL_THROTTLE</tt></b> is used to compute the <tt>energy</tt> value of the <tt>BAT</tt> message when no [[Current_sensor|Current sensor]] is mounted in the airframe. This value can also be used in flight plans. For example, if at full throttle your motor consumes 10 Amps, use a value of 10000. You can "tweak" this number after a few flights to match the capacity of your battery. If upon landing your bat.energy messages says that you used 2500 mAh while the energy recharged into the battery is only 2000 mAh, you could reduce the <b><tt>MILLIAMP_AT_FULL_THROTTLE</tt></b> value by 20% to match your in-flight current consumption. This tweaking is most precise if you fly full throttle only (respectively no throttle to glide down again).<br />
<br />
The <b><tt>CURRENT_ESTIMATION_NONLINEARITY</tt></b> can be added to tweak the energy estimation for non full throttle cruise. As the current consumption is nonlinear, at 50% throttle it is likely to be substantially less than 50%. A superellipse is used to approximate this nonlinearity. The default setting is 1.2 and is used if the <b><tt>CURRENT_ESTIMATION_NONLINEARITY</tt></b> is not defined in your airframe file. A value 1 corresponds to linear behaviour, 1.5 corresponds to strong nonlinearity. The tweaking is done same as decribed above for <b><tt>MILLIAMP_AT_FULL_THROTTLE</tt></b>, but only partial throttle (cruise throttle) should be applied in flight.<br />
<br />
If both <b><tt>MILLIAMP_AT_FULL_THROTTLE</tt></b> and <b><tt>CURRENT_ESTIMATION_NONLINEARITY</tt></b> are tweaked well, you get precise energy estimations with less than 5% error independant of your flight pattern without even requiring a [[Current_sensor|current sensor]].<br />
<br />
The <b><tt>CATASTROPHIC_BAT_LEVEL</tt></b> (was previously <b><tt>LOW_BATTERY</tt></b>) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS). <b><tt>CRITIC</tt></b> and <b><tt>LOW</tt></b> values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.<br />
<br />
The <b><tt>MAX_BAT_LEVEL</tt></b> may be specified to improve the display of the battery gauge in the strip or in "papgets". Note that this definition is optional, with a default value of 12.5V.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="BAT"><br />
<define name="MILLIAMP_AT_FULL_THROTTLE" value="12000" unit="mA" /><br />
<define name="CATASTROPHIC_BAT_LEVEL" value="6.0" unit="V"/><br />
<define name="CRITIC_BAT_LEVEL" value="6.5" unit="V"/><br />
<define name="LOW_BAT_LEVEL" value="7.0" unit="V"/><br />
<define name="MAX_BAT_LEVEL" value="8.4" unit="V"/><br />
</section><br />
</source><br />
}}<br />
<br />
The conversion of ADC measurements to Voltage is already defined for the different autopilot boards, if you need to override these defaults you can use the <b><tt>VoltageOfAdc(adc)</tt></b> define.<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="BAT"><br />
...<br />
<define name="VOLTAGE_ADC_A" value="0.0177531"/><br />
<define name="VOLTAGE_ADC_B" value="0.173626"/><br />
<define name="VoltageOfAdc(adc)" value ="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/><br />
</section><br />
</source><br />
}}<br />
<br />
=== Modules ===<br />
The [[Modules|modules]] allow to add new code in a flexible way with initialisation, periodic and event functions without modifying the main AP loop.<br />
<br />
<source lang="xml"><br />
<modules main_freq="60"><br />
<load name="demo_module.xml"/><br />
</modules><br />
</source><br />
<br />
* The main_freq parameter (in Hz) allows to specify the frequency of the main loop. Default is 60 Hz<br />
<br />
=== GCS ===<br />
Use this <b>optional</b> section to help customize parts of the GCS for a specific airframe:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<section name="GCS"><br />
...<br />
<define name="ALT_SHIFT_PLUS_PLUS" value="30"/><br />
<define name="ALT_SHIFT_PLUS" value="5"/><br />
<define name="ALT_SHIFT_MINUS" value="-5"/><br />
<define name="SPEECH_NAME" value="Quad"/><br />
</section><br />
</source><br />
}}<br />
<br />
* <tt>ALT_SHIFT_PLUS_PLUS</tt> sets the number of metres the target altitude will change when the double up arrow button is pressed on the [[GCS#Strips|strip]]<br />
* <tt>ALT_SHIFT_PLUS</tt> sets the number of metres the target altitude will change when the up arrow button is pressed on the [[GCS#Strips|strip]]<br />
* <tt>ALT_SHIFT_MINUS</tt> sets the number of metres the target altitude will change when the down arrow button is pressed on the [[GCS#Strips|strip]]<br />
* <tt>SPEECH_NAME</tt> a string ([a-zA-Z0-9_]) that will be used in place of the aircraft name specified in <tt>conf.xml</tt> for the [[Speech|speech]] and [[GCS#Alarms|alarms]] functionality. Set this to "_" to prevent the speech function from saying the aircraft name. Useful if your aircraft name takes a long time to say (i.e. "UAV1-A_with_spektrum" can be shortened to "Plane").<br />
<br />
[[Category:User_Documentation]] [[Category:Airframe_Configuration]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=DevGuide/GDB_OpenOCD_Debug&diff=13988
DevGuide/GDB OpenOCD Debug
2013-01-08T23:59:50Z
<p>Scdwyer: /* Debugging with GDB over JTAG */ added info about .gdbinit file and gdb-regview</p>
<hr />
<div>== JTAG adapters ==<br />
Recently some new [[JTAG]] adapters that use the FTDI2232 USB-parallel converter were introduced through OpenOCD (you can try your Wiggler with that, too). USB JTAG adapters include Floss-JTAG, Olimex or Amontec and also fine with Windows (Yagarto).<br />
<br />
'''Also see [[DevGuide/OpenOCD]] for installation and configuration instructions.'''<br />
<br />
== Debugging with GDB over JTAG ==<br />
=== Procedure ===<br />
# Start openocd in a new shell since this process needs to remain running.<br />
#: To connect to the Lisa/L board run the command<br />
#:<pre>openocd -f interface/lisa-l.cfg -f board/lisa-l.cfg</pre><br />
#: To connect to the Lisa/M board via FLOSS-JTAG run the command:<br />
#:<pre>openocd -f interface/flossjtag.cfg -f board/lisa-l.cfg</pre><br />
<br />
# Start GDB with an argument of the elf file created and uploaded to the board.<br />
#: If you programmed with the ap target then the command would be along the lines of<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb var/<airframe>/ap/ap.elf</pre><br />
#: Replace <airframe> with the name of the airframe that has been built.<br />
# Now connect GDB to the board <br />
#:<pre>target remote localhost:3333</pre><br />
# Now we need to set some break points in the code.<br />
#: 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.<br />
#: <pre>break main.c:113</pre><br />
# Stop the currently running code<br />
#: <pre>monitor reset halt</pre><br />
# Reset the code back to the start<br />
#: <pre>monitor reset init</pre><br />
# Now we can run the program which will stop at the break point we set.<br />
#:<pre>continue</pre><br />
<br />
=== Black Magic Probe ===<br />
# Start GDB for arm<br />
#: Open GDB with the correct binary file<br />
#:<pre>/opt/paparazzi/arm-multilib/bin/arm-none-eabi-gdb ./var/AIRFRAME/ap/ap.elf</pre><br />
#: Set Black Magic Probe as Target over the serial link (see ls /dev/ttyACM*):<br />
#:<pre>target extended-remote /dev/ttyACM0</pre><br />
#: Probe via JTAG to get a list of devices:<br />
#:<pre>mon jtag_scan</pre><br />
#: Attach to a device:<br />
#:<pre>attach 1</pre><br />
# Happy Debugging!<br />
<br />
-this information was merged from:<br />
--ht tp :// sourceforge. net/apps/mediawiki/blackmagicdebug/index.php?title=Main_Page<br />
--[[JTAG]]<br />
<br />
=== Useful commands ===<br />
* 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. (STM32 command only)<br />
*:<pre>monitor cortex_m3 maskisr on</pre><br />
* A stack trace can be printed with the command<br />
*:<pre>bt</pre><br />
* show the variable of a variable<br />
*:<pre>print i2c1.status</pre><br />
* Show (eXamine) the value of the 9 bytes hardware register at address 0x40005800 and show them in hex format:<br />
*:<pre>x/9x 0x40005800</pre><br />
* In some cases you may not be able to access some memory areas in the mcu, in that case you should try:<br />
*:<pre>set mem inaccessible-by-default off</pre><br />
<br />
Commands can often be issued without typing the entire command. Here are some commonly used commands; many of them can be invoked using only the first letter:<br />
(gdb) quit – exit the debugger<br />
(gdb) file – load an executable file<br />
(gdb) break line-number/function name -- Set a break-point on a line/at start of function<br />
(gdb) run <args> -- start running the program; if there are command-line arguments, put them after the run invocation<br />
(gdb) cont -- continue running, after a break<br />
(gdb) next -- Next program line (step over function calls)<br />
(gdb) step -- Step into function calls.<br />
(gdb) finish - Step out of the present function<br />
(gdb) print expression -- Show value of a variable or expression<br />
(gdb) list – List 10 lines of the program being debugged. The sixth line is the preset statement. Subsequent, consecutive entry of list will list the next 10 lines.<br />
(gdb) where – obtain a backtrace showing all function calls before the current statement<br />
(gdb) up – Move to the function that called the present function. Useful if your program crashes in a library function; use up to get to the last function call in your program<br />
(gdb) down – Reverses the action of up<br />
(gdb) delete – Removes breakpoint by number (see example following). If no number, all deleted.<br />
(gdb) kill – Terminates the program.<br />
<br />
=== Setting up .gdbinit for BMP and gdp-regview ===<br />
If you use gdb just with a BMP, you can set some initialization commands in ~/.gdbinit that will run when gdb is started, improving workflow.<br />
<br />
A very useful plug-in called gdb-regview [https://github.com/fnoble/gdb-regview (available on GitHub)] can really speedup debugging stm32 processors by providing a pretty-printed summary of register contents.<br />
<br />
A sample file for debugging Lisa/M 2.0 would be:<br />
<pre><br />
set target-async on<br />
set mem inaccessible-by-default off<br />
#for gdb-regview plugin<br />
source /path/to/gdb-regview/gdb-regview.py<br />
regview load /path/to/gdb-regview/defs/STM32F10X_CL.xml<br />
tar ext /dev/BMP_DEVICE<br />
mon version<br />
mon swdp_scan<br />
att 1<br />
</pre><br />
<br />
This should be saved in <tt>~/.gdbinit</tt>.<br />
<br />
Then, after one starts gdb as described above, you can view registers easily, for example:<br />
<pre>(gdb) regview show ADC_CR1</pre><br />
<br />
<br />
[[Category:Hardware]] [[Category:Software]] [[Category:Developer_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Maps&diff=13751
Maps
2012-11-22T23:33:42Z
<p>Scdwyer: /* Manually Defined Maps */ need to calibrate from Flight Plan Editor, not GCS</p>
<hr />
<div>__TOC__<br />
== Satellite photo map tiles ==<br />
<br />
The Paparazzi GCS can automatically download satellite photo tiles from Google, MS Maps and Openstreetmap for the area defined in the flight plan. The tiles of Openstreetmap are not real photos (YET!) but rendered tiles. These tiles are fully calibrated and automatically stitched together by the GCS. To load the map tiles simply select Maps->Google Maps Fill (Ctrl-G) from the GCS pulldown menu and the tiles corresponding to the GPS coordinates defined in the [[Flight_Plans|flight plan]] will begin downloading. Pan or zoom the map and re-fill to get more tiles. Tiles are saved in <tt>var/maps/</tt> for off-line use. Checking ''Maps->Google Maps Auto'' will automatically fill the map with tiles while paning and zooming. There is also a command line option to start the GCS with the Auto-fill feature enabled: <br />
<tt>path_to_ground_segment/cockpit/gcs -google_fill</tt>. <br />
If you are behind a firewall, you can use a proxy by setting the <tt>http_proxy</tt> environment variable:<br />
<tt>export http_proxy=<nowiki>http://squid:3128</nowiki></tt><br />
<br />
If you wish to create a calibrated map from the Google tiles, so that upon launching the map2d program a map of the area is shown, go ahead and put into view the area you wish to make the map. While holding left click, drag the area for the map. A red border will appear around the area. Next click on Maps->Map of Region or Maps->Map of Google Tiles. While the former will save the visible region (with waypoints, tracks, ...if any, under the current zoom), the latter will stich together the original Google tiles covering the selected region. Save the xml file to the <tt>data/maps/</tt> directory. This program will automatically screenshot the image and take reference location points and calibrate the map using them. You will be able to load this map in your next sessions (with the Maps->Load menu or with the <tt>-m</tt> option you can add in the your section of <tt>control_panel.xml</tt>.<br />
<br />
Example of map created from google tiles, <tt>gifhorn.xml</tt>:<br />
<tt><map file="gifhorn.jpg" projection="Mercator"><br />
<point x="0" y="0" geo="WGS84 52.527982 10.452157"/><br />
<point x="1965" y="1284" geo="WGS84 52.519595 10.473248"/><br />
</map></tt><br />
<br />
The GCS currently supports three projections (UTM, Mercator and LambertIIe). If you try to place a calibrated map for one projection (e.g. UTM) on another projection plot (e.g. Mercator) the image will be rotated and skewed and a warning will be shown during loading.<br />
<br />
=== Google Restrictions ===<br />
<br />
==== Wrong Maptiles ====<br />
<br />
Sometimes wrong Google maptiles are downloaded due to the beginning of the bandwidth restriction enforced by Google. If this happen and you do not wan to re-download all of you tiles, close the GCS type the following in a command prompt:<br />
<br />
$ cd ~/paparazzi/var/maps/<br />
<br />
or maybe some other directory where you installed the Paparazzi software, then type<br />
<br />
$ rm ??????????????.jpg<br />
<br />
That are indeed 14 questionmarks, better cut and paste the line. This leaves the good resolution images and deletes the bad ones. It would be even better if you could fix the GCS sourcecode and the remove the text of this workaround here from the Wiki.<br />
<br />
==== No more Maptiles ====<br />
<br />
After downloading a lot of maptiles from google you might experience problems getting more due to restrictions enforced by Google. For flight plans covering a large area OSM can be better, as OSM has no such restrictions.<br />
<br />
== Manually Defined Maps ==<br />
<br />
Maps are used in the groundstation to give geographical reference to the flight area. These ''calibrated'' maps are described with two files: the image itself (.png, .jpg or .gif) and an xml file containing geographic references of some points of the bitmap.<br />
<br />
For example, <tt>muret_UTM.xml</tt>:<br />
<tt><map file="muret_UTM.gif" projection="UTM" scale="2.5" approx_ground_altitude="185" utm_zone="31" opacity="100"><br />
<point x="0" y="0" utm_x="359000" utm_y="4815000" geo="WGS84 43.474630 1.256652"/><br />
<point x="0" y="800" utm_x="359000" utm_y="4813000" geo="WGS84 43.456629 1.257169"/><br />
<point x="800" y="800" utm_x="361000" utm_y="4813000"/><br />
</map></tt><br />
<br />
These maps can be created from any image (many are available from various websites). Save the file as a jpeg and place it in the <tt>data/maps/</tt> folder. From the Flight Plan Editor select Maps->Calibrate. After loading the image (which is displayed), you will have to choose at least two reference points, name them with their geographic coordinates (in WGS84 or UTM) and save. The created map (an XML file describing the geographical position of your original bitmap) can then be loaded (Maps->Load).<br />
<br />
== Elevation Data ==<br />
<br />
=== Intoduction ===<br />
The Shuttle Radar Topography Mission (SRTM) obtained elevation data on a near-global scale to generate the most complete high-resolution digital topographic database of Earth. SRTM consisted of a specially modified radar system that flew onboard the Space Shuttle Endeavour during an 11-day mission in February of 2000.<br />
<br />
The Paparazzi GCS can use this elevation data. The [http://srtm.usgs.gov/ SRTM] option from the ''Nav'' menu in the GCS displays the ground altitude of the mouse in the top right hand corner.<br />
<br />
=== Getting and using SRTM Data ===<br />
The SRTM data files can be downloaded using the make process. The only thing that is required is to know the name of the file that is needed. If you use the GCS, it will present a dialog box with the name of the required file. However it is better to download the data before you leave to test your aircraft in the field. <br />
<br />
To illustrate the process. If you needed the file <tt>N47E016.hgt.zip</tt> (47 deg North latitude, 16 deg East longitude) then you could run the following make command:<br />
<pre>make N47E016.hgt.zip</pre><br />
<br />
Alternatively you can download the SRTM data files (<tt>.hgt.zip</tt> or <tt>.hgt.bz2</tt>) to the <tt>data/srtm/</tt> directory.<br />
<br />
They can be downloaded from [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3 http://dds.cr.usgs.gov/srtm/version2_1/SRTM3].<br />
<br />
=== Better and more ===<br />
<br />
Some areas, for example high latitudes, are not well covered by official NASA SRTM data. Some additional data and data with higher accuracy has been compiled in the same format: [http://www.viewfinderpanoramas.org/dem3.html http://www.viewfinderpanoramas.org/dem3.html].<br />
<br />
==== Bad SRTM data issue ====<br />
<br />
You can have bad luck with SRTM data set quality. Sometimes there is a strong discontinuity in the SRTM model at a launching point location you want to use, for real and in the sim. If you load the SRTM model in the GCS (from the Nav menu), the ground altitude of the location of the pointer is displayed on the top right. You can read 131m on your HOME location, and 146m immediately to the north of this point. On takeoff, the simulator gets immediately an altitude of -15m and considers it as a '''crash'''. <br />
<br />
The simplest way to avoid this is to disable the ground detection in the simulator: <br />
<br />
# stop the Simulator agent, <br />
# add the "-noground" option to the command<br />
# and restart. <br />
<br />
You will read a -15m AGL during the first seconds but it won't stop. The current threshold for crash detection is -3m (sw/simulator/flightModel.ml:178 an awful numeric constant in the middle of the code, sad but true.<br />
<br />
=== Automating script ===<br />
If you want to get a specific range of elevation data, for example if you test your UAS in various areas on a continent, use the script below. Change the values for the ranges you need.<br />
<br />
$ nano grabelevationdata.sh<br />
<br />
Then copy via selecting the script below then CTRL+C and then use CTRL+SHIFT+V to paste it into the nano editor. Then use CTRL+X to save the file. <br />
<br />
#!/bin/bash<br />
# Use freely, OpenUAS 2010<br />
# Script to grab ranges of elevation data, very handy if you test your UAS in various areas in a continent ;)<br />
# Change, add or delete values in 49 50 51 and 003 004 005 006 007 008 009 to get the ranges you need.<br />
i=1<br />
for lat in 49 50 51<br />
do<br />
j=1<br />
for long in 003 004 005 006 007 008 009<br />
do<br />
let "j+=1"<br />
wget -N --waitretry=40 "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/N"$lat"E"$long".hgt.zip"<br />
done<br />
let "i+=1" <br />
done <br />
exit 0<br />
<br />
then to be able to simply run the script <br />
<br />
$ chmod u+x grabelevationdata.sh<br />
<br />
Finally you can run the script, use and wait a while...<br />
<br />
$ ./grabelevationdata.sh<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Main_Page&diff=13281
Main Page
2012-10-02T21:00:18Z
<p>Scdwyer: hotbar only above right column</p>
<hr />
<div>__NOTOC__<br />
__NOEDITSECTION__<br />
<br />
{|style="border-spacing:8px;margin:0px -8px" class="MainPageBG" style="width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;"<br />
|-<br />
|align="center" colspan="2"| <h2 style="margin:0;background-color:#82add9;font-size:150%;font-weight:bold;border:0px solid #a3bfb1;text-align:center;color:#ffffff;padding:0.2em 0.4em;">Welcome To Paparazzi</h2><br />
<br />
|-valign="top"<br />
|<br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[General|General]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{General}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Hardware|Hardware]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Hardware}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em; <br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Software|Software]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Software}}<br />
</div><br />
<h3 style="-moz-border-radius-topleft: 0em;-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] [[Miscellaneous|Miscellaneous]] <br />
</h3><br />
<div style="padding:6px;"><br />
{{Miscellaneous}}<br />
</div><br />
<!-- Start of right-column --><br />
| class="MainPageBG" style="width:70%;border:1px solid #cedff2;background-color:#f5faff;vertical-align:top"|<br />
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#f5fffa"<br />
|-<br />
|align="center" colspan="2" background-color=#82add9 | {{Hotbar}}<br />
|-valign="top"<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">The Paparazzi Project</h2><br />
|-<br />
|style="color:#000"|'''Paparazzi''' is a free and open-source hardware and software project intended to create an exceptionally powerful and versatile autopilot system for fixedwing aircrafts as well as multicopters by allowing and encouraging input from the community. The project includes not only the airborne hardware and software, from voltage regulators and GPS receivers to [http://en.wikipedia.org/wiki/Kalman_filtering Kalman filtering] code, but also a powerful and ever-expanding array of ground hardware and software including modems, antennas, and a highly evolved user-friendly ground control software interface.<br />
|-<br />
|All hardware and software is open-source and freely available to anyone under the [http://www.gnu.org GNU] licencing agreement. [[Get_Hardware| Several vendors]] are currently producing and selling Paparazzi autopilots and popular accessories, making the system easy and affordable to all.<br />
|-<br />
|The key feature of the paparazzi autopilot is its unique combination of inertial measurement and/or infrared thermopiles for attitude sensing, providing a robust and accurate attitude estimate that requires no ground calibration and can recover from any launch attitude.<br />
|-<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">The Paparazzi project at ENAC</h2><br />
|-<br />
|The Paparazzi [http://en.wikipedia.org/wiki/Unmanned_Aircraft_System UAS] project is now being used and developed at [http://www.enac.fr/ ENAC University] and the MAVlab of the TU-Delft.<br />
|-<br />
|style="color:#000"|<br />
* [http://paparazzi.enac.fr/debian/ Debian repository] and [https://launchpad.net/~paparazzi-uav/+archive/ppa Ubuntu repository] containing some packages not in the official distribution and required to run Paparazzi.<br />
|-<br />
| <h2 style="margin:0;background-color:#ff9b00;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">Legal disclaimer</h2><br />
|-<br />
|The Paparazzi software and hardware are distributed without any guarantee, in particular they are not certified by any national or international authorities. Before flying, please refer to your country national aviation regulation for Unmanned Aerial Systems, or the one of the country you intend to overfly.<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#ebf5ff;border:1px solid #9dcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#6daef2;font-size:120%;font-weight:bold;border:1px solid #8fa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">Latest stable release</h2><br />
|-<br />
|<h3>v4.0.2_stable</h3><br />
|-<br />
|Download as [https://github.com/paparazzi/paparazzi/tarball/v4.0.2_stable tarball] or [https://github.com/paparazzi/paparazzi/zipball/v4.0.2_stable Zip file] or checkout the '''v4.0''' branch from [[git]].<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#ebf5ff;border:1px solid #9dcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#9dcef2;font-size:120%;font-weight:bold;border:1px solid #8fa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">Upcoming</h2><br />
<br />
|-<br />
|<h3>September 26-27th, 2012</h3><br />
|-<br />
|<br />
<br />
ENAC will be at the [http://www.uavshow-europe.com/ UAV Show Europe] in Bordeaux, France, for flight demonstrations.<br />
<br />
|}<br />
{| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#faf5ff;border:1px solid #ddcef2; text-align: justify;"<br />
| <h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">News</h2><br />
<br />
|-<br />
|<h3>July 26th, 2012</h3><br />
|-<br />
|[[Image:Dc20-logo_smsq.png|thumb|left|DefCon 20]]<br />
<br />
Paparazzi was at the [https://www.defcon.org/html/defcon-20/dc-20-index.html DefCon 20] conference in Las Vegas, USA from July 26th - 29th 2012.<br />
<br />
|-<br />
|<h3>July 26th, 2012</h3><br />
|-<br />
|[[Image:penguin_logo.gif|thumb|left|Paparazzi<br>The Free Autopilot]]<br />
<br />
<span style="color:red">'''NEW RELEASE!'''</span><br />
<br />
The Paparazzi Development Team is pleased to announce the release of the '''Paparazzi v4.0 stable''' version.<br />
<br />
After several months of testing and debugging, the [[RepositoryStructure|release preparation branch v3.9]] has been released as v4.0. See the [https://github.com/paparazzi/paparazzi/blob/v4.0/CHANGELOG.md changelog] for an overview of new features and bugfixes.<br />
<br />
If you are already using paparazzi with [[Git]], you can switch to this new branch with<br />
<br />
'''<code>git remote update && git checkout v4.0</code>'''.<br />
<br />
For new user, it will be the default branch when getting the [[Installation#Getting_the_Source_Code|source code from Github]]. You can also download a [https://github.com/paparazzi/paparazzi/tarball/v4.0_stable tarball] or [https://github.com/paparazzi/paparazzi/zipball/v4.0_stable Zip file] of the <tt>v4.0_stable</tt> source code.<br />
<br />
|-<br />
|<h3>July 2-6th, 2012</h3><br />
|-<br />
|[[Image:Blender_at_IMAV2012.JPG|thumb|left|Blender: 312mm / 340g]]<br />
<br />
'''Blender''', the small but deserving quadrotor of ENAC Paparazzi Team took the 1st place in "Outdoor autonomy" and 3rd place in "Outdoor dynamics" during [http://www.imav2012.org/ IMAV2012] competition in Braunschweig (Germany). Completing its missions with overflowing enthusiasm thanks to the new [[NavGo_v3|'''NavGo''']] autopilot. NavGo is the latest in the long line of award winning Paparazzi hardware available. See the list of Paparazzi hardware [[Autopilots |here]].<br />
<br />
<br />
|-<br />
|<h3>July 6th, 2012</h3><br />
|-<br />
|[[Image:Atmos.png|thumb|left|[ATMOS|http://www.teamatmos.nl/]]]<br />
<br />
<br />
'''[http://www.teamatmos.nl/ ATMOS]''', a hybrid [http://www.teamatmos.nl/video airplane-quadrotor] developed at the MAVlab of TU-Delft, was awarded third place (out of 140) in the [http://www.uavforge.net/ UAVForge] Competition. There were more than 140 initial [http://www.uavforge.net/uavhtml/milestones.php contestants] and after several selection rounds with only 12 finalists, the paparazzi [[Lisa/M]] powered [http://www.teamatmos.nl/ ATMOS] was one of the few that could actually make it to the remote target site miles away in an RF unfriendly environment. No team fully completed the baseline objectives which is why no prices were issued. The vertical takeoff and landing, together with long range thanks to the wing and flexibility thanks to opensource paparazzi were key factors in this event [http://www.youtube.com/watch?v=81NvfLFzhqQ]. <br />
<br />
But probably more important, the development of [http://www.teamatmos.nl/ ATMOS] has added a new [https://github.com/tudelft/paparazzi/tree/atmos-master4-flyoff code-base] to paparazzi to enable the control of any hybrid [https://github.com/tudelft/paparazzi/blob/atmos-master4-flyoff/sw/airborne/firmwares/rotorcraft/force_allocation_laws.c multi-lifting] device vehicle. ATMOS can take-off vertically as a quadrotor, transition to full forward flight as an airplane but also fly in any intermediate transition stage fully autonomously. So let your imagination go loose!<br />
<br />
|-<br />
|<h3>May 9th, 2012</h3><br />
|-<br />
|[[Image:Git-Logo-2Color.png|thumb|left|[[RepositoryStructure|New git branching model]]]]<br />
<br />
'''In order to improve the development workflow and provide stable releases we have changed our git branching model.'''<br />
<br />
<span style="color:red">'''The branch "master" is now our development branch.'''</span><br />
<br />
* The "dev" branch was renamed to the release preparation branch "v3.9". Switch to this branch if you want stable code.<br />
* "master" was reset to the previous "locm3" branch, where development will happen now with libopencm3 for the STM32 architecture.<br />
<br />
Please see the [[RepositoryStructure]] page for more details.<br />
<br />
As soon as we are ready to release v4.0 the will be tarballs available if you don't want to use [[Git]].<br />
<br />
|-<br />
|<h3>May 8th, 2012</h3><br />
|-<br />
|[[Image:Youtube.png|thumb|left|[http://www.youtube.com/playlist?list=PL91197EBE66E78E38 link to youtube video collection]]]<br />
<br />
A lot of cool stuff is done with paparazzi driven UAV`s<br />
To share the world what the paparazzi community is doing a [http://www.youtube.com/playlist?list=PL91197EBE66E78E38 youtube video play list] generated. If you want your video in there send a youtube link to the mailing list.<br />
<br />
|-<br />
|<h3>April 9th, 2012</h3><br />
|-<br />
|[[Image:Mini-Horus_Launch_in_Mada.jpg|thumb|left|Take off in Madagascar]]<br />
<br />
In March 2012, Paparazzi flew in southern Madagascar in the frame of a multi-university project to study and improve the ecosystem in one of the poorest regions of the world ([http://www.sulama.de Project]). More than 4000 hectares of farm and grassland were photographed in visible and near infrared spectra. More than 8500 photos were taken. Surely one of the biggest missions for science ever flown with Paparazzi.<br />
<br />
|-<br />
|<h3>March 7th, 2012</h3><br />
|-<br />
|[[Image:Sumo_launch.jpg|thumb|left|Take off in Antarctica]]<br />
<br />
In the Antarctic summer of 2011/2012 two teams flew Paparazzi-driven UAS on the southernmost continent. The University of Bergen flew at the Norwegian Troll station ([http://www.youtube.com/watch?v=0T9fyCNLllI video]) and the University of Colorado near the US McMurdo station ([http://dl.dropbox.com/u/53700947/Antarctic_blog/blog_20120124.htm blog], [http://alices-wonderland-adventures.blogspot.com/2012/01/uav-flights-take-2.html blog]). They measured temperature, humidity, pressure, infrared radiation and wind with a Multiplex Funjet plane.<br />
<br />
|-<br />
|<h3>December 26th, 2011</h3><br />
|-<br />
|[[Image:28C3_logo.png|thumb|left|Paparazzi at 28C3]]<br />
<br />
We had a table at the [http://events.ccc.de/congress/2011/wiki/Welcome 28C3] conference.<br />
<br />
|-<br />
|<h3>December 25th, 2011</h3><br />
|-<br />
|[[Image:Cre187-paparazzi.png|thumb|left|CRE187 - Paparazzi]]<br />
<br />
Martin Müller gave a great interview about the history and the inner workings of Paparazzi on [http://cre.fm/cre187 CRE Podcast].<br />
<br />
|-<br />
|<h3>October 5th, 2011</h3><br />
|-<br />
|[[Image:Umarim_v1-0_bottom_side.jpg|thumb|left|Umarim v1.0]]<br />
<br />
ENAC Team [http://paparazzi.enac.fr/wiki/Umarim_v10 Umarim V1.0 autopilot] is now released: LPC based, on-board IMU & barometer, narrow fuselage form factor (56x25mm) and lightweight (9gr) are its main features. Add your favorite GPS receiver and it will fit in your stupidly thin light UAV prototype. But it will also do the job for a big fat one. [http://paparazzi.enac.fr/wiki/Umarim_v10 More info here...]<br />
<br />
|-<br />
|<h3>September 18th, 2011</h3><br />
|-<br />
|[[Image:enac_imav11_1.jpg|thumb|left|IMAV 2011 Outdoor Competition ]]<br />
<br />
This year [http://www.imav2011.org/ IMAV 2011] went really well for all of the participants, we have seen lots of successful flights. ENAC Paparazzi Team took the 2nd place in general "Outdoor Challenge" and [http://paparazzi.enac.fr/wiki/Fire-Storm Fire Storm] demonstrated 105+ minutes of flight and took the "Best Outdoor Endurance Award". He was waiting this day for 2 years since the cancelation of IMAV09. <br />
As an additional information, Fire Storm flew its endurance mission with the new [http://paparazzi.enac.fr/wiki/Umarim_v10 Umarim V1.0] autopilot board which will be released soon.<br />
<br />
|-<br />
|<h3>August 31st, 2011</h3><br />
|-<br />
|[[Image:Quadshot_picture.jpg|thumb|left|The Quadshot]]<br />
<br />
Paparazzi is used in the [http://thequadshot.com Quadshot]: A blend between a quadrocopter and a flying wing. The Quadshot and Paparazzi are also featured in an [http://revision3.com/hak5/backtothestudio episode of Hak5]. You can also skip directly to the [http://www.youtube.com/watch?v=YeP7MMnP33g interview with Piotr] talking about how Paparazzi is used in the Quadshot, and briefly [http://www.youtube.com/watch?v=ANPX3UwRMnw explains the XML airframe file and the GCS].<br />
<br />
|-<br />
|<h3>February 15th, 2011</h3><br />
|-<br />
|[[Image:Finnarp.jpg|thumb|left|Paparazzi in Antarctica]]<br />
<br />
Paparazzi has flown on the southernmost continent: Antarctica. Scientists from the [http://en.ilmatieteenlaitos.fi/press-release/127535 Finnish Meteorological Institute] took three modified Funjets to the Finnish Aboa station and brought them back safely after more than 25 flights. They measured temperature, humidity, pressure, wind direction and speed in altitudes up to 1000m.<br />
<br />
|-<br />
|<h3>February 10th, 2011</h3><br />
|-<br />
|[[Image:ScreenShot.jpg|thumb|left|Paparazzi on OS X]]<br />
<br />
Paparazzi now on OS X. Thanks to the tireless efforts of Eric and Bernard we can all run [http://paparazzi.enac.fr/wiki/InstallationMacOSX Paparazzi on OS X]. Stay tuned Windows fans. Paparazzi on Windows is coming soon.<br />
<br />
|-<br />
|<h3>November 26th, 2010</h3><br />
|-<br />
|[[Image:Wingdrop.png|thumb|left|[http://www.youtube.com/watch?v=TFrognLZ2Ak wingdrop]]]<br />
<br />
There is a [http://www.youtube.com/watch?v=TFrognLZ2Ak video] available that shows how Paparazzis adaptive control loops keep a Twinstar in the air that drops 30% of its right wing with 50% of the aileron and then also switches the right engine off. Another [http://www.youtube.com/watch?v=N0H9xWckeYQ video] shows a Paparazzi quadcopter using adaptive control to stay level after dropping 50% of its total weight.<br />
<br />
|-<br />
<br />
|-<br />
|<h3>November 19th, 2010</h3><br />
|-<br />
|[[Image:Github.png|thumb|left|[[Git]]]]<br />
'''WE MOVED TO GIT!'''<br />
<br />
The paparazzi software repository now has a new happy life on github:<br />
<br />
'''https://github.com/paparazzi/paparazzi'''<br />
<br />
We believe the switch from Subversion to the fast [http://git-scm.com/ git] version control system will make development easier, faster and more fun. It also makes it easier for YOU to contribute. You can easily fork paparazzi on github, commit your bugfixes and new features and send us a pull request.<br />
<br />
More info on how to get the paparazzi code from github can be found [[Git|here]].<br />
<br />
We also want to encourage you to submit bugs or feature requests on the simple [https://github.com/paparazzi/paparazzi/issues github issue tracker].<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
|<h3>August, 2010</h3><br />
|-<br />
|[[Image:OrganizedCode.png|thumb|left|[[User/AirborneCodeReorg|Code Reorganization]]]]<br />
After many years of development, so many new autopilot boards and aircraft types have been added that a [http://en.wikipedia.org/wiki/Source_code sourcecode] reorganization was needed. This undertaking is started and will simplify the continuous evolution of the project.<br />
<br />
To benefit from these important changes, it only requires you to update your airframe configuration document once. After you have updated, you should not notice the significant reorganization that is going on behind the scenes. This change will benefit your aircrafts flying successfully for the years to come. The required changes are described on [[User/AirborneCodeReorg| Update Your Airframe Configuration]]. <br />
<br />
At this point several developments are blocked because of this. Therefor we kindly request you to upgrade your airframe configuration documents as soon as possible and thank you in advance for doing so.<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
|<h3>May 22th, 2010</h3><br />
|-<br />
|[[Image:PascalTPS.jpg|thumb|left|[[Hecto| Pascal Brisset]]]]<br />
Pascal Brisset, also known as Hecto, and the father of the Paparazzi project died in an accident while climbing in the Pyrénées mountains in the south of France.<br />
He had dedicated the last seven years of his life to the success of the project. He was taking care by himself of a huge part of the project. To name only a few : development and maintenance of the entire ground segment, navigation and flight plan algorithms, code generation and build system, distribution packaging, server infrastructure...<br />
<br />
To express your grief, you may want to [[Hecto| leave a note on his wiki page]]<br />
<br />
In respect for his commitment, the Paparazzi project must go on and volunteers wanting to take over tasks are hereby asked to do so.<br />
<br />
|<br />
|-<br />
<br />
<br />
|-<br />
<br />
|<h3>February 19th, 2010</h3><br />
|-<br />
|[[Image:Adler_c.jpg|thumb|left|[[Adler_Uni_Stuttgart| The 'Stuttgarter Adler']]]]<br />
The [http://www.irs.uni-stuttgart.de Institute of space systems] of [http://www.uni-stuttgart.de/index.en.html University of Stuttgart] is using the paparazzi system for large remote sensing aircrafts.<br> <br />
The missions include basic research and environmental monitoring. Payloads of up to 7kg are carried.<br><br><br />
More information can be found on the [[Adler_Uni_Stuttgart|Wiki page]].<br />
|<br />
|-<br />
<br />
<br />
|-<br />
<br />
<br />
|-<br />
|<h3>[[News Archives]]</h3><br />
|-<br />
| style="color:#000"|<br />
[[Image:One_Small_Step.jpg|thumb|left|[[News Archives]]]] [[News Archives|Browse the archives]] for a look back at the earlier days of Paparazzi.<br />
|-<br />
<br />
|}<br />
|}</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=WeatherStationInterface&diff=13103
WeatherStationInterface
2012-08-30T20:18:13Z
<p>Scdwyer: added info about kestrel2ivy</p>
<hr />
<div>= Weather Station Interface =<br />
<br />
== davis2ivy ==<br />
<br />
The weather station interface <tt>davis2ivy</tt> polls Davis VantagePro/VantagePro2 stations and broadcasts the current weather data (ambient pressure, temperature, wind speed and direction) over Paparazzi's Ivy bus message system.<br />
Connect to the station is via a serial port.<br />
<br />
<tt>davis2ivy</tt> may send messages with different aircraft IDs.<br />
The simplest way is to use the ID of the actually flying aircraft, thus the messages will show up in the messages window and in the log file as if they were sent from that aircraft.<br />
If you use another aircraft ID, you have to add the <tt>-a</tt> option to get the messages into the log file.<br />
<br />
=== Options ===<br />
The program can be found in <tt>$PAPARAZZI_HOME/sw/ground_segment/misc</tt>.<br />
* <tt>-a</tt> Send ALIVE message<br />
* <tt>-b &lt;bus&gt;</tt> Specify Ivy bus (default is 127.255.255.255:2010)<br />
* <tt>-d &lt;device&gt;</tt> Specify the weather station device (default is <tt>/dev/ttyUSB1</tt>)<br />
* <tt>-i &lt;number&gt;</tt> Specify the aircraft ID (default is 1)<br />
* <tt>-s &lt;number&gt;</tt> Specify the interval between station polls in seconds (default is 1)<br />
<br />
=== External Links ===<br />
[http://www.davisnet.com/weather/products/vantage-pro-professional-weather-stations.asp Vantage Pro2 product page]<br />
<br />
== kestrel2ivy ==<br />
<br />
The weather station interface <tt>kestrel2ivy</tt> polls Neilsen Kellerman Kestrel bluetooth weather meters (tested with Kestrel 4500) and broadcasts the current weather data (ambient pressure, temperature, wind speed and direction, relative humidity) over Paparazzi's Ivy bus message system.<br />
Connect to the meter is via a bluetooth serial port.<br />
<br />
<tt>kestrel2ivy</tt> may send messages with different aircraft IDs.<br />
The simplest way is to use the ID of the actually flying aircraft, thus the messages will show up in the messages window and in the log file as if they were sent from that aircraft.<br />
If you use another aircraft ID, you have to add the <tt>-a</tt> option to get the messages into the log file.<br />
<br />
=== Options ===<br />
The program can be found in <tt>$PAPARAZZI_HOME/sw/ground_segment/misc</tt>.<br />
* <tt>-h</tt> Print help message<br />
* <tt>-a</tt> Send ALIVE message<br />
* <tt>-b &lt;bus&gt;</tt> Specify Ivy bus (default is 127.255.255.255:2010)<br />
* <tt>-d &lt;device&gt;</tt> Specify the weather station device (default is <tt>/dev/rfcomm0</tt>)<br />
* <tt>-i &lt;number&gt;</tt> Specify the aircraft ID (default is 1)<br />
* <tt>-s &lt;number&gt;</tt> Specify the interval between station polls in seconds (default is 5)<br />
* <tt>-m</tt> Use if the meter is set to output metric/SI units instead of default imperial units<br />
<br />
=== External Links ===<br />
[http://www.nkhome.com/kestrel/kestrel-4500/ Kestrel 4500 product page]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=13088
Installation/MacOSX
2012-08-25T21:08:41Z
<p>Scdwyer: update that pyusb should be included by default now (didn't delete install info)</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [https://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard.dmg Snow Leopard] or [https://dl.dropbox.com/u/54220220/paparazzi-tools-Lion.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
<br />
'''UPDATE:''' The lastest binary installer should have PyUSB included by default, no need to install it separately.<br />
<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To install PyUSB, execute<br />
<source lang="bash"><br />
sudo python setup.py install<br />
</source><br />
from inside the unzipped PyUSB source directory.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
To start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Talk:Lisa_Gumstix_Breakout&diff=13067
Talk:Lisa Gumstix Breakout
2012-08-23T18:09:50Z
<p>Scdwyer: added some hardware form factor thoughts</p>
<hr />
<div>== Autopilot Discussion ==<br />
Maybe use Lia instead of Lisa/M. Lia has the same circuitry as lisa/m (apart from the BMP barometer). Then we could use the 0.1" header pins to do board to board connections between lia and the Lisa Gumstix Breakout (LGB). [[User:Esden|Esden]] 21:01, 21 August 2012 (UTC)<br />
<br />
== IO Discussion ==<br />
<br />
=== I2C ===<br />
* Should we have I2C level shifters or anything on the breakout board? [[User:Esden|Esden]] 21:01, 21 August 2012 (UTC)<br />
* Confirmed that it is needed. No isolation for I2C but levelshifting to 5V or 3.3V [[User:Esden|Esden]] 01:15, 23 August 2012 (UTC)<br />
<br />
=== Minimum requirements ===<br />
What is the minimal list of IO and power needed on the board? [[User:Esden|Esden]] 21:01, 21 August 2012 (UTC)<br />
<br />
==Hardware Design / Form Factor Discussion==<br />
* Nice to mate board-to-board with Lia, but should also be compatible with Lisa/M (perhaps at least mount lisa/m on the LGSB with 2mm hardware) [[User:Scdwyer|Scdwyer]] 18:09, 23 August 2012 (UTC)<br />
* What about compatibility with some LPC-based boards (maybe not board-to-board...) [[User:Scdwyer|Scdwyer]] 18:09, 23 August 2012 (UTC)<br />
* Some of the big (i.e. heavy) connectors could be optional with an easy to solder component, that way if someone only needs one usb or one ethernet, or nothing at all, it can be smaller/lighter/cheaper, but still have the capacity to add all the features [[User:Scdwyer|Scdwyer]] 18:09, 23 August 2012 (UTC)<br />
* Some considerations might be made for a good enclosure and cable management after mounting in an airframe. Always seems to be less room than expected on fixed-wing (quads perhaps less of an issue). [[User:Scdwyer|Scdwyer]] 18:09, 23 August 2012 (UTC)</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=12808
Installation/MacOSX
2012-07-04T22:37:28Z
<p>Scdwyer: /* Basic Install */ how to get xcode free on snow leopard</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [http://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard-latest.dmg Snow Leopard] or [http://dl.dropbox.com/u/54220220/paparazzi-tools-Lion-latest.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
to start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
Please see [[JSBSim]] for installation instructions and [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations.<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=NPS&diff=12804
NPS
2012-07-03T18:33:59Z
<p>Scdwyer: /* use a joystick */ updated for SDL</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Booz</categorytree><br />
__TOC__<br />
<br />
NPS contains a sensors model and can use [http://jsbsim.sourceforge.net/ Jsbsim] as FDM (FlightDynamicModel) to allow fairly complex models.<br />
Other FDMs can be integrated easily.<br />
<br />
=== Installation ===<br />
<br />
See [[Installation|installation of Paparazzi]] and [[JSBSim]].<br />
<br />
==== Compilation ====<br />
<br />
* Compile paparazzi<br />
cd paparazzi<br />
make<br />
<br />
* Compile the vehicle<br />
make AIRCRAFT=Quad_LisaM_2 clean_ac nps<br />
<br />
===Start Simulation===<br />
* Start paparazzi_center if you want click to start programs<br />
./paparazzi<br />
<br />
* Start messages to monitor the middleware activity ( from the tool menu of paparazzi center) or with<br />
./sw/ground_segment/tmtc/messages <br />
<br />
* Start the sim<br />
./var/Quad_LisaM_2/nps/simsitl<br />
<br />
You should now see activity in the "messages" window<br />
<br />
* Plot the value of a message field.<br />
start 'plotter' (Real-time plotter from the tool menu of paparazzi center) or with<br />
./sw/logalizer/plotter<br />
for example drag the label 'int32 phi' from the ROTORCRAFT_FP message to the drawing area of the plotter<br />
<br />
<br />
* Use the datalink to change the tlemetry mode<br />
start 'settings' ( from the tool menu of paparazzi center) or with<br />
./sw/ground_segment/tmtc/settings -ac Quad_LisaM_2<br />
start 'server' to dispatch datalink messages ( from the tool menu of paparazzi center) or with<br />
./sw/ground_segment/tmtc/server <br />
change the field "telemetry" on the first page to "Att loop" and send by pressing the green check button. The label on the left or the drop box should change to "Att loop" confirming your essage has been received. "message" should now show that the message "STAB_ATTITUDE_INT" is received<br />
<br />
* Use flightgear to visualize your vehicle<br />
If you want a view of a quadrotor in flightgear, make a link from<br />
/usr/share/games/flightgear/Models/Aircraft/paparazzi to PAPARAZZI_SRC/conf/simulator/flightgear/ <br />
sudo ln -s $PAPARAZZI_SRC/conf/simulator/flightgear/ /usr/share/games/flightgear/Models/Aircraft/paparazzi<br />
start flighgear with<br />
fgfs --fdm=null --native-gui=socket,in,30,,5501,udp --prop:/sim/model/path=Models/Aircraft/paparazzi/mikrokopter.xml<br />
restart your simulator with<br />
./var/Quad_LisaM_2/nps/simsitl --fg_host 127.0.0.1<br />
<br />
* Save you session<br />
<br />
==== Troubleshooting ====<br />
* If you get an error like "JSBSim failed to open the configuration file: (null)/conf/simulator/jsbsim/aircraft/BOOZ2_A1.xml", you need to set your $PAPARAZZI_SRC and $PAPARAZZI_HOME environment variables. Add the following to your .bashrc, change paths according to where you put Paparazzi. Open a new terminal and launch the sim again.<br />
export PAPARAZZI_SRC=~/paparazzi<br />
export PAPARAZZI_HOME=~/paparazzi<br />
<br />
* If you did not install the jsbsim package your JSBSim installation under /opt/jsbsim will be used and you will have to set your library path (either in your shell startup file or when running the sim on the command line), e.g.:<br />
LD_LIBRARY_PATH=/opt/jsbsim/lib ./var/Quad_LisaM_2/nps/simsitl --fg_host 127.0.0.1<br />
<br />
=== Pausing or running the sim at a different speed ===<br />
You can pause the simulation with ''CTRL-z'' in the terminal. You can then enter a different time factor (default 1.0) to make the simulation run slower or faster than real-time. Hit enter to resume the simulation or ''CTRL-z'' again to suspend it like any normal Unix process (use the ''fg'' (foreground) command to un-suspend it again).<br />
<br />
=== Tunning the attitude control loop ===<br />
<br />
Here we are going to use the simulator to demonstrate a way of tunning the attitude control loop.<br />
<br />
* Restart your previous session<br />
<br />
* Set telemetry mode to "Att loop"<br />
<br />
* Display two real time plotter windows<br />
<br />
In the first one, plot the field "m_phi" from the "STAB_ATTITUDE_int" message. This is our estimation of roll angle.<br />
On top of that, plot the field "phi" from the "STAB_ATTITUDE_REF_INT" message. This is our reference roll angle, that is, the roll value we are trying to achieve.<br />
<br />
In the second plotter, plot the fields "delta_a_fb" and "delta_a_ff". Those are respectively the feddback and feedforward part of our roll command. The sum of those two terms is what is used as roll command.The feedforward part is the part used to follow our trajectory and the feedback part is the part used to reject perturbations.<br />
<br />
<br />
* In "Settings", go to the "Att Loop" tab<br />
We notice that the vehicle doesn't follow accurately the step trajectory we are trying to make him do.<br />
<br />
Start by setting the value of the proportional gain ('pgain_phi') to 1000 instead of 400. The vehicle now follows the trajectory faster but overshoots. To prevent that, increase the value of the derivative gain ('dgain p') from 300 to 700.<br />
<br />
If you look at the plotter where you're ploting the commands, you'll notice that during steps, the feedback command has to work hard. This means that our feedforward command is badly tunned, and namely not working hard enough.Increase the value of the feedforward gain ('ddgain p') from 300 to 540. You'll notice that now the feedback command has becomed marginal during the steps. This is the right value for the gain. Anything bigger will make the feedback command fight against the feedforward command during steps, anything smaller will make the feedback command have to complement the feedforward command.<br />
<br />
=== Something else ===<br />
<br />
* try starting flightgear with<br />
<br />
fgfs --fdm=null --native-gui=socket,in,30,,5501,udp --prop:/sim/model/path=Models/Aircraft/paparazzi/simple_bipe.xml<br />
<br />
an the sim with<br />
<br />
./var/Quad_LisaM_2/nps/simsitl --fg_host 127.0.0.1 --rc_script 1<br />
<br />
== Use a Joystick ==<br />
<br />
You can use a joystick (or connect your RC transmitter as a joystick) to control the quad in the simulator.<br />
<br />
<source lang="bash">./var/Quad_LisaM_2/nps/simsitl --fg_host 127.0.0.1 --js_dev 0</source><br />
<br />
or, to use device index 0 by default:<br />
<br />
<source lang="bash">./var/Quad_LisaM_2/nps/simsitl --fg_host 127.0.0.1 -j</source><br />
<br />
Joystick support uses the Simple DirectMedia Layer (SDL) library. Rather than specifying an input device name as one normally does on Linux, you just supply an index value (0, 1, 2,...) of the device you wish to use. Typically, the order of devices is the order in which you plugged them into your computer. The sim will display the name of the device being used to double check. If the <tt>-j</tt> option is used with no argument, the sim defaults to using device on index 0 (which is usually correct if you have only one joystick attached).<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&diff=12794
Flight Plans
2012-06-29T16:56:07Z
<p>Scdwyer: /* Blocks */ added description of path primitive</p>
<hr />
<div>A '''flight plan''' is a XML document which one can create and store aboard an autopilot. The flight plan will describe how you want your aircraft to travel if released into into the wild blue yonder.<br />
<br />
== DTD and Structure ==<br />
<br />
The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in <tt>conf/flight_plans/flight_plan.dtd</tt>). This<br />
DTD must be referenced in the header of your flight plan XML document using the following line:<br><br />
<br />
<source lang="xml"><!DOCTYPE flight_plan SYSTEM "flight_plan.dtd"></source><br />
<br />
The flight plans are stored in the <tt>conf/flight_plans</tt> directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans via the GUI.<br />
<br />
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:<br />
<tt><!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)></tt><br />
<br />
'''A flight plan is composed of two mandatory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]]'''<br />
<br />
The root <tt>flight_plan</tt> element is specified with several attributes:<br />
<tt>'''<flight_plan name lat0 lon0 ground_alt security_height qfu alt max_dist_from_home>'''</tt><br />
* <tt>'''name'''</tt>: the name of the mission (a text string)<br />
* <tt>'''lat0, lon0'''</tt>: describe the latitude and longitude of the point {0,0} in WGS84 degree coordinates<br />
* <tt>'''ground_alt'''</tt>: the ground altitude (in meters). It defines the <tt>GROUND_ALT</tt> constant value which can be used to define waypoint altitudes<br />
* <tt>'''security_height'''</tt>: the altitude used by the circle-home failsafe procedure<br />
* <tt>'''qfu'''</tt> (optional): defines the global constant <tt>QFU</tt>. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft. So if you want to take off and climb to the West you would use qfu=270. <br />
* <tt>'''alt'''</tt>: the default altitude of waypoints ([[Altitude_definitions|Above Sea Level]]). So if your ground altitude is 400 then alt needs to be a value greater than ground altitude and above any obstructions in the flight plan. <br />
* <tt>'''max_dist_from_home'''</tt>: the maximum allowed distance (in meters) from the HOME waypoint. Exceeding this value will trigger an exception.<br />
<br />
Here is an example of the first line of a flight plan:<br />
<br />
<source lang="xml"><br />
<flight_plan name="Example Muret"<br />
lat0="43.46223" lon0="1.27289" max_dist_from_home="300" qfu="270"<br />
ground_alt="185" security_height="25" alt="250"><br />
</source><br />
<br />
Note that a flight plan could also contain optional <tt>include</tt>'s and <tt>exceptions</tt> cases.<br />
<br />
== Waypoints ==<br />
<br />
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified by it's name and coordinates:<br />
<tt>''' <waypoint name wpx wpy [alt] [height]/> '''</tt><br />
where wpx and wpy are real positional coordinates ( <tt>'''lat/lon'''</tt> ) '''or''' UTM coordinates ( <tt>'''utm_x0/utm_y0'''</tt> ) '''or''' relative coordinates ( <tt>'''x/y'''</tt> ) in meters from your reference point {0,0} . <tt>alt</tt> and <tt>height</tt> are optional parameters and can be used to assign an altitude to a particular waypoint that is different from the globally defined <tt>alt</tt> parameter of the flightplan. To set the waypoint altitude relative to the [[Altitude_definitions|ground altitude]] (<tt>ground_alt</tt>) of the flight plan for this waypoint, use the <tt>height</tt> attribute instead of <tt>alt</tt>.<br />
<br />
An example:<br />
<source lang="xml"><br />
<waypoints><br />
<waypoint name="HOME" x="0.0" y="30.0"/><br />
<waypoint name="BRIDGEOVERRIVER" x="-100.0" y="60.0" alt="270."/><br />
<waypoint name="MyBarn" x="-130.0" y="217.5" alt="3000."/><br />
<waypoint name="3" x="-30.0" y="50" height="50."/><br />
<waypoint name="4" x="-30.0" y="50." alt="ground_alt + 50"/><br />
<waypoint name="_MYHELPERSPOT" x="-30.0" y="60" height="50."/><br />
<waypoint name="_MYOTHERHELPERSPOT" x="-70.0" y="90" height="70."/><br />
<waypoint name="TOWER" lat="48.858249" lon="2.294494" height="324."/><br />
<waypoint name="MountainCAFE" utm_x0="360284.8" utm_y0="4813595.5" alt="1965."/><br />
</waypoints><br />
</source><br />
<br />
'''Tips'''<br />
* Waypoints are easily adjusted with the [[Flight_Plan_Editor|flight plan editor]].<br />
* If a waypoint name starts with an underscore, the waypoint is '''not displayed''' in the GCS, except in editor mode.<br />
* The maximum number of waypoints is 254.<br />
* A waypoint named <tt>HOME</tt> is required if the failsafe HOME mode procedure is used.<br />
<br />
== Sectors ==<br />
<br />
Flat ''Sectors'' can be described as an area defined by list of waypoint corners. Such an area will be displayed in the Ground Control Station (GCS) by colored lines.<br />
A function is generated to check if a point, usually the aircraft itself, is ''inside'' this sector. Currently, this feature requires that the polygon is <b>convex</b> and described in a <b>clockwise</b> order. For a sector named <tt>sector</tt>. Note that sector names are not allowed to contain spaces. The generated function is <tt>bool_t InsideSector(float x, float y);</tt> where <tt>x</tt> and <tt>y</tt> are east and north coordinated, in meters, relative to the geographic reference of the flight plan. If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS. It would be great if one would help improving that part of the source code.<br />
<br />
For example, with the following element in a flight plan.<br />
<source lang="xml"><br />
<sectors><br />
<sector name="MyCosySector" color="red"><br />
<corner name="_1"/><br />
<corner name="_2"/><br />
<corner name="_3"/><br />
<corner name="_4"/><br />
</sector><br />
</sectors><br />
</source><br />
<br />
It is then possible to write a exception. For example if the aircraft for some reason flies outside this sector the airframe will fly to a standby waypoint. The exclamation mark (!) means the boolean operator <tt>NOT</tt> in this example. In regular language one would describe "If my airframe is NOT inside the Murret sector anymore then deroute it to the standby waypoint." In Flightplan "Speak" this is written like: <br />
<source lang="xml"><br />
<exception cond="! InsideMyCosySector(estimator_x, estimator_y)" deroute="standby"/><br />
</source><br />
<br />
'''Tips'''<br />
* A nice option in the corner notation is that one can add an underscore in front of the name; a corner or waypoint name that starts with an underscore is not displayed in the GCS. Only in editor mode it is visible. It is visible in editor mode, because if you the could not see it, it also would be not possible to edit or drag the corner or waypoint to another position.<br />
* The color of the sector is not fixed but can be defined by oneself if wished for via the color attribute.<br />
<br />
== Includes ==<br />
<br />
<tt>include</tt> is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.<br />
Here is the structure:<br />
<tt><include name procedure> [<arg name value />]*[<with from to />]*</include></tt><br />
where <tt>name</tt> attribute of the include element will be used in this flight plan to prefix the blocks of the <tt>procedure</tt>, the XML referenced file.<br />
Named arguments may be given with their value in the <tt>arg</tt> elements. The <tt>with</tt> tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.<br />
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block <tt>b</tt> of a procedure named <tt>p</tt> is named <tt>b.p</tt> .<br />
<br />
Here is an example:<br />
<source lang="xml"><br />
<includes><br />
<include name="landing" procedure="landing.xml"/><br />
</includes><br />
</source><br />
<br />
== Blocks ==<br />
<br />
Block elements are the main part of a flight plan: they describe each unit of the mission.<br />
They are made of various primitives, called stages and exceptions, you can put one after the other. When a<br />
stage (or a block) is finished, the autopilot goes to the next one. The behaviour after the last stage of the last block is undefined.<br />
<br />
As described in the DTD, the <tt>blocks</tt> element is composed of <tt>block</tt> elements which are sequence of ''stages'':<br />
<source lang="xml"><br />
<!ELEMENT blocks (block+)><br />
<!ELEMENT block (exception|while|heading|attitude|go|xyz|set|circle|deroute|stay|follow|survey_rectangle)*><br />
</source><br />
<br />
Example:<br />
<source lang="xml"><br />
<block name="circlehome"><br />
<circle radius="75" wp="HOME"/><br />
</block><br />
</source><br />
<br />
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute <tt>strip_button</tt>:<br />
<source lang="xml"><br />
<block name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
This button will activate the block. If the attribute <tt>group</tt> is specified, all strip buttons of the same group will be placed vertically on top of each other.<br />
<br />
In the same way, a key shortcut can be specified:<br />
<source lang="xml"><br />
<block key="D" name="descent" strip_button="Descent"><br />
<circle wp="HOME" throttle="0.0" pitch="-15" vmode="throttle"/><br />
</block><br />
</source><br />
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].<br />
<br />
An icon can be specified to display the button. The <tt>strip_button</tt> label then is a tooltip for the icon. The icon must be an image file available in the directory <tt>data/pictures/gcs_icons</tt>:<br />
<source lang="xml"><block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff"></source><br />
<br />
You can call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
==== Expressions ====<br />
<br />
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to <br />
* numeric constants<br />
* some internal autopilot variables (not fully documented, see examples)<br />
* Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *<br />
* Some utility functions<br />
<br />
Some examples of usable expressions are given in the next sections.<br />
<br />
=== Exceptions ===<br />
<br />
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:<br />
<source lang="xml"><exception cond="..." deroute="..."></source><br />
where <tt>cond</tt> is an expression and <tt>deroute</tt> is the name of the block we want to switch to as soon as the condition is true.<br />
<br />
Here are some example of exceptions:<br />
<source lang="xml"><br />
<exception cond="10 > PowerVoltage()" deroute="go_down"/><br />
<exception cond="(ground_alt+10 > estimator_z)" deroute="go_up"/><br />
<exception cond="(estimator_flight_time > 840)" deroute="quick_land"/><br />
</source><br />
<br />
Exceptions can be local to a block or global to the flight plan, in the <tt><exceptions></tt> element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the <tt>Standby</tt> block if no message have been received for 22s. This exception is valid for '''all''' the blocks.<br />
<source lang="xml"><br />
<flight_plan ...><br />
<waypoints> ... </waypoints><br />
<exceptions><br />
<exception cond="datalink_time > 22" deroute="Standby"/><br />
</exceptions><br />
<blocks> ...<br />
</source><br />
<br />
=== Deroute ===<br />
<br />
The <tt>deroute</tt> is the ''goto'' directive of the flight plan; it switches the navigation to the given block:<br />
<source lang="xml"><deroute block="landing"/></source><br />
<br />
Note that this primitive should not be used to execute loops which are provided by the following elements.<br />
<br />
=== Loops ===<br />
<br />
Unbounded loops are written with <tt>while</tt> elements whose <tt>cond</tt> attribute is a boolean expression.<br />
Children of <tt>while</tt> are stages:<br />
<source lang="xml"><br />
<while cond="TRUE"><br />
<go wp="A"/><br />
<go wp="B"/> <br />
<go wp="C"/><br />
<while cond="5 > stage_time"/><br />
</while><br />
</source><br />
In this example, we run an infinite loop, lettin the aircraft try to go via waypoints <tt>A</tt>, <tt>B</tt> and <tt>C</tt> and waiting for 5 seconds before repeating.<br />
<br />
Bounded loops are written with the <tt>for</tt> tag:<br />
<source lang="xml"><br />
<for var="i" from="0" to="3"><br />
...<br />
</for><br />
</source><br />
where the body of the loop will be run four times.<br />
<br />
The variable of a <tt>for</tt> loop can be used inside expressions appearing as attributes of the stages:<br />
<source lang="xml"><br />
<for var="i" from="1" to="5"><br />
<circle wp="HOME" radius="75" alt="ground_alt+50*$i" until="stage_time>10" /><br />
</for><br />
</source><br />
<br />
In this example, the aircraft will circle around waypoint '''HOME''' for 10 seconds at and altitude above ground of 50m, 10 seconds at altitude 100 meter (50+50), ... until 250m (5x +50).<br />
<br />
Note: Two bounded loops using the same control variable are not allowed in the same block.<br />
<br />
=== Navigation modes ===<br />
<br />
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through<br />
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are<br />
* attitude : just keep a fixed attitude;<br />
* heading : keep a given course;<br />
* go : go to a given waypoint;<br />
* path : list of waypoints linked by ''go''<br />
* circle : circle around a waypoint;<br />
* stay : hold the position (hard to realize for a fixed-wing aircraft);<br />
* follow : follow another aircraft;<br />
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).<br />
<br />
The vertical control is achieved using the <tt>vmode</tt> attribute of these stages. The possible values are <br />
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the <tt>alt</tt> attribute;<br />
* '''climb''' : the autopilot keeps the desired vertical speed specified with the <tt>climb</tt> attribute (in m/s);<br />
* '''throttle''' : the autopilots sets the desired throttle specified with the <tt>throttle</tt> attribute (between 0 and 1);<br />
* '''glide''' : the autopilot keeps the desired slope between two waypoints<br />
<br />
The default control is done with the throttle. However, setting the <tt>pitch</tt> attribute to '''auto''' and the <tt>throttle</tt> attribute to a constant allows a vertical control only by controlling the attitude of the A/C.<br />
The <tt>pitch</tt> attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft. <br />
<br />
The different navigation modes are detailed in the next sections.<br />
<br />
=== Attitude ===<br />
<br />
Element <tt>attitude</tt> is the navigation mode which corresponds to the current lowest control loop for horizontal mode.<br />
The autopilot then keeps a constant attitude. The <tt>roll</tt> attribute is required (in degrees, positive to put right wing low).<br />
<br />
To fly away, at constant airspeed:<br />
<source lang="xml"><attitude roll="0" vmode="throttle", throttle="0.5"/></source><br />
<br />
To fly around, holding a given altitude:<br />
<source lang="xml"><attitude roll="30" alt="ground_alt+50"/></source><br />
<br />
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.<br />
<br />
=== Heading ===<br />
<br />
<tt>heading</tt> primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given <tt>course</tt>, a required attribute (in degrees, clockwise, north=0, east=90).<br />
<br />
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:<br />
<source lang="xml"><heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(estimator_z > ground_alt+30)"/></source><br />
<br />
=== Go ===<br />
<br />
The <tt>go</tt> primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (<tt>wp</tt>, the only required attribute). So the simplest thing you can ask for is<br />
<source lang="xml"><go wp="HOME"/></source><br />
which will set the '''HOME''' waypoint as the desired target position. Note than since <tt>vmode="alt"</tt> is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.<br />
<br />
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.<br />
Setting the <tt>hmode</tt> attribute to '''route''', the navigation will go over a segment joining two waypoints:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route"/></source><br />
<br />
The target altitude is the altitude of the target waypoint; it can also be set with the <tt>alt</tt> attribute. The following example keeps an altitude with fixed throttle:<br />
<source lang="xml"><go from="wp2" wp="wp3" hmode="route" pitch="auto" throttle="0.75" alt="ground_alt+100"/></source><br />
<br />
The attributes related to the vertical control can also be set to replace the default altitude mode:<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" vmode="climb" climb="1.5"/></source><br />
<br />
Finally, the <tt>approaching_time</tt> (in seconds) attribute helps to decide when the target is ''reached''. It can be set<br />
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).<br />
<source lang="xml"><go from="wp1" wp="wp2" hmode="route" approaching_time="1"/></source><br />
<br />
=== Path ===<br />
<br />
The <tt>path</tt> primitive is just a shorthand expression for a set of <tt>go</tt> primitives. A list of waypoints defined with the <tt>wpts</tt> attribute is pre-processed into a set of <tt>go</tt> primitives with the <tt>hmode</tt> attribute. For example:<br />
<source lang="xml"><path wpts="wp1, wp2, wp3"/></source><br />
<br />
Other attributes are optional:<br />
<source lang="xml"><path wpts="wp3, w1, wp2" approaching_time="1" pitch="auto" throttle="0.5"/></source><br />
<br />
=== Circle ===<br />
<br />
The <tt>circle</tt> primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:<br />
<source lang="xml"><circle wp="HOME" radius="75"/></source><br />
A positive radius makes the UAS move clockwise, a negative counter-clockwise.<br />
<br />
The <tt>until</tt> attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:<br />
<source lang="xml"><circle wp="wp1" radius="50+(estimator_z-ground_alt)/2" vmode="throttle" throttle="0.75" pitch="15" until="10>PowerVoltage()"/></source><br />
<br />
=== Follow ===<br />
<br />
The <tt>follow</tt> is a special primitive which makes the UAS follow another UAS (real or simulated, named with its <tt>ac_id</tt>) at a given <tt>distance</tt> (in meters) behind and at a given <tt>height</tt> (in meters) above.<br />
<br />
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.<br />
<source lang="xml"><follow ac_id="4" distance="50" height="20"/></source><br />
Note that the <tt>traffic_info.c</tt> file is required by this feature and the <tt>TRAFFIC_INFO</tt> flag has to be set to enable it. Then, the following lines must be added in the airframe file:<br />
<tt>ap.srcs += traffic_info.c</tt><br />
<tt>ap.CFLAGS += -DTRAFFIC_INFO</tt><br />
<tt>sim.srcs += traffic_info.c</tt><br />
<tt>sim.CFLAGS += -DTRAFFIC_INFO</tt><br />
<br />
=== Stay ===<br />
<br />
The <tt>stay</tt> is a mode for UAS's able to hover:<br />
<source lang="xml"><stay wp="HOME" alt="10"/></source><br />
<br />
=== XYZ ===<br />
<br />
<tt>xyz</tt> is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:<br />
* YAW channel controls the point over the west-east axis;<br />
* PITCH channel controls the point over the south-north axis;<br />
* ROLL channel controls the altitude.<br />
<br />
Example (default radius is '''100'''):<br />
<source lang="xml"><xyz radius="40"/></source><br />
<br />
=== Set ===<br />
<br />
The <tt>set</tt> element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):<br />
<source lang="xml"><set var="ground_alt" value="ground_alt+50"/></source><br />
This directive is extremely powerful and has great potential for error - use with caution.<br />
<br />
=== Call ===<br />
<br />
The <tt>call</tt> allows the user to define its own navigation procedures in C. The <tt>value</tt> must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).<br />
This feature is illustrated with the '''line''' pattern:<br />
<source lang="xml"><br />
<call fun="nav_line_init()"/><br />
<call fun="nav_line(WP_1, WP_2, nav_radius)"/><br />
</source><br />
where <tt>nav_line_init()</tt> returns FALSE and <tt>nav_line()</tt> always returns TRUE (this stage never ends).<br />
Such functions usually are defined in a supplementary C file which must be specified in the airframe file (in the <tt>makefile</tt> section)<br />
<tt>ap.srcs += nav_line.c<br />
sim.srcs += nav_line.c</tt><br />
These functions also must be declared in a header file which must be mentioned in the header element of the flight plan:<br />
<source lang="xml"><br />
<header><br />
#include "nav_line.h"<br />
</header><br />
</source><br />
These C source file and H header file must be located in the <tt>sw/airborne</tt> directory.<br />
<br />
You can also call functions before or after each execution of the block:<br />
<source lang="xml"><br />
<block name="circlehome" pre_call="function_to_call_before_circle()" post_call="function_to_call_after_circle()"><br />
<circle wp="HOME"/><br />
</block><br />
</source><br />
<br />
== Advanced Examples ==<br />
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:<br />
<source lang="xml"><br />
<for var = "i" from = "1" to = "5"><br />
<circle wp = "HOME" radius="75"<br />
alt = "ground_alt+50*$i"<br />
until = "stage_time>60" /><br />
</for><br />
</source><br />
<br />
=== Immobilize Actuators === <br />
<br />
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the<br />
h_ctl_disabled flag:<br />
<source lang="xml"><br />
<set var="h_ctl_disabled" value="TRUE"/><br />
<set var="h_ctl_aileron_setpoint" value="0"/><br />
<set var="h_ctl_elevator_setpoint" value="MAX_PPRZ/2"/><br />
.... waiting for a condition ...<br />
<set var="h_ctl_disabled" value="FALSE"/><br />
</source><br />
<br />
== Procedures ==<br />
<br />
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may contain some parameters which are replaced by arguments when the procedure is included.<br />
<br />
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:<br />
<source lang="xml"><!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)></source><br />
<br />
A <tt>param</tt>eter is just a name. A parameter is optional if it is declared with a default value.<br />
An example with a required and an optional parameter:<br />
<source lang="xml"><br />
<param name="alt"/><br />
<param name="radius" default_value="75"/><br />
</source><br />
<br />
Procedures are called with the <tt>include</tt> element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:<br />
<br />
* the name of the procedure file, the name given to this inclusion; <br />
* values for the parameters;<br />
* backlinks for block name exits of the procedure.<br />
<br />
For example:<br />
<source lang="xml"><include name="landing" procedure="landing.xml"/></source><br />
<br />
Here is the corresponding procedure '''landing.xml''':<br />
<source lang="xml"><br />
<!DOCTYPE procedure SYSTEM "flight_plan.dtd"><br />
<procedure><br />
<waypoints><br />
<waypoint name="AF" x="177.4" y="45.1" alt="30"/><br />
<waypoint name="TD" x="28.8" y="57.0" alt="0"/><br />
<waypoint name="_BASELEG" x="168.8" y="-13.8"/><br />
</waypoints><br />
<blocks><br />
...<br />
<block name="land"><br />
<call fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/><br />
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/><br />
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(estimator_z - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/><br />
</block><br />
...<br />
</blocks><br />
</procedure><br />
</source><br />
<br />
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':<br />
<source lang="xml"><deroute block="landing.land"/></source><br />
will jump to this procedure block.<br />
<br />
Suppose you have a go-around condition in your landing procedure. You would write it<br />
<source lang="xml"><exception cond="..." deroute="go-around"/></source><br />
then you must link this block exit with one of your block (e.g. <tt>Standby</tt>). So you would include the procedure as follows:<br />
<source lang="xml"><br />
<include name="landing" procedure="landing.xml"><br />
<with from="go-around" to="Standby"/><br />
</include><br />
</source><br />
<br />
== Tips and Tricks ==<br />
<br />
There are many ways to skin a cat just as there are many ways to craft your flight plan. Following the best practices tips can save you from a lot of frustration and mishap.<br />
<br />
* Simulate your flight plan before taking it to the sky. Flight plans should always be carefully tested prior to flight, take a look at the [[Simulation|simulation]] page for details on how to simulate your plan.<br />
* Make an subdirectory in the Flight_plan directory with your own name and add your flight plans there. Make sure that the location of the DTD is correct, e.g by using relative directory double dots as in <tt><!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd"></tt><br />
<br />
* Take a good look at other flight plans included with Paparazzi. To learn from example flight plans please visit the [[Flight_Plan_Examples|flight plan examples]] page<br />
* There are several option to build failsafe features into you flightplan, [[Failsafe|for some examples visit the Failsafe page]].<br />
* Some flight plan examples define waypoint locations using relative coordinates. These are relative positions from the fixed lat and lon in the header of the flight plan. When simulating your flight plan the aircraft always use the lat/lon as defined in the flight plan since a regular simulation has no notion of you current position of you local PC where you simulate on. This is something to keep in mind if you test your flight plan in real flights.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=File:Lisa_m_v2_0_sheet_3.png&diff=12729
File:Lisa m v2 0 sheet 3.png
2012-06-18T22:25:09Z
<p>Scdwyer: uploaded a new version of "File:Lisa m v2 0 sheet 3.png":&#32;after silkscreen/label changes R1</p>
<hr />
<div>LisaM V2.0 Schematic Sheet 3/3</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=File:Lisa_m_v2_0_sheet_2.png&diff=12728
File:Lisa m v2 0 sheet 2.png
2012-06-18T22:24:48Z
<p>Scdwyer: uploaded a new version of "File:Lisa m v2 0 sheet 2.png":&#32;after silkscreen/label changes R1</p>
<hr />
<div>LisaM V2.0 Schematic Sheet 2/3</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=File:Lisa_m_v2_0_sheet_1.png&diff=12727
File:Lisa m v2 0 sheet 1.png
2012-06-18T22:24:28Z
<p>Scdwyer: uploaded a new version of "File:Lisa m v2 0 sheet 1.png":&#32;after silkscreen/label changes R1</p>
<hr />
<div>LisaM V2.0 Schematic Sheet 1/3</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=12721
Installation/MacOSX
2012-06-17T22:22:11Z
<p>Scdwyer: /* Installing FlightGear */ updated info for fg2.6</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [http://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard-latest.dmg Snow Leopard] or [http://dl.dropbox.com/u/54220220/paparazzi-tools-Lion-latest.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
to start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here].<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
===How to run JSBSim simulations:===<br />
<br />
Please see [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations, with the following changes:<br />
<br />
* Install the JSBSim libraries onto your system. This should already be installed with <tt>paparazzi-tools</tt>, but if it isn't:<br />
<code>$ sudo port install jsbsim</code><br />
It uses code from the cvs repo, so it should be the most up-to-date source.<br />
<br />
* Compile your airframe for the jsbsim target. Launch the GCS and Server as per normal simulation. The simulation needs the <tt>-jsbsim</tt> option like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc</code><br />
<br />
The JSBSim simulation can be used with FlightGear visualization as described above, by adding the <tt>-fg 127.0.0.1</tt> option in addition, like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc -fg 127.0.0.1</code><br />
<br />
For information on using an optional initialization file for the simulation initial conditions and how to set the launch velocity, please see [[Simulation#Using_Optional_Parameters]].<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Simulation&diff=12720
Simulation
2012-06-17T22:16:48Z
<p>Scdwyer: /* View the simulation in Flight Gear */ need flag when using fg 2.4 or lower</p>
<hr />
<div>This page describes the steps needed to run a simulated flight with an UAS.<br />
<br />
==Compiling and starting==<br />
<br />
From the [[Paparazzi_Center|Paparazzi Center]] select the Microjet aircraft (from the '''A/C''' combo box) which is configured with the <tt>basic.xml</tt> flight plan. From the '''Target''' combo box, select <tt>sim</tt> and click the '''Build''' button to compile the airbone code to be run on your Linux box. From the '''Session''' combo box, select <tt>Simulation</tt> entry and click '''Execute''' to start the simulation. It will start <br />
three processes which are listed in the window below:<br />
* '''Microjet''' is the interface of a simulator program. It runs the same code as the one for the autopilot processor plus a rudimentary flight dynamic model. it allows you to test the interactions with the UAV and the flight plan execution.<br />
* '''GCS''' ([[GCS|Ground Control Station]]) is the main window. It displays the track of the aircraft, as well as informations about the execution of its flight plans. This program provide menus for the datalink functions and is able to edit a flight plan.<br />
* '''Server''' is a hidden process which won't be described here (see [[Overview|the architecture of the system]])<br />
<br />
== Start the Simulation ==<br />
<br />
The aircraft has automatically been booted, as if the autopilot board had been powered. Its position and its flight parameters are displayed in the GCS window. If you omit the -boot option of the sim the aircraft is not automatically booted and you can first place the aircraft where you want it to start from and then boot.<br />
<br />
The map widget is able use many map formats and display them according to many projections. To make things simple, we start by using images from [http://maps.google.com Google]. From the toolbar in the top right corner of the GCS, click the Google Earth icon ('''Google maps fill'''). The program attempts to download the required satellite images from the Google servers. If it succeeds, you should now see the nice countryside of Muret (a city close to Toulouse, France). Navigation and other features of the map are described on the [[GCS#map|GCS]] page.<br />
<br />
The lower part of the GCS displays the flight plan in a tree view. You see that the current flight plan is composed of several ''blocks'':<br />
* '''wait GPS''' and '''geo init''' which are instructions to run this flight plan anywhere in the world, by translating the waypoints around the current location of aircraft as soon as it is reported by the GPS.<br />
* '''Holding point''' (it should be the current active block) which instructs the autopilot to wait for launch. <br />
* '''Takeoff''' which will instruct the aircraft to climb full throttle to a security altitude<br />
* '''Standby''' which is a simple circle around the '''STDBY''' waypoint.<br />
<br />
Switch to the '''Takeoff''' block by a double click on the line or using the corresponding button (an icon figuring an airway) on the left side of the strip.<br />
<br />
== Fly ==<br />
<br />
In the Simulator ('''Microjet''' window), press the '''Launch''' button to simulate a hand launch or click the launch button in the GCS (the green aircraft icon). The autopilot detects the launch by monitoring the groundspeed. The flight time (in the aircraft label on the GCS) then starts to count.<br />
<br />
Position of the aircraft is displayed on the map: the aircraft goes to the '''CLIMB''' waypoint (to the norht-west) and then around the '''STDBY''' waypoint. Current block also changes accordingly in the flight plan display.<br />
<br />
The orange triangle (the carrot) on the map is the point that the aircraft is navigating toward.<br />
<br />
== Line ==<br />
<br />
Jump to this block with double-click on the <tt>Line 1-2</tt> line in the flight plan or using the corresponding button in the strip (figuring a blue line between two white points). The aircraft will try to follow a line joining the waypoints '''1''' and '''2''', doing nice U-turns at both ends.<br />
<br />
=== Move waypoints ===<br />
<br />
While the aircraft is flying (or here while the simulator is integrating differential equations), you can move the waypoints on the GCS interface by cliking and dragging (with the left button). When the mouse button is released, a popup window allows you to change the altitude of the waypoint. After validation, the waypoint changes are sent to the autopilot and the followed track is changed accordingly.<br />
<br />
=== Coming back around ===<br />
<br />
Select the '''Standby''' block (the ''home'' blue icon) to instruct the aircraft to fly around the '''STDBY''' waypoint.<br />
<br />
== Fly too far ==<br />
<br />
If you unzoom the map (using the PageDown key or he mouse wheel), you will see a large circle around the waypoints. This circle show the allowed flying zone that the autopilot must not leave or it will enter an emergency navigation mode and circles the '''HOME''' waypoint until the further direction is received.<br />
<br />
Move the waypoint '''2''' out of this circle (close to the circle in the north-east corner) and switch back to the 'Line 1-2''' block to force the plane to get out of this safety zone.<br />
<br />
The aircraft flies to the '''2''' waypoint, cross the protection enveloppe and switches to ''home'' mode: the AP mode in the aircraft strip switches from '''AUTO2''' to '''HOME'''.<br />
<br />
To get out of this mode and switch back to the default '''AUTO2''', click on the '''AUTO2''' button in the aircraft strip. The aircraft then flies again towards '''too far''' and again swithes to '''HOME''' mode.<br />
<br />
== Change the environment ==<br />
<br />
Launch the '''Environment Simulator''' from the '''Tools' menu in the '''Paparazzi Center'''.<br />
<br />
This interface (also called'''Gaia''') allows the user to change:<br />
* The wind: Set up a wind speed of 5m/s and observe the trajectory and the speed evolution (in the aircraft strip and in the '''PFD''' page of the notebook).<br />
* The GPS coverage: Shut down the GPS ('''GPS OFF''') and observe the resulting mode ('''NO_GPS''') and trajectory. In this mode, the autopilot uses the failsafe roll, pitch and throttle settings defined in the airframe file. Note that in a real flight, an aircraft without GPS won't be able to send its position ... The simulation is cheating here !<br />
* The time scale: If you are in a hurry ... Do not use a time higher than 2 for this first demonstration.<br />
<br />
== Other navigation patterns ==<br />
<br />
Using the buttons in the strip, you can play with other navigation patterns: figure of eights, oval, survey of a rectangle (with a north-south sweeping), ''Turn around here'' (which sets a waypoint to the current location of the plane and flies a circle around).<br />
<br />
== Landing ==<br />
<br />
To automatically land the aircraft:<br />
* Set the '''TD''' (Touch Down) waypoint where you want to land. Be sure that the waypoint is on the ground (185m in Muret)<br />
* Set the '''AF''' (Approach Fix) waypoint where you want to start the final descent (the ''glide''). If you have set some wind with Gaia, you probably want to fly '''AF-TD''' upwind (an estimation of the wind experienced by the aircraft is displayed in the left-upper corner of the map).<br />
* Switch to the '''Land right''' or the '''Land left''' block (icons in the strip) according to the direction of the last turn you want to do (for example, if '''AF''' is on the east side of '''TD''' and you want to maneuvre from the north, choose a '''Land right''') <br />
<br />
== Multiple UAV Simulation ==<br />
<br />
To simulate multiple aircrafts, you just have to launch a second simulator (tools->simulator, then -a yourairframe) and the server and the GCS should take care of the rest.<br />
<br />
== View the simulation in Flight Gear ==<br />
<br />
To view the simulation in Flight Gear, do the following:<br />
*in your root folder:<br />
sudo apt-get install flightgear<br />
*go to Paparazzi<br />
cd ~/paparazzi<br />
./paparazzi<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
* Launch Flight Gear with the following command:<br />
fgfs --fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:<br />
{{Box Code|conf/airframes/myplane.xml|<br />
<source lang="xml"><br />
<firmware name="fixedwing or rotorcraft"><br />
...<br />
<define name="FG_2_4" value="1"/><br />
...<br />
</firmware><br />
</source><br />
}}<br />
<br />
=== Why is it night in Flight Gear, if my sim is flying during the day? ===<br />
The time that is sent to Flight Gear is hard coded into the code, so if you try to view the output of the simulation and your simulated flight is located far from France, in Flight Gear, everything may be dark. If your simulated flight is in France, then you will always have daylight in Flight Gear. <br />
<br />
If you have flightgear 2.4 or higher adding the command line option<br />
<br />
--timeofday=noon<br />
<br />
to your flightgear options might solve your issue. <br />
<br />
If not, then fix this, do the following (you will need to have paparazzi-dev installed to do this):<br />
<br />
* Get the Unix time during your '''local daylight hours''' by running the following command in your terminal:<br />
date +%s<br />
* In the file: paparazzi/sw/simulator/fg.c find the line(line 44):<br />
msg.cur_time = 3213092700ul;//time(NULL);<br />
* Paste the output from "date +%s" in place of "3213092700"<br />
* Now you will have to rebuild paparazzi, so in the terminal change to the paparazzi directory and run:<br />
make clean<br />
make<br />
* In Paparazzi Center clean and rebuild your simulation<br />
* Launch the simulation and Flight Gear, and Flight Gear should be flying in daylight.<br />
<br />
== JSBSim ==<br />
Paparazzi can work with [http://jsbsim.sourceforge.net/ JSBSim], a great open source flight dynamics library. For instructions on JSBSIM on Mac OS X go [http://paparazzi.enac.fr/wiki/InstallationMacOSX#Simulations_Using_JSBSim here].<br />
<br />
==== For a fixed wing aircraft: ====<br />
<br />
Install JSBSim. This can be done from the CVS repository as per the [[BoozSimulator]] page, or using apt-get. For Natty and later distros:<br />
$ sudo apt-get install paparazzi-jsbsim<br />
For Maverick and earlier distros:<br />
$ sudo apt-get install jsbsim<br />
<br />
In your airframe file add the following section:<br />
<br />
<section name="SIMU"><br />
<define name="JSBSIM_MODEL" value="&amp;quot;Malolo1&amp;quot;"/><br />
<define name="JSBSIM_IR_ROLL_NEUTRAL" value="RadOfDeg(0.)"/><br />
<define name="JSBSIM_IR_PITCH_NEUTRAL" value="RadOfDeg(0.)"/><br />
</section><br />
<br />
In this case, the JSBSim model used is <tt>conf/simulator/Malolo1</tt>. To create your own model make a new directory under <tt>conf/simulator</tt> and put your JSBSim model there, and adapt the <tt>"JSBSIM_MODEL"</tt> in the <tt>SIMU</tt> section accordingly.<br />
<br />
Add another target to the <tt>"fixedwing"</tt> <tt>firmware</tt> section of your airframe file:<br />
<code><target name="jsbsim" board="pc" /></code><br />
<br />
If you choose to compile JSBSim from source from the CVS code repositor make sure you get a specific version<br />
<br />
$ cvs -z3 -d:pserver:anonymous@jsbsim.cvs.sourceforge.net:/cvsroot/jsbsim co -D "15 Jul 2011" -P JSBSim<br />
<br />
Go into your source JSBSim directory via<br />
<br />
$ cd JSBSim<br />
<br />
Then let automatically create the correct config before making, via <br />
<br />
$ ./autogen.sh --enable-libraries --enable-shared --prefix=/usr/<br />
<br />
ignre the configure: WARNING: unrecognized options: --enable-maintainer-mode, --enable-compile-warnings<br />
messages<br />
<br />
$ make clean <br />
$ make<br />
$ sudo make install<br />
<br />
And you need to add a <tt><makefile></tt> section to your airframe file and add the correct flags to point to the include files and libraries, depending on where it is installed.<br />
<br />
With the default installation to <tt>/usr/local/</tt>, this would look like<br />
<makefile location="after"><br />
jsbsim.CFLAGS += -I/usr/local/include/JSBSim<br />
jsbsim.LDFLAGS += -L/usr/local/lib<br />
</makefile><br />
<br />
<br />
<br />
Now you can can compile the airframe for the jsbsim target. Launch the simulator as normal, but add the option <tt>-jsbsim</tt>. Note that FlightGear visualization can be used in conjunction with the JSBSim simulation, just be sure to add the <tt>-fg 127.0.0.1</tt> option as described [[Simulation#View_the_simulation_in_Flight_Gear|above]]. Using both JSBSim and FlightGear, it would be:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc -fg 127.0.0.1</code><br />
<br />
You will notice the default control parameters do not fly the Malolo1 airframe particularly well.<br />
<br />
The Microjet aircraft can be used as an example; it has the right target and <tt>"SIMU"</tt> section added.<br />
<br />
==== Using Optional Parameters ====<br />
<br />
There are a few optional parameters that can be used with a JSBSim simulation.<br />
<br />
The initial body-aligned forward speed of the aircraft in m/s can be specified in the <tt>"SIMU"</tt> section of the airframe file:<br />
<br />
<section name="SIMU"><br />
...<br />
<define name="JSBSIM_LAUNCHSPEED" value="15.0"/><br />
...<br />
</section><br />
<br />
The initial conditions for the simulation can be set with an initialization file. Add the following to the <tt>"SIMU"</tt> section of the airframe file:<br />
<br />
<section name="SIMU"><br />
...<br />
<define name="JSBSIM_INIT" value="&amp;quot;Malolo1-IC&amp;quot;"/><br />
...<br />
</section><br />
<br />
In this case, the initialization file for the Malolo1 used is <tt>conf/simulator/Malolo1/Malolo1-IC.xml</tt>. To create your own initialization file, use this file as an example, place the file into your JSBSim model directory, and adapt <tt>"JSBSIM_INIT"</tt> in the <tt>SIMU</tt> section accordingly.<br />
<br />
These options are demonstrated in the jsbsim.xml example airframe file in <tt>/conf/airframes/jsbsim.xml</tt>. The control parameters in this example are much better in controlling the Malolo1 airframe.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=12622
Installation/MacOSX
2012-06-11T01:56:20Z
<p>Scdwyer: /* Basic Install */ added some troubleshooting info on how to deal with some PATH issues</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [http://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard-latest.dmg Snow Leopard] or [http://dl.dropbox.com/u/54220220/paparazzi-tools-Lion-latest.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
to start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
===Troubleshooting===<br />
<br />
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the <code>pkg-config</code> program. This can often be corrected by checking and adjusting your PATH environment variable.<br />
<br />
To check the currently configured default PATH:<br />
<source lang="bash"><br />
echo $PATH<br />
</source><br />
Ideally, the Paparazzi binary paths (<code>/opt/paparazzi/bin</code> and <code>/opt/paparazzi/sbin</code>) should come first. To move the Paparazzi paths to the highest search priority:<br />
<source lang="bash"><br />
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH<br />
</source><br />
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.4.0 was released. A binary for OS X is available, and seems to work properly on Snow Leopard (OS X 10.6.8). The binary released March 18, 2010 (2.0.0) installs and runs properly on OS X 10.6. Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here]. The Development Snapshot from August 21, 2010 does not seem as stable (did not work properly when tried on one machine).<br />
<br />
There is a patch available for crashes encountered on the splash screen, as detailed here: http://macflightgear.sourceforge.net/a-patch-that-prevents-fg-200-from-crash-on-launch-is-available<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
===How to run JSBSim simulations:===<br />
<br />
Please see [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations, with the following changes:<br />
<br />
* Install the JSBSim libraries onto your system. This should already be installed with <tt>paparazzi-tools</tt>, but if it isn't:<br />
<code>$ sudo port install jsbsim</code><br />
It uses code from the cvs repo, so it should be the most up-to-date source.<br />
<br />
* Compile your airframe for the jsbsim target. Launch the GCS and Server as per normal simulation. The simulation needs the <tt>-jsbsim</tt> option like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc</code><br />
<br />
The JSBSim simulation can be used with FlightGear visualization as described above, by adding the <tt>-fg 127.0.0.1</tt> option in addition, like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc -fg 127.0.0.1</code><br />
<br />
For information on using an optional initialization file for the simulation initial conditions and how to set the launch velocity, please see [[Simulation#Using_Optional_Parameters]].<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX&diff=12621
Installation/MacOSX
2012-06-11T01:47:10Z
<p>Scdwyer: /* Basic Install */ added info on using luftboot/pyusb</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Intro ==<br />
Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.<br />
<br />
The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.5.8, 10.6.*, 10.7.*.<br />
<br />
== Basic Install ==<br />
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.<br />
<ol><br />
The steps you need to take to enjoy Paparazzi are:<br />
<li>Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion</li><br />
<ol><br />
<li>With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools</li><br />
<li>Check that the correct version of Xcode is being used for compilation <source lang=bash>/usr/bin/xcodebuild -version</source> It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: <source lang=bash>sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer</source></li><br />
</ol><br />
<li>Install the Paparazzi Tools installer from [http://dl.dropbox.com/u/54220220/paparazzi-tools-SnowLeopard-latest.dmg Snow Leopard] or [http://dl.dropbox.com/u/54220220/paparazzi-tools-Lion-latest.dmg Lion]</li><br />
<li>That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.<br />
<ol><br />
<li>In spotlight type Terminal and then open the Terminal App</li><br />
<li>then type: <source lang="bash">cd ~/paparazzi && make && ./paparazzi</source></li><br />
</ol><br />
</li><br />
</ol><br />
Note that the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.<br />
<br />
===Basic Uninstall ===<br />
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:<br />
<br />
<source lang="bash">rm -rf ~/paparazzi</source><br />
<br />
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.<br />
<br />
<source lang="bash"><br />
sudo rm -rf /opt/paparazzi<br />
sudo rm -f /etc/paths.d/paparazzi<br />
</source><br />
<br />
===Using Luftboot and PyUSB===<br />
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.<br />
<br />
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:<br />
<source lang="bash"><br />
python<br />
</source><br />
to start the default Python. At the Python prompt (>>>) type:<br />
<source lang="bash"><br />
import usb<br />
</source><br />
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.<br />
<br />
===MacPorts and PyUSB===<br />
If you have MacPorts installed, you can install either <code>py26-pyusb</code>, <code>py26-pyusb-devel</code> or <code>py27-pyusb-devel</code>, depending on which Python(s) you have installed already, or wish to install. For example:<br />
<source lang="bash"><br />
sudo port selfupdate<br />
sudo port install py27-pyusb-devel<br />
</source><br />
<br />
To find out what versions of Python are available on your system (via MacPorts):<br />
<source lang="bash"><br />
port select --list python<br />
</source><br />
Default Apple Python versions have a -apple ending.<br />
<br />
Select a different version of python to be the active version if desired. For example:<br />
<source lang="bash"><br />
sudo port select --set python python27<br />
</source><br />
<br />
A good, working configuration would be to have MacPorts installed, and install <code>py27-pyusb-devel</code>, then ensure that python27 is the active version.<br />
<br />
== Installing from source ==<br />
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.<br />
<br />
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:<br />
<ol><br />
<li>check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command</li><br />
<source lang="bash">env</source><br />
<li>Then give the following command to make sure your ports are up-to-date</li><br />
<source lang="bash">sudo port selfupdate && sudo port upgrade outdated</source><br />
..great, you now can run the installation steps starting from step '''3''' below.<br />
</ol><br />
<br />
If you don't already have MacPorts installed run the following steps:<br />
<ol><br />
<li>Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]</li><br />
<li>Install [http://www.macports.org/install.php MacPorts]</li><br />
<li>Edit the file <source lang="bash">/opt/local/etc/macports/sources.conf</source> and above the <source lang="bash">rsync://...</source> line add <source lang="bash">rsync://rsync.paparazziuav.org/macports/ports/</source> It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: <br />
<source lang="bash">sudo nano /opt/local/etc/macports/sources.conf</source><br />
<li>Now update the available ports with the command:<br />
<source lang="bash">sudo port selfupdate</source><br />
<li>If you do not have your own copy of the paparazzi source then you now need to install paparazzi:<br />
<source lang="bash">sudo port install paparazzi</source> <br />
OR if you do already have your own copy of the paparazzi source and you want to keep in then the tools required by paparazzi can be installed with the command <br />
<source lang="bash">sudo port install paparazzi-tools</source><br />
</li><br />
<li>...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.</li><br />
</ol><br />
<br />
<br />
If you want to follow the standard Paparazzi [[Git]] install then the prerequisite software can be installed by running the command <source lang="bash">sudo port install paparazzi-tools</source><br />
<br />
=== Lion and XCode 4.3 or newer notes ===<br />
<br />
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.<br />
<br />
Also if macports is complaining about xcodebuild and that you should run<br />
<br />
# sudo xcode-select -switch /Applications/Xcode.app<br />
<br />
You should actually run<br />
<br />
#sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer<br />
<br />
so that xcodebuild can find the needed executables for you.<br />
<br />
=== Troubleshooting ===<br />
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.<br />
<br />
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
This was in fact the process used to check that the code installed on a clean machine.<br />
<br />
==== Upgrading to Lion ====<br />
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)<br />
To remedy this situation you need to do the following:<br />
# Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)<br />
# Install the Lion version of [http://www.macports.org/install.php MacPorts]<br />
# <source lang="bash">sudo port -f uninstall installed</source><br />
# <source lang="bash">sudo port clean --all uninstalled</source><br />
# <source lang="bash">sudo port selfupdate</source><br />
<br />
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:<br />
<br />
# <source lang="bash">sudo port install paparazzi-tools</source> or <source lang="bash">sudo port install paparazzi</source><br />
<br />
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.<br />
# Start console<br />
# Plug in your USB to serial converter<br />
You may get a message similar to this <source lang="bash">Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.</source><br />
<br />
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.<br />
<br />
=== Keeping source files for debugging ===<br />
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.<br />
<br />
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.<br />
<br />
For example:<br />
sudo port -k install paparazzi-tools<br />
This will result in all of the source and build artefact files being left on the hard disk.<br />
<br />
Should you later wish to clean up these files you can do so with the clean command.<br />
<br />
For example:<br />
sudo port clean installed<br />
<br />
=Running Paparazzi=<br />
<br />
Please see [[Installation]] for details on running Paparazzi, downloading source code from GitHub and updating software.<br />
<br />
Paparazzi can be started in the usual way<br />
cd ~/paparazzi<br />
./paparazzi<br />
<br />
=== Changing the GTK look and feel ===<br />
<br />
Run /opt/local/bin/switch2 to select a different theme.<br />
More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html<br />
<br />
Additional themes can be downloaded from http://art.gnome.org/themes/gtk2<br />
<br />
=== USB Drivers for Telemetry ===<br />
<br />
No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets. <br />
<br />
<br />
FTDI drivers can be downloaded from [http://www.ftdichip.com/Drivers/VCP.htm FTDI]<br />
<br />
The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA<br />
<br />
Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.<br />
# Remove all USB devices from the computer and run the command <code>ls -l /dev/*usb* /dev/*USB*</code> hopefully this will not list anything<br />
# Plug in your radio and repeat the command <code>ls -l /dev/*usb* /dev/*USB*</code> this should now list the serial port that the radio has been connected to. In my case I get<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD</pre><br />
# Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is <code>sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0</code><br />
# To check that everything is correct run the first command again <code>ls -l /dev/*usb* /dev/*USB*</code> and you should get something like this<br />
#: <pre> ls -l /dev/*usb* /dev/*USB*<br />
#: crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD<br />
#: crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD<br />
#: lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre><br />
<br />
<br />
Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.<br />
<br />
To unload the driver use the command<br />
sudo kextunload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.<br />
<br />
When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command<br />
sudo kextload/System/Library/Extensions/FTDIUSBSerialDriver.kext<br />
<br />
=== Workaround for Issues with errors (Device busy) when trying to program a Lisa/L ===<br />
====Programming the Lisa on OS X====<br />
<br />
The problem:<br />
The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. <br />
So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.<br />
<br />
The File (edit with a text editor):<br />
/System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist<br />
<br />
Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):<br />
quadzilla:Contents root# diff ~/Info.plist Info.plist <br />
1784,1805d1783<br />
< <key>FT2232C_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
1830,1853d1807<br />
< <key>FT2232H_B</key><br />
< <dict><br />
< <key>CFBundleIdentifier</key><br />
< <string>com.FTDI.driver.FTDIUSBSerialDriver</string><br />
< <key>ConfigData</key><br />
< <dict><br />
< <key>LatencyTimer</key><br />
< <integer>2</integer><br />
< </dict><br />
< <key>IOClass</key><br />
< <string>FTDIUSBSerialDriver</string><br />
< <key>IOProviderClass</key><br />
< <string>IOUSBInterface</string><br />
< <key>bConfigurationValue</key><br />
< <integer>1</integer><br />
< <key>bInterfaceNumber</key><br />
< <integer>1</integer><br />
< <key>bcdDevice</key><br />
< <integer>1792</integer><br />
< <key>idProduct</key><br />
< <integer>24592</integer><br />
< <key>idVendor</key><br />
< <integer>1027</integer><br />
< </dict><br />
<br />
Once you have edited the file<br />
- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/<br />
To reload the driver or you can just reboot.<br />
<br />
It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.<br />
<br />
==Installing FlightGear==<br />
FlightGear has been packaged for use on OS X. This package can be downloaded from:<br />
http://macflightgear.sourceforge.net/home/downloads/<br />
<br />
There are several packages available. Recently, FlightGear 2.4.0 was released. A binary for OS X is available, and seems to work properly on Snow Leopard (OS X 10.6.8). The binary released March 18, 2010 (2.0.0) installs and runs properly on OS X 10.6. Follow the directions [http://macflightgear.sourceforge.net/home/documents/users-guide/ here] for installation and basic usage. Additional documentation can be found [http://macflightgear.sourceforge.net/home/documents/ here]. The Development Snapshot from August 21, 2010 does not seem as stable (did not work properly when tried on one machine).<br />
<br />
There is a patch available for crashes encountered on the splash screen, as detailed here: http://macflightgear.sourceforge.net/a-patch-that-prevents-fg-200-from-crash-on-launch-is-available<br />
<br />
[[Image:Flightgear_launchgui_OSX_pprzoptions.png|thumb|350px|Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations]]<br />
Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the [[Simulation]] page.<br />
<br />
<br />
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:<br />
.../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc<br />
Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.<br />
* Launch Flight Gear with the following set in the others tab under advanced settings:<br />
--fdm=null --native-gui=socket,in,30,,5501,udp<br />
<br />
<br />
[[Image:Flightgear_pprz_sim_OSX.png|thumb|right|350px|Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)]]<br />
<br />
If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the [[Simulation#Why is it night in Flight Gear, if my sim is flying during the day?|Simulation]] page.<br />
<br />
==Simulations Using JSBSim==<br />
[http://jsbsim.sourceforge.net/index.html JSBSim] is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the [[Simulation|Simulation]] page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.<br />
<br />
===How to run JSBSim simulations:===<br />
<br />
Please see [[Simulation#JSBSim]] for instructions on how to use the JSBSim FDM in simulations, with the following changes:<br />
<br />
* Install the JSBSim libraries onto your system. This should already be installed with <tt>paparazzi-tools</tt>, but if it isn't:<br />
<code>$ sudo port install jsbsim</code><br />
It uses code from the cvs repo, so it should be the most up-to-date source.<br />
<br />
* Compile your airframe for the jsbsim target. Launch the GCS and Server as per normal simulation. The simulation needs the <tt>-jsbsim</tt> option like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc</code><br />
<br />
The JSBSim simulation can be used with FlightGear visualization as described above, by adding the <tt>-fg 127.0.0.1</tt> option in addition, like this:<br />
<code><paparazzi home directory>/sw/simulator/launchsitl -a <aircraft_name> -jsbsim -boot -norc -fg 127.0.0.1</code><br />
<br />
For information on using an optional initialization file for the simulation initial conditions and how to set the launch velocity, please see [[Simulation#Using_Optional_Parameters]].<br />
<br />
==Differences with the Linux version==<br />
This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.<br />
===Change of text editor===<br />
The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.<br />
<br />
===Ivy subnet mask===<br />
On Linux, the Ivy submask is 127.255.255.255<br />
<br />
On Mac OS X, the Ivy submask is 224.255.255.255<br />
<br />
<br />
<br />
In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:<br />
<br />
#ifdef __APPLE__<br />
printf("Mac OS, network submask: 224.255.255.255\n");<br />
IvyStart("224.255.255.255");<br />
#else<br />
printf("NO Mac OS, network submask: 127.255.255.255\n");<br />
IvyStart("127.255.255.255");<br />
#endif<br />
<br />
<br />
Is there a better way to do this?<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Lisa/M_v2.0&diff=12416
Lisa/M v2.0
2012-06-05T16:44:19Z
<p>Scdwyer: moved wiring diagrams to existing section</p>
<hr />
<div><div style="float: right; width: 15%"><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Autopilots</categorytree></div><br />
<div style="float: right; width: 45%; overflow: hidden">[[Image:LisaM_V2_0_TopView.JPG|right|500px|Lisa/M V2.0 top view]]</div><br />
<div style="float: right; width: 40%">__TOC__</div><br />
<br />
Lisa/M is a small, general purpose autopilot designed with flexibility across multiple applications in mind. Small weight and size, with (optional) integrated [[AspirinIMU | Aspirin IMU]] and full size 0.1" servo headers make the Lisa/M suitable for both fixed-wing and rotorcraft vehicles. This autopilot is based on the STM32 for improved peripherals and faster processing.<br />
<br />
A number of tutorials are being prepared for getting started with Lisa/M:<br />
* [[Lisa/M/Tutorial/FixedWing|Fixedwing tutorial]]<br />
* [[Lisa/M/Tutorial/RotorCraft|Rotorcraft tutorial]]<br />
<br />
== Hardware Revision History ==<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="6"<br />
!''Version #''!!''Release Date''!!''Release Notes''<br />
|-<br />
|v2.0(current)||03/2012||Updated Production Release<br />
|-<br />
|v1.1||MM/YYYY||Updated Prototype<br />
|-<br />
|v1.0||MM/YYYY||Initial Production Release<br />
|-<br />
|v0.1||MM/YYYY||Initial prototype of Lisa/M<br />
|}<br />
For detailed hardware revision history, please [[Lisa/M#Detailed_Hardware_Revision_History | see below]].<br />
<br />
== Features ==<br />
<br />
Lisa/M is based on the 64 pins STM32F105RCT6 [http://www.st.com/internet/mcu/product/221023.jsp connectivity line family] processor featuring 64k of RAM and 256k of FLASH. All the pins are exposed, providing access to the complete set of the STM32 peripherals.<br />
NOTE: This MCU is different from LISA/L. Lisa/L is based on the 64 pins STM32F103RE processor featuring 64k of RAM and 512k of FLASH, which is part of the [http://www.st.com/internet/mcu/product/164485.jsp high-density performance line family].<br />
<br />
* STM32 microcontroller [http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00220364.pdf STM32F105RCT6 datasheet] with 256kB flash and 64kB RAM<br />
* Pressure sensor [http://www.bosch-sensortec.com/content/language1/html/3477.htm BMP085]<br />
* 7 x Analog input channels<br />
* 3 x Generic digital in-/out-puts<br />
* 2 x 3.3V TTL UART (5V tolerant)<br />
* 8 x Servo PPM outputs (6 w/ second I2C bus in use)<br />
* 1 x CAN bus<br />
* 1 x [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] bus<br />
* 1 x [http://en.wikipedia.org/wiki/I2c I<sup>2</sup>C] bus (2 x when using only the first 6 Servo PPM outputs)<br />
* 1 x Micro USB<br />
* 4 x status LEDs with attached test point<br />
* 10.8 grams (0.4 oz) (with Aspirin IMU mounted)<br />
* 9.9 grams (0.35 oz) (without Aspirin IMU mounted)<br />
* ~34mm x ~60mm x ~10mm<br />
* 4 layers PCB design<br />
<br />
With mounted Aspirin IMU has the following additional sensors on board:<br />
<br />
* 3 Axis Gyroscope<br />
* 3 Axis Accelerometer<br />
* 3 Axis Magnetometer<br />
<br />
A BMP085 pressure sensor is mounted directly on the board in the first batch of boards as this sensor is not provided by first batch of Aspirin IMU yet. It is however possible to solder a MS5611 sensor on the Aspirin 2.x . To be able to use this baromeric sensor software will be written and likely available late 2012. It would be great to help out if you are able to. <br />
<br />
So, except for a GPS unit you have all necessary sensors for full attitude and altitude stabilization in an extremely small package.<br />
<br />
<gallery widths=200px heigths=200px><br />
Image:LisaM_V2_0_TopView.JPG|Lisa/M V2.0 top view<br />
Image:LisaM_V2_0_BottomView.JPG|Lisa/M V2.0 bottom view<br />
</gallery><br />
<br />
== Pinout ==<br />
Pins Name and Type are specified with respect to the Autopilot Board.<br />
<br />
<div style="float: right; width: 100%"><br />
[[Image:LisaM_V2_0_top_labeled.png|900px]]<br />
[[Image:LisaM_warning_label.png|200px]]<br />
</div><br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''SERVO1/2/3/4/5/6/7/8'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||SERVOx||OUT||Servo signal (PWM)(See Note 1 below)||style="background:Yellow; color:black"|Yellow<br />
|-<br />
|2||SV||PWR||Servo Bus Voltage Rail (conf w/ JP1)||style="background:red; color:white"|Red<br />
|-<br />
|3||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''JTAG'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||N/A||N/A||JTAG Debug Header (Pin 1 is +3V3)||style="background:white; color:black"|None<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART3'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2||V_IN||PWR||UART Voltage (conf w/ JP6 and JP7)||style="background:Red; color:white"|Red<br />
|-<br />
|3||TX||OUT||USART3 Serial Output (3.3V level)||style="background:Yellow; color:black"|Yellow<br />
|-<br />
|4||RX||IN||USART3 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style="background:Orange; color:white"|Orange<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART1/5'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style="background:Red; color:white"|Red<br />
|-<br />
|3||RX1||IN||USART1 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style="background:Orange; color:white"|Orange<br />
|-<br />
|4||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|5|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style="background:Red; color:white"|Red<br />
|-<br />
|6||RX5||IN||UART5 Serial Input (3.3V level)(Pullup to Pin 5 voltage)(5V tolerant)||style="background:Orange; color:white"|Orange<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''GPIO'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|4||PC12||I/O||GPIO, connected to PC12 (5V tolerant)||style="background:#FDC579; color:black"|Dark Tan<br />
|-<br />
|5||TRST||I/O||JTAG_TRST (also connected to LED1 cathode)||style="background:#FED6B1; color:black"|Light Tan<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''ANALOG2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|3|| +5V||PWR||5V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|4||ADC4||I/O||ADC4, by default connected to LED7 cathode (Remove LED/resistor to use as ADC)||style="background:magenta; color:white"|Magenta<br />
|-<br />
|5||ADC6||I/O||ADC6, by default connected to LED8 cathode (Remove LED/resistor to use as ADC)||style="background:#FFA1B2; color:black"|Pink<br />
|-<br />
|6||BOOT0||I/O||BOOT0||style="background:grey; color:black"|Grey<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''USB'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||N/A||N/A||USB (The USB connections are also available as 0.05" (1.27mm) through hole pads underneath the GPIO header)||style="background:white; color:black"|None<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''I2C1 CAN'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| V_BATT||PWR||V_BAT Bus on autopilot, voltage divider for V_BAT_MEAS, (conf w/ JP2 to connect to V_IN)||style="background:Red; color:white"|Red<br />
|-<br />
|3|| V_IN||PWR||Connected to autopilot voltage regulator inputs (conf w/ JP1, JP2 and JP3)||style="background:Red; color:white"|Red<br />
|-<br />
|4||CANL||I/O||CANL (5V level)||style="background:orange; color:white"|Orange<br />
|-<br />
|5||CANH||I/O||CANH (5V level)||style="background:yellow; color:black"|Yellow<br />
|-<br />
|6||SCL||I/O||SCL (5V level)(See Note 1 below)||style="background:green; color:white"|Green<br />
|-<br />
|7||SDA||I/O||SDA (5V level)(See Note 1 below)||style="background:blue; color:white"|Blue<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''SPI1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|3||MOSI||Out||MOSI||style="background:orange; color:white"|Orange<br />
|-<br />
|4||MISO||In||MISO||style="background:yellow; color:black"|Yellow<br />
|-<br />
|5||SCK||Out||SCK||style="background:green; color:white"|Green<br />
|-<br />
|6||SS||Out||SS||style="background:blue; color:white"|Blue<br />
|-<br />
|7||DRDY||I/O||DRDY||style="background:#FDC579; color:black"|Dark Tan<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''ANALOG1'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|3|| +5V||PWR||5V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|4||ADC1||In||ADC1||style="background:green; color:white"|Green<br />
|-<br />
|5||ADC2||In||ADC2||style="background:blue; color:white"|Blue<br />
|-<br />
|6||ADC3||In||ADC3||style="background:#FED6B1; color:black"|Light Tan<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||UART Voltage (conf w/ JP4 and JP5)||style="background:Red; color:white"|Red<br />
|-<br />
|3||TX||OUT||USART2 Serial Output (3.3V level)||style="background:Yellow; color:black"|Yellow<br />
|-<br />
|4||RX||IN||USART2 Serial Input (3.3V level)('''NOT 5V TOLERANT''')(Pullup to Pin 2 voltage)||style="background:Orange; color:white"|Orange<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''I2C2'''<br />
!width="7%"|''Pin #''!!width="10%"|''Name''!!width="10%"|''Type''!!''Description''!!width="5%"|''Color''<br />
|-<br />
|1||GND||PWR||common ground||style="background:black; color:white"|Black<br />
|-<br />
|2|| +3V3||PWR||3.3V Rail from autopilot||style="background:Red; color:white"|Red<br />
|-<br />
|3||SCL||I/O||SCL (3.3V level)||style="background:green; color:white"|Green<br />
|-<br />
|4||SDA||I/O||SDA (3.3V level)||style="background:blue; color:white"|Blue<br />
|}<br />
<br />
<br />
'''NOTE 1''': SERVO7 and SERVO8 are directly connected to I2C1_SCL and I2C1_SDA. As such, SERVO7 and SERVO8 '''CAN NOT''' be used while the second I2C bus (I2C1) also needs to be used for some reason.<br />
<br />
<br />
=== Jumper Configuration ===<br />
There are a number of jumpers on Lisa/M used to configure voltage levels and power input.<br />
<br />
The default configuration is UART3 VCC at V_IN, UART1/2/5 VCC at +3V3, with the V_SERVO servo voltage rail NOT connected to the autopilot V_IN rail, allowing one to power the autopilot and servos separately. The +5V regulator is NOT bypassed, allowing a regulated +5V on listed headers and for the CAN transceiver and I2C level shifter. The V_BAT connector is NOT connected to V_IN, so one can attach a battery voltage to the V_BAT pin to measure the battery voltage, if so desired.<br />
<br />
<gallery widths=380px heights=205px><br />
Image:LisaM_V2_0_top_jumpers_and_leds.png | Lisa/M v2.0 Top Jumpers and LEDs<br />
Image:LisaM_V2_0_bottom_jumpers.png | Lisa/M v2.0 Bottom Jumpers<br />
</gallery><br />
<br style="clear:both"><br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''Power Jumper Configuration'''<br />
!width="7%"|''Jumper''!!width="20%"|''Bus Connection''!!width="7%"|''Default''!!''Description''<br />
|-<br />
|JP1||SERVO_BUS to V_IN||OPEN||Connects servo header voltage rail SERVO_BUS to autopilot input voltage V_IN rail<br />
|-<br />
|JP2||V_BAT to V_IN||OPEN||Connects I2C1/CAN rail V_BAT to autopilot input voltage V_IN rail<br />
|-<br />
|JP3||V_IN to +5V||OPEN||Connects autopilot input voltage V_IN rail to autopilot +5V rail, bypassing onboard 5V supply<br />
|}<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART3 VCC Configuration'''<br />
!width="7%"|''Jumper''!!width="20%"|''Bus Connection''!!width="7%"|''Default''!!''Description''<br />
|-<br />
|JP6||UART3_VCC to V_IN||style="background:black; color:white"|CLOSED||Connects UART3 connector VCC to autopilot input voltage V_IN rail<br />
|-<br />
|JP7||UART3_VCC to +3V3||OPEN||Connects UART3 connector VCC to autopilot +3V3 rail<br />
|}<br />
'''WARNING: UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting!!!'''<br />
<br />
'''WARNING: DO NOT CLOSE BOTH JP6 AND JP7 SIMULTANEOUSLY!!!'''<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART2 VCC Configuration'''<br />
!width="7%"|''Jumper''!!width="20%"|''Bus Connection''!!width="7%"|''Default''!!''Description''<br />
|-<br />
|JP4||UART2_VCC to V_IN||OPEN||Connects UART2 connector VCC to autopilot input voltage V_IN rail '''SEE WARNING BELOW'''<br />
|-<br />
|JP5||UART2_VCC to +3V3||style="background:black; color:white"|CLOSED||Connects UART2 connector VCC to autopilot +3V3 rail<br />
|}<br />
'''WARNING: UART2 RX is NOT 5V TOLERANT. Thus, while possible to connect UART2_VCC to V_IN, DO NOT ATTEMPT THIS. Only use JP5 (the default).<br />
<br />
'''WARNING: DO NOT CLOSE BOTH JP4 AND JP5 SIMULTANEOUSLY!!!'''<br />
<br />
<br />
{|border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="70%"<br />
|+'''UART1 and UART5 VCC Configuration'''<br />
!width="7%"|''Jumper''!!width="20%"|''Bus Connection''!!width="7%"|''Default''!!''Description''<br />
|-<br />
|JP8||UART1&5_VCC to V_IN||OPEN||Connects UART1 and UART5 connector VCC to autopilot input voltage V_IN rail<br />
|-<br />
|JP9||UART1&5_VCC to +3V3||style="background:black; color:white"|CLOSED||Connects UART1 and UART5 connector VCC to autopilot +3V3 rail<br />
|}<br />
'''WARNING: DO NOT CLOSE BOTH JP8 AND JP9 SIMULTANEOUSLY!!!'''<br />
<br />
There are additional jumpers on the board for expert or developer configurations, please see [[Lisa/M_v20#Schematic|schematic]] and [[Lisa/M_v20#Downloads|layout]] for more information.<br />
<br />
=== Powering the Board ===<br />
<br />
[[Image:LisaM_warning_label.png|right|200px]]<br />
<br />
The 3.3V regulator on Lisa/M is a [http://www.micrel.com/page.do?page=/product-info/products/mic5209.shtml MIC5209-3.3YM] capable of delivering up to 500mA. While it is possible to power this regulator with up to 16V, '''DO NOT''' do this. By default, the UART3 RX pin is pulled up to the input voltage V_IN. For this reason, 5V is the maximum input voltage. Note that the UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting. If one desires to have V_IN at a higher voltage, the jumpers should be adjusted accordingly. As noted, this regulator can handle up to 16V, though experience has shown that this regulator can become very hot in operation with high input voltages, resulting in potential thermal shutdown while in flight. Depending on the expected current draw, it is best to power this regulator with a lower voltage. 5V is the perfect choice. <br />
<br />
The onboard 5V regulator on Lisa/M is a [http://www.national.com/pf/LP/LP2992.html LP2992], a low-noise, low-dropout linear regulator capable of delivering up to 250mA. This regulator can be bypassed with JP3, connecting the autopilot V_IN bus directly to the autopilot 5V bus if, for example, one is using an external 5V regulated supply, and a higher current is needed. Unless external use of 5V is required on the ANALOG1 and ANALOG2 headers, the only 5V usage onboard is for the CAN transceiver and the I2C1 level shifter.<br />
<br />
When measuring the supply voltage of a battery with the V_BAT pin (could be connected to V_IN through JP2), it is important to note the maximum voltage limit. The voltage divider on the board for measuring with a 3.3V ADC is --'''V_BAT'''--/\/\'''10k'''/\/\--'''V_BAT_MEAS'''--/\/\'''2k2'''/\/\--'''GND'''--. This means that the maximum allowable voltage on V_BAT is<br />
<br />
<math>V\_BAT_{max} = 3.3V*\frac{10k}{2.2k} = 15V</math><br />
<br />
If a higher voltage measurement is desired, another voltage divider is required off-board. Alternatively, one could modify the existing voltage divider (e.g. change 10k resistor to 22k to get 33V maximum). When checking if voltage exceeds the maximum, make sure to consider maximum battery voltage, not nominal voltage (e.g. 4.22V or so for a single lithium cell, not 3.7V nominal, so the maximum number of cells in series is 3, like a 3S LiPo pack).<br />
<br />
== Schematic ==<br />
<gallery widths=250px heights=168px><br />
Image:Lisa_m_v2_0_sheet_1.png | LisaM V2.0 Schematic Sheet 1/3<br />
Image:Lisa_m_v2_0_sheet_2.png | LisaM V2.0 Schematic Sheet 2/3<br />
Image:Lisa_m_v2_0_sheet_3.png | LisaM V2.0 Schematic Sheet 3/3<br />
</gallery><br />
<br style="clear:both"><br />
<br />
== Examples of Airborne Equipment Electrical Connections ==<br />
<br />
=== Quadrocopter, Spektrum Satellite Receivers and PWM Motor Controllers (ESC) ===<br />
<br />
[[File:LisaM_v2_0_wiring_quadrocopter_spektrum_pwmesc.png|700px]]<br />
<br />
When using cheap Chinese PWM motor controllers consider replacing their firmware with Simon Kirby firmware that you can find in his [https://github.com/sim-/tgy GitHub repository] to get useful performance of your multicopter!<br />
<br />
=== Quadrocopter, Spektrum Satellite Receivers and I2C Motor Controllers (ESC) ===<br />
<br />
[[File:LisaM_V2_0_quadrocopter_spektrum_i2c_esc_wiring.png|700px]]<br />
<br />
This diagram "should" be the same for AscTec as well as Mikrokopter motor controller based airframes.<br />
<br />
=== Fixedwing, Spektrum Satellite Receivers and Elevons Only ===<br />
<br />
[[File:LisaM_V2_0_wiring_fixedwing_spektrum_elevons.png|700px]]<br />
<br />
=== Fixedwing, Spektrum Satellite Receivers ===<br />
<br />
[[File:LisaM_V2_0_wiring_fixedwing_spektrum.png|700px]]<br />
<br />
=== Transitioning [http://wiki.thequadshot.com Quadshot] Using Spektrum Receivers ===<br />
<br />
[[File:LisaM_V2_0_wiring_quadshot_spektrum.png|700px]]<br />
<br />
<br />
Still need: Large Fixed-wing with advanced power system and/or IC engine, PPM example<br />
<br />
=== R/C Receivers ===<br />
There is Spektrum parser available already, enabling the direct use of 1 or 2 Spektrum satellite receivers.<br />
<br />
Also UART pins can be used as general purpose I/O to be used for PPM input. By default connect your PPM out able receiver to servo pin 6. If you do not have or cannot create a PPM out able receiver, additionally a [[PPM_Encoder | PPM encoder board]] can be used to avoid receiver hardware modification.<br />
<br />
== PCB ==<br />
<br />
=== Gerber & Drill Files ===<br />
<br />
'''''Download Lisa/M v2.0 gerber & drill files (zip)''''' ''NOT YET AVAILABLE BUT SEE [[Lisa/M#Downloads|Downloads]]''<br />
Need some generated gerbers and drill files here.<br />
<br />
== Assembly ==<br />
<br />
===Components Layout===<br />
<br />
''NOT YET AVAILABLE BUT SEE [[Lisa/M#Downloads|Downloads]]''<br />
Need some top and bottom of board images and line drawings here.<br />
<br />
=== Bill Of Material ===<br />
<br />
'''''Download Lisa/M v2.0 Bill Of Material (zipped .xls file)''''' ''NOT YET AVAILABLE BUT SEE [[Lisa/M#Downloads|Downloads]]''<br />
<br><br />
<br><br />
<br />
== PCB and assembled boards suppliers ==<br />
<br />
Available on [[Get_Hardware|Get Hardware]] page, hopefully :)<br />
<br />
<br />
== Mechanical Dimensions ==<br />
<br />
[[Image:LisaM_V2_0_top_mechanical.png|500px|Lisa/M v2.0 Mechanical Dimensions]]<br />
<br />
The overall height of the board including the servo connectors is 10mm. Note that the overall length includes the USB connector. The mounting holes are nominal 2mm diameter (with a bit of clearance).<br />
<br />
== Downloads ==<br />
<br />
'''Source files'''<br />
:*download available on GitHub: ''[https://github.com/paparazzi/paparazzi-hardware/tree/master/controller/lisa_m/v2.0 Lisa/M v2.0 Cadsoft Eagle 6 Design]''<br />
'''Gerber & Drill files'''<br />
:*download ''NOT YET AVAILABLE'' Need generated gerbers and drill files<br />
'''Assembly files'''<br />
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Components layouts (pdf)<br />
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Bill Of Material<br />
<br />
== Programming ==<br />
<br />
Lisa/M v2.0 can be programmed via its micro-USB port using the luftboot bootloader or with a JTAG via the 10-pin Samtec connector.<br />
All Lisa/M 2.0 from Transition Robotics Inc. come with luftboot preloaded.<br />
<br />
=== Using luftboot ===<br />
<br />
Paparazzi git dev branch already has support for the bootloader and will by default use the associated DFU loader to program the firmware. (Don't forget to check that your airframe file is set to use Lisa/M 2.0 as its target board)<br />
<br />
Currently Paparazzi firmware does not contain the needed USB stack stub to switch into bootloader mode using software.<br />
To force the bootloader to run, bridge ADC2 and GND by making up a connector.<br />
This won't be necessary in the future once the USB stack stub is added to Paparazzi.<br />
<br />
Once the bridge connector is attached, attach the Lisa/M to the PC via a micro-usb cable and it should start in bootloader mode, and the status LEDs will cycle up and down:<br />
<br />
[[File:Luftboot.gif|320px]]<br />
<br />
You can and should disconnect the bridge connector after enforcing the bootloader.<br />
Assuming your build target uses the Lisa/M board, pressing upload should now load code onto the board.<br />
<br />
If you overwrite/remove luftboot you can recover it by following the instructions below:<br />
<br />
=== Uploading the Paparazzi USB Bootloader ===<br />
<br />
This section describes the process on how to upload/recover the luftboot bootloader on your Lisa/M 2.0. It is not needed if you got your Lisa/M 2.0 from Transition Robotics Inc. as the boards come with luftboot preloaded.<br />
<br />
[https://github.com/paparazzi/luftboot Luftboot] is a Paparazzi-compatible bootloader for STM32-based autopilots.<br />
Depending on your vendor, your Lisa/M may already come with a bootloader, in which case you should skip to [[Lisa/M#Programming]]<br />
<br />
==== Required components ====<br />
*Floss-JTAG debugger<br />
*Lisa/M<br />
*PC<br />
<br />
==== Procedure ====<br />
<ol><br />
<li><br />
Checkout [https://github.com/paparazzi/luftboot Luftboot from Github]<br />
<source lang=bash>git clone https://github.com/paparazzi/luftboot.git</source><br />
</li><br />
<li><br />
Change directory into the luftboot/src folder<br />
<source lang=bash>cd ./luftboot/src</source><br />
</li><br />
<li><br />
Build luftboot<br />
<source lang=bash>make clean && make</source><br />
</li><br />
<li><br />
Flash the Lisa/M<br />
Attach the floss-jtag unit to the PC and connect it to the Lisa/M via the black connector.<br />
Power the Lisa/M (easiest way is to connect to the PC via a micro-USB cable).<br />
<source lang=bash>make flash DEV_SERIAL="LM2-ser"</source><br />
where "ser" stands for the serial number of your Lisa/M. So for example if you have lisa/m with the serial number 020 this would be:<br />
<source lang=bash>make clean && make flash DEV_SERIAL="LM2-020"</source><br />
</li><br />
</ol><br />
<br />
==== Connection Diagram ====<br />
<br />
<br />
==== Boot Sequence ====<br />
<br />
* Luftboot<br />
** Check if ADC2 is configured as output pull down indicating software bootloader request<br />
*** '''If ADC2 output pull down:''' initialize usb and stay in bootloader mode<br />
** Setting the ADC2 pin to input pull up<br />
** Checking if the ADC2 pin is low<br />
*** '''If ADC2 low:''' initialize USB and stay in bootloader mode<br />
*** '''If ADC2 high:''' check if there is a payload at 0x8002000<br />
**** '''If payload detected:''' set vector table pointer to be at 0x8002000 and jump to the reset handler of the payload<br />
**** '''If payload not detected:''' initialize USB and stay in bootloader mode<br />
<br />
<br />
==== Luftboot USB permissions ====<br />
<br />
stm32_mem.py needs permission to write to the the Luftboot USB device. (The error message is quite obscure due to the way python-libusb accesses the device)<br />
<br />
[[Installation/Linux#Udev_rules|Copy the udev-rules file]] get write permissions.<br />
<br />
=== JTAG ===<br />
If you are using the Lisa/M 2.0 target board you still can use JTAG for programming and debugging your paparazzi firmware. Using JTAG will not overwrite the bootloader by default. You need to set NO_LUFTBOOT config in your airframe file to force overwrite.<br />
<br />
* [[JTAG]] description;<br />
* General [[Dev/Debugging|debugging information]];<br />
* [[DevGuide/JTAG-Debug|JTAG usage]], includes Eclipse uplink tutorial.<br />
<br />
==== Quick JTAG Upload Guide ====<br />
# Connect floss-jtag to Lisa via the cortex cable (little black socket)<br />
# Attach the UART port on the bottom of the floss-jtag to UART2 on the Lisa.<br />
# Plug in USB port of the floss jtag<br />
# Plug in USB port of the Lisa<br />
# Make sure your airframe uses the <target name="ap" board="lisa_m_2.0"> definition<br />
# Click Build, wait until complete, then click Upload. You should see the following towards the end:<br />
{{{<br />
...<br />
Info : device id = 0x10016418<br />
Info : flash size = 256kbytes<br />
stm32x mass erase complete<br />
Info : Padding image section 1 with 7972 bytes<br />
wrote 152576 bytes from file src/paparazzi/var/Hexa_LisaL/ap/ap.elf in 7.498179s (19.871 KiB/s)<br />
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)<br />
Info : JTAG tap: stm32.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x0)<br />
shutdown command invoked<br />
}}}<br />
# Run Flight USB-serial at the baud rate you need (default 57600 for rotorcraft)<br />
# You may need to change the device to /dev/ttyUSB1, and 'Redo' the Data Link<br />
<br />
=== Serial Firmware Upload ===<br />
Firmware upload using the factory integrated bootloader can be useful e.g. if you have overwritten Luftboot accidentally and don´t have access to JTAG.<br />
<br />
Due to hardware constraints, the board has to be modified to make use of the bootloader, which is only accessible on UART1:<br />
# Diode D3 has to be removed (the bigger black brick next to the USB connector). Attention, no more powering via USB after that.<br />
# BOOT1 has to be set to GND by connecting ACC_DRDY(unused) to GND at the Aspirin pads<br />
<br />
Now a boot sequence works as follows:<br />
#BOOT1 has to be set to 3.3V by use of a jumper cable<br />
#Connect a 3,3V serial cable (FTDI, MAX232...) to UART1, the TX pin is USB_VBUS<br />
#Power the board and activate the bootloader program<br />
<br />
The according bootloader script can be found at :<br />
[https://github.com/jsnyder/stm32loader stm32loader from Github]<br />
<source lang=bash>git clone https://github.com/jsnyder/stm32loader.git</source><br />
<br />
To reload Luftboot, upload luftboot.bin<br />
<br />
Serial upload can also be used directly from paparazzi Center by adapting the right path in [https://github.com/paparazzi/paparazzi/blob/dev/conf/Makefile.stm32 Makefile.stm32] for the LOADER argument and setting <br />
<br />
<define name="FLASH_MODE" value="SERIAL"/> <br />
<br />
in the target section of the airframe configuration.<br />
<br />
== Detailed Hardware Revision History ==<br />
<br />
=== Changes Between v1.1 and v2.0 ===<br />
* Lots of silkscreen improvements<br />
* Added attributes to all parts to make the usage of bom-ex ulp possible.<br />
* Improved routing to allow teardropping<br />
* Fixed stm32f1, f2 and f4 compatibility circuit. (has to jump to ground not to 3v3)<br />
* Connected existing UART RX pullups to the respective connector power pins instead of 3v3. To prevent connecting 5V over IO pin to the 3v3 power rail.<br />
* Added pullups on all UART RX lines to prevent undesired floatation.<br />
* LED's are connected to 3v3 now. To make sure we don't have an issue with voltage tolerance on the gpio pins.<br />
* ...<br />
<br />
=== Changes Between v1.0 and v1.1 ===<br />
* Removed pull-ups on the USB gpio<br />
* Removed pull-ups on the CAN gpio<br />
* Connected usb_vbus to pa9 (needed by the USBotg)<br />
* Removed USB pullup transistor as usbotg has a built in pullup<br />
* Swapped UART1 with UART3 (uart1 was used for gps and pa9 was it's tx line, to be able to talk to the gps unit uart3 is a better choice, as uart1 only has an rx line now it is a better choice for spektrum RX modules)<br />
* Removed USART3 TX gpio from the GPIO connector and moved to the GPS connector<br />
* Added voltage selector jumpers to the RC RX connector; to enable powering of 3v3 or an 5v receivers<br />
* Replaced vertical board solution with through hole servo pin headers (easier assembly)<br />
* Servo connectors are in groups of two; for easier assembly<br />
* Servo VBUS is connected together on all four layers; for lower resistance<br />
* Moved LED's from under the analog2 connector; to be able to populate LED's and the connector<br />
* Moved the RC RX connector a bit; to prevent crashing with the jtag plug<br />
* Added one additional servo connector; now we have all 8 accessible through the standard servo connectors<br />
* Fixed servo channel labeling to start at '''S0''' as it is the case on TWOG and Tiny autopilot boards<br />
* Added secondary through hole picoblade USB connector for easier routing of USB inside an airframe<br />
* ...<br />
<br />
=== Changes Between v0.1 and v1.0 ===<br />
* Switched to stm32f105 to be able to use usb and can at the same time<br />
* Added alternative use of the adc lines as led output<br />
* ...<br />
<br />
=== Hardware Change Requests ===<br />
* REQ: Replace BMP085 with MS5611 (the MS5611 seems to be better in performance then the BMP but it is more expensive and seems to be more difficult to obtain. <br />
** A: This upgrade will be available through Aspirin v2.0 --[[User:Esden|Esden]] 22:54, 5 January 2012 (CET)<br />
<br />
* REQ: Replace 7 Pin CAN with molex with something less risky to be inserted in 7 Pin SPI in relation to powering the board via CAN molex.<br />
<br />
* REQ: Separate spot for external power if powered via separate battery. Realizing we can via Servo ports by Bridge J1 but still like to measure board voltage then and have a way to add power without mistakenly inject CAN Molex into SPI.<br />
<br />
[[Category:Lisa]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Autopilots&diff=12351
Autopilots
2012-05-18T16:25:09Z
<p>Scdwyer: added date introduced column to autopilot comparison matrix (not sure about accuracy)</p>
<hr />
<div>__NOTOC__<br />
__NOEDITSECTION__<br />
<br />
{|style="border-spacing:8px;margin:0px -8px" class="MainPageBG" style="width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;"<br />
|-valign="top"<br />
|<br />
<h3 style="-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] Autopilots<br />
</h3><br />
<div style="padding:6px;"><br />
{{Autopilots}}<br />
</div><br />
<!-- Start of right-column --><br />
| class="MainPageBG" style="width:70%;border:1px solid #cedff2;background-color:#f5fffa;vertical-align:top"|<br />
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#f5fffa"<br />
|-valign="top"<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">Paparazzi Autopilots</h2><br />
|-<br />
|Hardware support for Autopilot versions currently in use. <br />
|-<br />
|[[Image:tiny13_family_top_sm.jpg|center|400px|Tiny 1.1 autopilots on the "assembly line"]]<br />
|-<br />
|One of the great advantages of Paparazzi is support for multiple hardware designs. Historically, Paparazzi was based around ATMega MCUs, while current autopilots are designed around two primary processors:<br />
*STM32 series microcontrollers <br />
*LPC21xx series microcontrollers<br />
There are active and current autopilots designs using both architectures. Not all autopilots have the same capabilities, peripherals or features, but each has advantages in different applications.<br />
<br />
The STM32 architecture is relatively new and still has bugs to be worked out. This is more suited for developers who are comfortable with joining in and working out the issues. Currently, boards are designed around the STM32F1 series, but there is future upgrade path capabilities to the F2 and F4 series, giving way to feature rich processors with a variety of peripherals and speeds. Architecture-dependent firmware code is supported in part by [http://www.libopencm3.org libopencm3]. The [[Lisa]] autopilots use the STM32.<br />
<br />
The LPC21xx based boards use the LPC2148 and have been flying fixed wing and multi-rotors for many years. This architecture is more mature and stable but at the expense of speed and extra ports available on the newer STM32 series processors. The [[Tiny]] series, [[Booz]], [[TWOG/v1.0 | TWOG]], [[YAPA]] and [[Umarim_v10 | Umarim]] autopilots all use the LPC2148.<br />
<br />
Some autopilots have also been designed for close integration with small single-board computers, particularly those based on [[OMAP]] processors such as the [http://www.gumstix.com/ Gumstix] [https://www.gumstix.com/store/index.php?cPath=33 Overo] series. The [[Lisa/L]] and [[Classix]] boards are designed with this in mind, though other autopilots can be easily interfaced. Further information can be found [[OMAP|here]].<br />
<br />
A basic feature comparison table is presented to help in the autopilot hardware selection process. Stable well tested and used LPC or more cutting edge STM32 that requires some debugging.<br />
<br />
For information regarding architecture and firmware compatibility of various subsystems and modules, please see the appropriate [[Subsystems]] overview and [[Modules_list|Modules List]] pages.<br />
<br />
NOTE: The accuracy of this table '''may not be 100% correct''', the best resource is always hardware and software source files and individual autopilot pages.<br />
<br />
<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="100%"<br />
|+'''Autopilot<sup>1</sup> Feature Matrix'''<br />
| align="center" width="15%" style="background:#f0f0f0;"|'''Feature'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/L|Lisa/L v1.1]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/M_v20|Lisa/M v2.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Umarim_v10|Umarim v1.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Tiny/v2.11|Tiny v2.11]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[TWOG/v1.0|TWOG v1.0]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[YAPA/v2.0|YAPA v2.0]]'''<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''MCU'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Part'''||STM32F103RE||STM32F105RCT6||LPC2148||LPC2148||LPC2148||LPC2148<br />
|-<br />
| style="background:#f0f0f0;"|'''Clock'''||72MHz||72MHz||60MHz||60MHz||60MHz||60MHz<br />
|-<br />
| style="background:#f0f0f0;"|'''Flash'''||512kB||256kB||512kB||512kB||512kB||512kB<br />
|-<br />
| style="background:#f0f0f0;"|'''RAM<sup>2</sup>'''||64kB||64kB||32kB & 8kB||32kB & 8kB||32kB & 8kB||32kB & 8kB<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Onboard Sensors<sup>3</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''MEMS IMU'''||no||aspirin||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Baro'''||yes||yes||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Diff Pressure'''||yes||no||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''GPS'''||no||no||no||yes||no||no<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Input/Output<sup>4</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''UART'''||3 & 1RX||2 & 2RX||2||1||2||2<br />
|-<br />
| style="background:#f0f0f0;"|'''I2C'''||2||1 + 1<sup>5</sup>||2||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''SPI'''||2||1||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''ADC'''||3 (12bit)||3 + 2 (12bit)<sup>5</sup>||0 + 4 (10bit)<sup>6</sup>||8 (10bit)||8 (10bit)||6 (10bit)<br />
|-<br />
| style="background:#f0f0f0;"|'''PWM'''||6||6 + 2<sup>5</sup>||6||8||8||10<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Output'''||no||no||1||1||1||no<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Capture'''||1||0 + 1<sup>5</sup>||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''GPIO<sup>7</sup>'''||?||1||0 + 4<sup>6</sup>||2||2||1<br />
|-<br />
| style="background:#f0f0f0;"|'''Onboard LEDs'''||8||5||2||3||3||3<br />
|-<br />
| style="background:#f0f0f0;"|'''USB Peripheral'''||Onboard USB JTAG + UART||bootloader||bootloader||bootloader||bootloader||bootloader<br />
|-<br />
| style="background:#f0f0f0;"|'''CAN'''||1||1||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Other'''||Overo w/ I/O incl. USB Host||Aspirin footprint, JTAG header||||||||XBee connector, RS232 options<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Power Management'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Input'''||6.1V - 18V||5V - 16V||5.5V - 17V||6.1V - 18V||6.1V - 18V||6.1V - 18V<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Output'''||2.25@5V, 2.25A@3.3V, Other||500mA@3.3V, 250mA@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 2.25A@5V||1A@3.3V, 2.25A@5V||2x 1A@3.3V, 2.25A@5V<br />
|-<br />
| style="background:#f0f0f0;"|'''Software Switch'''||2||no||no||1||1||1<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Mechanical'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Size'''||~100mm x ~50mm||34mm x 60mm x 10mm||56mm x 25mm||70.8mm x 40mm||40.2mm x 30.5mm||80.0mm x 40.0mm?<br />
|-<br />
| style="background:#f0f0f0;"|'''Weight'''||?||9.9g - 10.8g||9g||24g||8g||23g w/ XBee?<br />
|-<br />
| style="background:#f0f0f0;"|'''Connector Style'''||Picoblade||Picoblade & 0.1" Servo||Picoblade||Picoblade||Picoblade||0.1" Headers<br />
|-<br />
| style="background:#f0f0f0;"|'''PCB Style'''||4-layer||4-layer||4-layer||2-layer||2-layer||2-layer<br />
|-<br />
| style="background:#f0f0f0;"|'''Mounting Holes'''||4x M3||4x 2mm||4x 2mm||no||no||4x M3<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Comments'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Comments'''||IMU and Overo Mount Location, Many Features||||||||No onboard sensors or RF systems can help deal with interference challenges||Onboard XBee connector allows clean and easy radio modem integration<br />
|-<br />
| style="background:#f0f0f0;"|'''Typical Usage'''||Advanced payload and controls development using Gumstix; fixed-wing or rotorcraft||Small, general purpose w/ IMU; fixed-wing or rotorcraft||Small, general purpose w/ IMU; fixed-wing||Small, general purpose w/ GPS; fixed-wing with external IR or IMU||Small, general purpose; fixed wing with all external sensors||0.1" headers means easier wiring, at the cost of weight<br />
|-<br />
| style="background:#f0f0f0;"|'''Date Introduced'''||Summer 2010||Winter 2012||Fall 2011||Fall 2007||Spring 2008||Spring 2011<br />
|-<br />
| style="background:#f0f0f0;"|'''Previous Versions'''||[[Lisa/L]] v1.0||[[Lisa/M_v10|Lisa/M v1.0]]|| ||[[Tiny/v1.1|Tiny v1.1]], [[Tiny/v0.99|Tiny v0.99]]|| ||[[YAPA/v1.0|YAPA v1.0]]<br />
|}<br />
<br />
'''Notes:'''<br />
<br />
'''1.''' Only the newest revisions of the more commonly used autopilots are listed<br />
<br />
'''2.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA<br />
<br />
'''3.''' The onboard sensors are almost always supplemented with external sensors. For example, TWOG can use an external IMU or IR sensors, and also needs an external GPS.<br />
<br />
'''4.''' Input/Outputs listed are generally those easily accessible on regular autopilot connectors, customization/hacks can modify available I/O, for example free an extra I2C on Tiny and TWOG<br />
<br />
'''5., 6.''' Some features use shared resources - denoted by X + Y where Y is shared - and cannot be used simultaneously<br />
<br />
'''5.''' Lisa/M v2.0 shared resources include: one I2C is shared with 2 PWM outputs, two ADCs are shared with LEDs, one RX only UART is shared with the PPM capture<br />
<br />
'''6.''' Umarim v1.0 shared resources include: 4 ADCs are shared with 4 GPIOs<br />
<br />
'''7.''' Usually other unused pins can be used for additional GPIO with some code modifications<br />
<br />
<br />
|-<br />
|<h2>When will the Schematics, CAD files, Gerber files, BOM be released?</h2><br />
|-<br />
|<h3>The hardware development and release process.</h3><br />
<br />
<P>8 June 2011 13:25:47 Antoine Drouin wrote on the mailing list:</P><br />
<br />
Schematics will be released ASAP, CAD files will come later. When ? I don't know.... Worst case would be when Joby Robotics releases a new version of the board, but I hope it will be sooner than that. <br />
<br />
Lisa/L CAD files have been released (http://svn.savannah.nongnu.org/viewvc/paparazzi-hardware/trunk/lisa/v1.1/?root=paparazzi ) 3 month ago. (...)<br />
<br />
I've started this project together with Pascal 8 years ago and since then I have dedicated my time to try and make it successful. I'm utterly convinced of the benefits of open source, but observing how Paparazzi grew over time, I came to the conclusion that hardware is a bit different than software... "gcc tiny.brd" is not going to make a board magically appear on your desktop. <br />
<br />
I'll list here some of my arguments in favor of releasing CAD files after the board is mature.<br />
# Unlike software, where an unskilled user can type make and get a piece of complex software to successfully build, assembling hardware requires tools and skills. Providing gerbers and BOM have lured a bunch of new users into believing otherwise and has created tons of frustration. I've myself fixed a number of badly assembled boards and I even recall that while helping debugging a board (so after assembly), discovering that the person had manufactured two layers PCBs instead of four layers. As the technology of the autopilot increases, this problem becomes more and more important.<br />
# The success of the project depends on the availability of affordable hardware. The price of hardware is directly and exponentially dependent on the number of manufactured units. If ten persons manufacture 10 boards each, the cost will be much higher than if one person manufactures 100.<br />
# Last and not least, the quality of assembly also depends very much on the number of manufactured units. Good quality can only be achieved through the use of automated placing and soldering, and those processes can only be used if the number of units reach a certain amount.<br />
<br />
|}<br />
|}<br />
<br />
[[Category:Hardware]] [[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Overview&diff=12347
Overview
2012-05-18T05:53:56Z
<p>Scdwyer: added pprz build workflow flowchart</p>
<hr />
<div>[[image:Paparazzi_System_overview.jpg|right|Paparazzi System Overview]]<br />
Paparazzi is a complete system of open source hardware and software for Unmanned Aircraft Systems (UAS), including both the airborne autopilot as well as complete ground station mission planning and monitoring software utilizing a bi-directional datalink for telemetry and control.<br />
<br />
<br />
== Aircraft ==<br />
<br />
Paparazzi was originally designed for use with fixed-wing aircraft, but has since been expanded to include rotorcraft and work is underway to properly support hybrid aircraft. The hardware required for each type of airframe is essentially the same, and software uses many of the same elements with some parts interchanged. For example, fixed-wing stabilization control loop requirements are different than rotorcraft, while a datalink driver is essentially identical.<br />
<br />
=== The Airframe ===<br />
<br />
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 20cm to 4.3m, and 100g to 25kg. 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.<br />
<br />
The Paparazzi software suite by default supports traditional fixed-wing and multicopter airframes. The customizability of the software and support for a variety of hardware results in a flexible system capable of controlling many airframe configurations. In addition, hybrid aircraft development is underway and with some effort, additional systems such as traditional helicopters, gliders, marine and ground vehicles could be added (though are currently not supported by default).<br />
<br />
The key components in a Paparazzi UAV are:<br />
* Main [[Autopilots|Autopilot]] Board<br />
* [[Sensors]], including:<br />
** Attitude Sensors<br />
*** [[IMU]], or<br />
*** [[IR]] sensors (fixed-wing only)<br />
** [[GPS]] Receiver<br />
** [[Sensors/Airspeed|Pressure]] sensors<br />
** Others: [[Sensors/Current|current]], sonar, etc.<br />
* [[Modems|Datalink Radio Modem]]<br />
* [[RC_Receivers_and_Radios|RC Receiver]] (safety link)<br />
* Actuators (servos)<br />
* Propulsion System (electric motor(s)/speed control(s) or IC engine(s))<br />
* Batteries<br />
* Payload (example: camera and video transmitter)<br />
<br />
In general, some components can be omitted or additional ones added, depending on the system requirements. For example, if no ground station is used (besides an RC transmitter), the datalink radio is not required.<br />
<br />
An example overview diagram of a fixed-wing system layout is presented. The classic MicroJet is illustrated here. Different configurations are certainly possible!<br />
{|<br />
|-<br />
| [[image:Paparazzi_Equiped_Aircraft.jpg|Paparazzi Equipped Fixed-wing Aircraft]]<br />
|<br />
* '''A'''utopilot Control Board<br />
* '''B'''attery<br />
* '''D'''atalink Radio-Modem & Antenna<br />
* '''G'''PS Receiver<br />
* '''I'''R Sensor Board (if no IMU)<br />
* '''M'''otor & Controller<br />
* '''R'''C Receiver & Antenna<br />
* '''S'''ervos<br />
* '''P'''ayload (Example: Camera & Video Transmitter)<br />
|}<br />
<br />
The [[Gallery|User's Gallery]] and [[Booz/UserList|Booz User List]] show some of the many Paparazzi aircraft.<br />
<br />
=== Airborne Electronics ===<br />
<br />
==== [[Autopilots|Controller Board]] ====<br />
<br />
Over the years, a large number of autopilot main boards have been designed and tested for use as part of the Paparazzi system. Historically, Atmel AVR MCUs were used, though this transitioned to Philips/NXP ARM7 LPC21xx microcontrollers. More recently, support for the STMicroelectronics STM32Fxxx series of microcontrollers has been introduced. These boards include one or two microcontrollers and the required connectors to handle the servos, motor controllers, sensors, RC receiver, radio modem, and a variety of payloads.<br />
<br />
All of the hardware design files are available under the GPL and/or CC-BY-SA licences in the [https://github.com/paparazzi/paparazzi-hardware hardware file repository].<br />
<br />
Each control board was designed to meet some specific application. As such, most boards (even old designs) are still actively used. The software side is maintained to support all of the different hardware (exception being obsolete AVR-based boards). Some boards have onboard sensors for tighter integration while others separate all sensors from the main board to help with challenges mounting equipment and overcoming EMI, RFI and/or mechanical vibration issues.<br />
<br />
Work has also been completed in integrating Linux-based single board computers such as the Gumstix product line. These devices provide the computing power required for very advanced aircraft control schemes or payloads.<br />
<br />
More details on the controller boards are available on the [[Autopilots]] page.<br />
<br />
==== [[Sensors]] ====<br />
<br />
Paparazzi autopilots can interface with virtually any type of sensor. Many are supported by default, and adding support for new sensors is relatively straightforward given the software framework.<br />
<br />
Again, any Paparazzi-designed hardware sources are available under the GPL and/or CC-BY-SA licences in the [https://github.com/paparazzi/paparazzi-hardware hardware file repository].<br />
<br />
===== Attitude =====<br />
<br />
Historically, fixedwing aircraft used 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. More recently, full inertial measurement solutions have been integrated into the fixedwing systems. Paparazzi also uses conventional inertial systems on rotorcraft. There is software sources for a wide variety of inertial systems, including inexpensive analog accelerometers and gyroscopes, small paparazzi-targeted purpose-built IMUs, or commercially available AHRS solutions.<br />
<br />
Some autopilots have an IMU integrated on board while others use an external IMU. All autopilot main boards support both inertial and IR attitude sensing solutions.<br />
<br />
See the [[IMU]] page and the [[IR]] page for more details.<br />
<br />
===== [[GPS]] =====<br />
<br />
Generally, a standard GPS receiver from [http://www.u-blox.com/ u-blox] is used, either as an external stand-alone unit , or as a fully integrated package, like in the [[Tiny]] series of autopilot. This brand of GPS receiver is used because of its high performance and very efficient binary protocol. While more expensive than some other GPS units, the tighter integration, lower parsing overhead and generally better quality data makes it more advantageous. Support is also available for MediaTek MT3329 chipsets with DIYDrones firmware. In addition, limited or experimental support is available for SkyTraq binary and traditional NMEA sentence GPS data.<br />
<br />
GPS is required for UAV localization. It is used in the autonomous navigation stages of flight control to enable waypoint navigation, as well as to supplement Attitude Heading and Reference System (AHRS) state estimates (especially in fixedwing aircraft).<br />
<br />
More details are available on the [[GPS]] page.<br />
<br />
===== [[Sensors|Other Sensors]] =====<br />
<br />
A wide variety of other sensors may be useful onboard a UAV, either as part of flight control or just for measurement. Some examples of currently supported sensor types include:<br />
* differential pressure (airspeed)<br />
* barometric pressure (altitude)<br />
* sonar (altitude)<br />
* current (energy consumption)<br />
* temperature and humidity (meteorological measurements)<br />
<br />
==== Communications ====<br />
<br />
Airborne hardware also includes communications devices: Radio Modem (Datalink) & RC Receiver (Safety Link).<br />
<br />
===== Telemetry and Datalink =====<br />
<br />
Any wireless device providing a serial link can be used for the telemetry and the telecontrol (Datalink). Historically, even audio-channel based telemetry has been used. Bi-directional communication is generally recommended, but not required in very special applications. The most common datalink device is the venerable XBee series of radio modem. Other systems include powerful long range radios such as the Digi 9XTend modules, cellular network communications or satellite communications with Iridium satellite modems.<br />
<br />
The telemetry part of the link (from aircraft to ground) is used to obtain status information about the UAV to aid an operator and monitor mission progress, as well as provide some payload data. The datalink or telecontrol part of the link (from ground to aircraft) is used to send commands to the aircraft and interact with a payload. Example: telemetry provides the current location of the aircraft with can be viewed on the GCS map in real time, while the datalink allows a user to move a waypoint on the ground to modify the path the aircraft will follow in real time.<br />
<br />
More details on communications hardware are available on the [[Modems]] page.<br />
<br />
===== Safety Link =====<br />
<br />
A traditional radio control transmitter and receiver pair is used to provide a manual control option for the UAV. The airborne hardware and software support the connection to a standard (patched) radio-control receiver. The autopilot reads output from the R/C receiver onboard the aircraft and decides what control mode is desired. When in manual mode, a safety pilot on the ground may use the R/C transmitter to control the aircraft. In the case of rotorcraft, some level of computer control is usually necessary to maintain stable flight, even under "manual" control. The Paparazzi manual bypass or "Fly-by-Wire" system has been finely tuned over many years and provides a reliable method of providing override control even though the autopilot always remains inline between R/C receiver and actuators.<br />
<br />
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.<br />
<br />
Paparazzi can support almost all types of R/C system.<br />
<br />
Further information can be found on the [[RC_Receivers_and_Radios]] page.<br />
<br />
==== Example Setups and Tutorials ====<br />
<br />
List coming soon!<br />
<br />
==== Getting Hardware ====<br />
<br />
Because the Paparazzi project is open source, anyone can manufacture their own hardware. Alternatively, if this isn't really an option due to time or expertise, various vendors offer Paparazzi hardware or other useful products.<br />
<br />
Please see the [[Get_Hardware]] page for details.<br />
<br />
=== Airborne Software ===<br />
<br />
<div id="buildworkflow"></div><br />
[[Image:Pprz_build_workflow.png|thumb|600px|Paparazzi Airborne Software Build Process]]<br />
<br />
The airborne portion of the software runs on the main autopilot control board.<br />
<br />
The Paparazzi autopilot provides the following features:<br />
<br />
==== Fixed-Wing ====<br />
* Manual control with the RC<br />
* RC receiver (PPM signal or Spektrum) decoding<br />
* Servos and motor controller (PWM signal) control<br />
* Control with augmented stability (named '''AUTO1''')<br />
* Autonomous navigation (named '''AUTO2''') in 3D, including<br />
** Waypoint navigation<br />
** Segment and circle navigation<br />
** Altitude hold, glide following<br />
** High level flight plan language execution (takeoff, landing, sequence, loops, surveys, goto, etc.)<br />
** Advanced failsafe configurations (geo-fencing, lost link behaviour, etc.)<br />
* Telemetry to the ground station (sensor data, navigation data, status information, etc.)<br />
* Telecontrol (datalink) from the ground station (navigation control, waypoint modifications, tuning, etc.)<br />
<br />
==== Rotorcraft ====<br />
<br />
Description coming soon!<br />
* <br />
<br />
==== Configuration ====<br />
<br />
The autopilot code is written in C and features a level of hardware abstraction. Paparazzi uses code generation to allow for easy configuration through XML files. This build process is [[#buildworkflow|illustrated here]]. The primary configuration files are the:<br />
* [[Airframe_Configuration|Airframe XML File]]<br />
** defines all autopilot parameters including hardware configurations and control loop settings<br />
* [[Flight_Plans|Flight Plan XML File]]<br />
** defines autonomous flight behaviours and high level failsafes<br />
In addition, the following files are also used (either default or modified):<br />
* [[Radio_Control|Radio XML File]]<br />
** describes valid radio behaviour, only for PPM R/C systems<br />
* [[Telemetry|Telemetry XML File]]<br />
** describes what messages are sent and rates<br />
* [[Settings|Settings XML Files]]<br />
** describes the available and valid settings for various autopilot parameters as seen in the GCS<br />
<br />
Code is segregated into two processes respectively handling the ''fly by wire'' (manual control) and the ''autopilot'' itself (stabilization and navigation). Usually, rotorcraft do not use a direct manual control mode as some level of computer-aided stabilization is often needed to maintain stable flight. In addition, onboard code is split between ''periodic tasks'' and ''event tasks''. Periodic tasks are scheduled time sensitive tasks executed at specific periodic intervals. Examples include navigation actions, control loops and periodic telemetry messages. Event tasks are carried out in response to something. For example, receiving new GPS data or a datalink message. The fly by wire process is always given priority.<br />
<br />
== Ground Control Station (GCS) ==<br />
<br />
The ground control station is where an operator interacts with an Unmanned Aircraft System. It generally consists of several parts, usually providing feedback about UAV activity, allowing command and control of the aircraft and providing a method of override control for the system.<br />
<br />
=== Ground Computer ===<br />
<br />
The software suite was developed to be run on a i386 architecture based on the [http://www.debian.org Debian GNU/linux] operating system. Currently, Ubuntu is a popular and well supported choice for Paparazzi, while Mac OS X is also supported. Selection of a computer will vary based on application, but a small notebook easy to take to the flying field with good battery life is typical.<br />
<br />
For more information on operating system options, please visit the [[Installation]] page.<br />
<br />
=== Ground Software ===<br />
<br />
Just as important as the software running onboard the main autopilot board in the air is the corresponding software on the GCS, providing the human interface for configuration, monitoring and control of the UAS.<br />
<br />
The Paparazzi software suite is fully featured with solid core functionality, easy customization and flexible extensibility. It supports all types of airframes, as well as multiple UAVs.<br />
<br />
The software suite mainly provides<br />
* compilation tools to produce the airborne software from the configurations and source code<br />
* a GUI to control and interact with the UAV(s) during flight as well as mission planning and simulation<br />
* a basic simulator to ease the development of flight plans and verify some airborne code behaviour<br />
* a data logging system with plot-based viewer for real-time and post-flight analysis<br />
* a number of utilities for communicating with the UAV and other agents<br />
* a number of tools for calibration, etc.<br />
* a control panel GUI for configuration and program management<br />
* an easy method of extending functionality with the Ivy Bus<br />
<br />
=== Groundside Datalink ===<br />
<br />
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), as described above in the [[#Telemetry_and_Datalink|Airborne Telemetry and Datalink]] section. 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.<br />
<br />
The ground side of the link usually consists of a matching radio modem, like an XBee, connected to the ground station computer over USB or serial port.<br />
<br />
=== Groundside Safety Link ===<br />
<br />
The ground side of the safety link usually consists of a radio control transmitter (and safety pilot). It is used to provide manual control of the aircraft, as described above in the [[#Safety_Link|Airborne Safety Link]] section.<br />
<br />
== System Architecture ==<br />
<br />
The following figure shows the main agents (processes or programs), of the system: one (or several) aircraft and the distributed ground architecture (usually distributed on a single computer):<br />
<br />
[[Image:Pprz_communication_agents.gif]]<br />
<br />
The UAV (in blue) is navigating autonomously and is monitored and controlled from the ground (in brown). The [[GCS|ground control station (GCS)]], or '''gcs''' agent, 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:<br />
* '''server''' - an agent that logs, distributes, and preprocesses these messages for the [[GCS]] and other agents<br />
* '''messages''' - a real-time numeric display of all telemetry data<br />
* A number of other useful agents, including:<br />
** a GCS-based flight plan editor to modify waypoints<br />
** a UAV [[Simulation|simulator]] to test flight plans and code modifications<br />
** a [[RTPlotter|real-time plotter]] for graphical telemetry data visualization<br />
** a [[Plotter|log plotter]] for graphical telemetry visualization after a flight<br />
<br />
All of these processes run simultaneously and each module is independently launched and configured from [[Paparazzi_Center]], where further detail can be found.<br />
<br />
First experiments with the system should be with the [[Simulation|'''simulator''']] where everything runs on a local machine. The configuration is then slightly different:<br />
<br />
[[Image:comm_sitl.gif]]<br />
<br />
Here the aircraft and its radio link are replaced by the [[Simulation|'''simulator''']]. An optional '''gaia''' agent is also available to introduce some environmental parameters such as wind, infrared contrast, GPS quality, and time scale reference.<br />
<br />
Because of the modular nature of the Paparazzi software suite, custom agents enhancing functionality are (relatively) easy to create and integrate with existing software. Some examples include:<br />
* a [[WeatherStationInterface|weather station interface]]<br />
* an external [[GPSd_position|gps position]] display<br />
* a [[Input2Ivy|joystick interface]] for controlling aircraft or payloads from the GCS<br />
<br />
== Payloads ==<br />
<br />
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<sup>2</sup>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. Some boards can also be connected to a [http://www.gumstix.com Gumstix Computer] for highly sophisticated payload software applications, as described in [[OMAP|OMAP Integration]].<br />
<br />
== Disclaimers ==<br />
<br />
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.<br />
<br />
Linux itself can pose quite a challenge to install, configure, and learn. 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.<br />
<br />
The Paparazzi software and hardware are distributed without any guarantee, in particular they are not certified by any national or international authorities. Before flying, please refer to your country national aviation regulation for Unmanned Aerial Systems, or the one of the country you intend to overfly.<br />
<br />
[[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=File:Pprz_build_workflow.png&diff=12346
File:Pprz build workflow.png
2012-05-18T05:27:33Z
<p>Scdwyer: Basic build process workflow.</p>
<hr />
<div>Basic build process workflow.</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=User:Scdwyer&diff=12345
User:Scdwyer
2012-05-17T21:56:14Z
<p>Scdwyer: got rid of overview scratch work</p>
<hr />
<div>== About Me ==<br />
* Name: Stephen Dwyer<br />
* Location: Edmonton, Alberta, Canada<br />
* Masters student in Mechanical Engineering at University of Alberta<br />
* Member of the [http://paparazzi.enac.fr/wiki/UAlberta_UASGroup University of Alberta UAS Group]<br />
* Contact: scdwyerATualbertaDOTca<br />
<br />
I have very little experience with Paparazzi thus far. I hope to remedy this in the near future, both for fun and (hopefully) as part of my Masters research. I have been following the wiki and mailing list for quite some time though.<br />
<br />
I began working with small unmanned aircraft systems with the U of A Aerial Robotics Group, where I was team lead for 2 years, co-team lead for 1 year, and attended 3 AUVSI Student UAS competitions. We used the Micropilot MP2128g in our systems, and I gained valuable experience understanding the difficulty of autonomous system integration.<br />
<br />
== Current Work ==<br />
I am working with two other students as part of a larger [http://paparazzi.enac.fr/wiki/UAlberta_UASGroup University of Alberta UAS Group] to prepare a small demonstration platform. This UAV platform will be the beginning of an attempt to foster UAS research at our university, and provide an initial starting point for researchers from a variety of disciplines and departments to begin research on unmanned aircraft systems directly, or, more likely, investigate payloads and applications.<br />
<br />
This unfortunately is taking most of my time (among other things like being a TA) and limits my personal system development. I am however looking forward to getting my Quadshot Expresso in the coming months!<br />
<br />
----<br />
= Scratch Area =<br />
----<br />
= Autopilot Feature Comparison Matrix =<br />
<br />
<br />
A basic feature comparison table is presented to help in the autopilot hardware selection process. Stable well tested and used LPC or more cutting edge STM32 that requires some debugging.<br />
<br />
For information regarding architecture and firmware compatibility of various subsystems and modules, please see the appropriate [[Subsystems]] overview and [[Modules_list|Modules List]] pages.<br />
<br />
NOTE: The accuracy of this table '''may not be 100% correct''', the best resource is always hardware and software source files and individual autopilot pages.<br />
<br />
<br />
<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="100%"<br />
|+'''Autopilot<sup>1</sup> Feature Matrix'''<br />
| align="center" width="15%" style="background:#f0f0f0;"|'''Feature'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/L|Lisa/L v1.1]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/M_v20|Lisa/M v2.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Umarim_v10|Umarim v1.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Tiny/v2.11|Tiny v2.11]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[TWOG/v1.0|TWOG v1.0]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[YAPA/v2.0|YAPA v2.0]]'''<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''MCU'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Part'''||STM32F103RE||STM32F105RCT6||LPC2148||LPC2148||LPC2148||LPC2148<br />
|-<br />
| style="background:#f0f0f0;"|'''Clock'''||72MHz||72MHz||60MHz||60MHz||60MHz||60MHz<br />
|-<br />
| style="background:#f0f0f0;"|'''Flash'''||512kB||256kB||512kB||512kB||512kB||512kB<br />
|-<br />
| style="background:#f0f0f0;"|'''RAM<sup>2</sup>'''||64kB||64kB||32kB & 8kB||32kB & 8kB||32kB & 8kB||32kB & 8kB<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Onboard Sensors<sup>3</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''MEMS IMU'''||no||aspirin||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Baro'''||yes||yes||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Diff Pressure'''||yes||no||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''GPS'''||no||no||no||yes||no||no<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Input/Output<sup>4</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''UART'''||3 & 1RX||2 & 2RX||2||1||2||2<br />
|-<br />
| style="background:#f0f0f0;"|'''I2C'''||2||1 + 1<sup>5</sup>||2||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''SPI'''||2||1||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''ADC'''||3 (12bit)||3 + 2 (12bit)<sup>5</sup>||0 + 4 (10bit)<sup>6</sup>||8 (10bit)||8 (10bit)||6 (10bit)<br />
|-<br />
| style="background:#f0f0f0;"|'''PWM'''||6||6 + 2<sup>5</sup>||6||8||8||10<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Output'''||no||no||1||1||1||no<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Capture'''||1||0 + 1<sup>5</sup>||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''GPIO<sup>7</sup>'''||?||1||0 + 4<sup>6</sup>||2||2||1<br />
|-<br />
| style="background:#f0f0f0;"|'''Onboard LEDs'''||8||5||2||3||3||3<br />
|-<br />
| style="background:#f0f0f0;"|'''USB Peripheral'''||Onboard USB JTAG + UART||bootloader||bootloader||bootloader||bootloader||bootloader<br />
|-<br />
| style="background:#f0f0f0;"|'''CAN'''||1||1||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Other'''||Overo w/ I/O incl. USB Host||Aspirin footprint, JTAG header||||||||XBee connector, RS232 options<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Power Management'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Input'''||6.1V - 18V||5V - 16V||5.5V - 17V||6.1V - 18V||6.1V - 18V||6.1V - 18V<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Output'''||2.25@5V, 2.25A@3.3V, Other||500mA@3.3V, 250mA@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 2.25A@5V||1A@3.3V, 2.25A@5V||2x 1A@3.3V, 2.25A@5V<br />
|-<br />
| style="background:#f0f0f0;"|'''Software Switch'''||2||no||no||1||1||1<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Mechanical'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Size'''||~100mm x ~50mm||34mm x 60mm x 10mm||56mm x 25mm||70.8mm x 40mm||40.2mm x 30.5mm||80.0mm x 40.0mm?<br />
|-<br />
| style="background:#f0f0f0;"|'''Weight'''||?||9.9g - 10.8g||9g||24g||8g||23g w/ XBee?<br />
|-<br />
| style="background:#f0f0f0;"|'''Connector Style'''||Picoblade||Picoblade & 0.1" Servo||Picoblade||Picoblade||Picoblade||0.1" Headers<br />
|-<br />
| style="background:#f0f0f0;"|'''PCB Style'''||4-layer||4-layer||4-layer||2-layer||2-layer||2-layer<br />
|-<br />
| style="background:#f0f0f0;"|'''Mounting Holes'''||4x ?mm||4x 2mm||4x 2mm||no||no||4x M3<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Comments'''<br />
|-<br />
| style="background:#f0f0f0;"| ||IMU and Overo Mount Location, Many Features||||||||||Onboard XBee connector allows clean and easy radio modem integration<br />
|}<br />
<br />
'''Notes:'''<br />
<br />
'''1.''' Only the newest revisions of the more commonly used autopilots are listed<br />
<br />
'''2.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA<br />
<br />
'''3.''' The onboard sensors are almost always supplemented with external sensors. For example, TWOG can use an external IMU or IR sensors, and also needs an external GPS.<br />
<br />
'''4.''' Input/Outputs listed are generally those easily accessible on regular autopilot connectors, customization/hacks can modify available I/O, for example free an extra I2C on Tiny and TWOG<br />
<br />
'''5., 6.''' Some features use shared resources - denoted by X + Y where Y is shared - and cannot be used simultaneously<br />
<br />
'''5.''' Lisa/M v2.0 shared resources include: one I2C is shared with 2 PWM outputs, two ADCs are shared with LEDs, one RX only UART is shared with the PPM capture<br />
<br />
'''6.''' Umarim v1.0 shared resources include: 4 ADCs are shared with 4 GPIOs<br />
<br />
'''7.''' Usually other unused pins can be used for additional GPIO with some code modifications<br />
<br />
----<br />
<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="2000"<br />
|+'''Autopilot<sup>1</sup> Feature Matrix'''<br />
| align="center" style="background:#f0f0f0;"|'''Autopilot Board'''<br />
| align="center" style="background:#f0f0f0;"|'''MCU'''<br />
| align="center" style="background:#f0f0f0;"|'''Onboard Sensors'''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|'''Input/Output'''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|'''Power Management'''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|'''Mechanical'''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" style="background:#f0f0f0;"|''''''<br />
| align="center" width="10%" style="background:#f0f0f0;"|'''Comments'''<br />
|- align="center" style="background:#f0f0f0;"<br />
| ''''''||'''Part'''||'''MEMS IMU'''||'''Baro'''||'''Diff Pressure'''||'''GPS'''||'''UART'''||'''I2C'''||'''SPI'''||'''ADC'''||'''PWM'''||'''PPM Output'''||'''PPM Capture'''||'''GPIO'''||'''Onboard LEDs'''||'''USB Peripheral'''||'''CAN'''||'''Other'''||'''Supply Input'''||'''Supply Output'''||'''Software Switch'''||'''Size'''||'''Weight'''||'''Connector Style'''||'''PCB Style'''||'''Mounting Holes'''||<br />
|-<br />
| Lisa/L v1.0||STM32F1||no||yes||yes||no||3 & 1RX||2||2||3 (12bit)||6||no||1||?||8||Onboard USB JTAG + UART||1||Overo w/ I/O incl. USB Host||6.1V - 18V||2.25@5V, 2.25A@3.3V, Other||2||~100mm x ~50mm||?||Picoblade||4-layer||4x M3||IMU and Overo Mount Location, Many Features<br />
|-<br />
| Lisa/L v1.1||STM32F1||no||yes||yes||no||3 & 1RX||2||2||3 (12bit)||6||no||1||?||8||Onboard USB JTAG + UART||1||Overo w/ I/O incl. USB Host||6.1V - 18V||2.25@5V, 2.25A@3.3V, Other||2||~100mm x ~50mm||?||Picoblade||4-layer||4x M3||IMU and Overo Mount Location, Many Features<br />
|-<br />
| Lisa/M v1.0||STM32F1||Aspirin||yes||no||no||2 & 2RX||1 + 1||1||3 + 2 (12bit)||7||no||0 + 1||2||3||needs mod||1||Aspirin footprint, JTAG header||5V - 16V||500mA@3.3V, 250mA@5V||no||33mm x 56mm x 10mm||9.9g - 10.8g||Picoblade + 0.1\" Servo||4-layer||4x 2mm||USB needs hardware mod to work<br />
|-<br />
| Lisa/M v2.0||STM32F1||Aspirin||yes||no||no||2 & 2RX||1 + 1||1||3 + 2 (12bit)||6 + 2||no||0 + 1||1||5||bootloader||1||Aspirin footprint, JTAG header||5V - 16V||500mA@3.3V, 250mA@5V||no||34mm x 60mm x 10mm||9.9g - 10.8g||Picoblade + 0.1\" Servo||4-layer||4x 2mm||<br />
|-<br />
| Booz||LPC2148||Booz||yes||no||Booz||2?||?||?||?||?||?||?||?||?||bootloader||no||?||?||?||?||?||?||Picoblade||?||?||Multi-board design<br />
|-<br />
| Umarim v1.0||LPC2148||yes||yes||no||no||2||2||1||0 + 4 (10bit)||6||1||1||0 + 4||2||bootloader||no||||5.5V - 17V||1A@3.3V, 1.5A@5V||no||56mm x 25mm||9g||Picoblade||4-layer||4x 2mm||<br />
|-<br />
| Tiny v0.99||LPC2148||no||no||no||yes||1||1||1||8 (10bit)||6||no||1||no||2||bootloader||no||Button, audio downlink||?||?||1?||?||?||Picoblade||?||no||Onboard GPS for cleaner integration<br />
|-<br />
| Tiny v1.1||LPC2148||no||no||no||yes||1||1||1||8 (10bit)||7||no||1||no||?||bootloader||no||Button||?V - 20V||?A@3.3V, 2A@5V||1?||63mm x 35mm||25g||Picoblade||4-layer||no||Onboard GPS for cleaner integration<br />
|-<br />
| Tiny v2.11||LPC2148||no||no||no||yes||1||1||1||8 (10bit)||8||1||1||2||3||bootloader||no||||6.1V - 18V||1A@3.3V, 2.25A@5V||1||70.8mm x 40mm||24g||Picoblade||2-layer||no||Onboard GPS for cleaner integration<br />
|-<br />
| TWOG v1.0||LPC2148||no||no||no||no||2||1||1||8 (10bit)||8||1||1||2||3||bootloader||no||||6.1V - 18V||1A@3.3V, 2.25A@5V||1||40.2mm x 30.5mm||8g||Picoblade||2-layer||no||Offboard GPS to address interference or special installation<br />
|-<br />
| YAPA v1.0||LPC2148||no||no||no||no||2||1||1||5 (10bit)||8||no||1||no||1||bootloader||no||XBee connector, RS232 options||6.1V - 18V||2x 1A@3.3V, 2.25A@5V||1||80.0mm x 40.0mm||23g w/ XBee||0.1\" Headers||2-layer||4x M3||Onboard XBee connector allows clean and easy radio modem integration<br />
|-<br />
| YAPA v2.0||LPC2148||no||no||no||no||2||1||1||6 (10bit)||10||no||1||1||3||bootloader||no||XBee connector, RS232 options||6.1V - 18V||2x 1A@3.3V, 2.25A@5V||1||80.0mm x 40.0mm?||23g w/ XBee?||0.1\" Headers||2-layer||4x M3||Onboard XBee connector allows clean and easy radio modem integration<br />
|-<br />
| Classix||LPC2148 x2||no||no||no||no||2||2||2||14 (10bit)||6||?||2||?||2||bootloader||no||Gumstix connector, audio downlink||5V||3.3V, 3.7V for Gumstix||no||89mm x 30mm||12g||Picoblade||?||4x ?mm||Dual MCU development board design<br />
|-<br />
| HB v1.0||LPC2148||yes||yes||yes||no||2||2||2||?||?||?||1||?||?||bootloader||no||||?||?||?||?||?||Picoblade||?||?||Multi-board design<br />
|}<br />
<br />
'''Notes:'''<br />
<br />
'''1.''' Only the newest revisions of the more commonly used autopilots are listed<br />
<br />
'''2.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA<br />
<br />
'''3.''' The onboard sensors are almost always supplemented with external sensors. For example, TWOG can use an external IMU or IR sensors, and also needs an external GPS.<br />
<br />
'''4.''' Input/Outputs listed are generally those easily accessible on regular autopilot connectors, customization/hacks can modify available I/O, for example free an extra I2C on Tiny and TWOG<br />
<br />
'''5., 6.''' Some features use shared resources - denoted by X + Y where Y is shared - and cannot be used simultaneously<br />
<br />
'''5.''' Lisa/M v2.0 shared resources include: one I2C is shared with 2 PWM outputs, two ADCs are shared with LEDs, one RX only UART is shared with the PPM capture<br />
<br />
'''6.''' Umarim v1.0 shared resources include: 4 ADCs are shared with 4 GPIOs<br />
<br />
'''7.''' Usually other unused pins can be used for additional GPIO with some code modifications<br />
<br />
----<br />
<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="30%"<br />
|+'''MCU Comparison'''<br />
| align="center" style="background:#f0f0f0;"|'''MCU'''<br />
| align="center" style="background:#f0f0f0;"|'''Clock'''<br />
| align="center" style="background:#f0f0f0;"|'''RAM'''<br />
| align="center" style="background:#f0f0f0;"|'''Flash'''<br />
| align="center" style="background:#f0f0f0;"|'''Used In'''<br />
|-<br />
| LPC2148<sup>1</sup>||60MHz||32kB + 8kB||512kB||All Others<br />
|-<br />
| STM32F103RE||72MHz||64kB||512kB||Lisa/L Series<br />
|-<br />
| STM32F105RCT6||72MHz||64kB||256kB||Lisa/M Series<br />
|}<br />
<br />
'''Notes:'''<br />
<br />
'''1.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Overview&diff=12344
Overview
2012-05-17T21:39:35Z
<p>Scdwyer: Major re-work of System Overview, please check for errors, still need rotorcraft sw features and maybe a few more pictures/diagrams</p>
<hr />
<div>[[image:Paparazzi_System_overview.jpg|right|Paparazzi System Overview]]<br />
Paparazzi is a complete system of open source hardware and software for Unmanned Aircraft Systems (UAS), including both the airborne autopilot as well as complete ground station mission planning and monitoring software utilizing a bi-directional datalink for telemetry and control.<br />
<br />
<br />
== Aircraft ==<br />
<br />
Paparazzi was originally designed for use with fixed-wing aircraft, but has since been expanded to include rotorcraft and work is underway to properly support hybrid aircraft. The hardware required for each type of airframe is essentially the same, and software uses many of the same elements with some parts interchanged. For example, fixed-wing stabilization control loop requirements are different than rotorcraft, while a datalink driver is essentially identical.<br />
<br />
=== The Airframe ===<br />
<br />
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 20cm to 4.3m, and 100g to 25kg. 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.<br />
<br />
The Paparazzi software suite by default supports traditional fixed-wing and multicopter airframes. The customizability of the software and support for a variety of hardware results in a flexible system capable of controlling many airframe configurations. In addition, hybrid aircraft development is underway and with some effort, additional systems such as traditional helicopters, gliders, marine and ground vehicles could be added (though are currently not supported by default).<br />
<br />
The key components in a Paparazzi UAV are:<br />
* Main [[Autopilots|Autopilot]] Board<br />
* [[Sensors]], including:<br />
** Attitude Sensors<br />
*** [[IMU]], or<br />
*** [[IR]] sensors (fixed-wing only)<br />
** [[GPS]] Receiver<br />
** [[Sensors/Airspeed|Pressure]] sensors<br />
** Others: [[Sensors/Current|current]], sonar, etc.<br />
* [[Modems|Datalink Radio Modem]]<br />
* [[RC_Receivers_and_Radios|RC Receiver]] (safety link)<br />
* Actuators (servos)<br />
* Propulsion System (electric motor(s)/speed control(s) or IC engine(s))<br />
* Batteries<br />
* Payload (example: camera and video transmitter)<br />
<br />
In general, some components can be omitted or additional ones added, depending on the system requirements. For example, if no ground station is used (besides an RC transmitter), the datalink radio is not required.<br />
<br />
An example overview diagram of a fixed-wing system layout is presented. The classic MicroJet is illustrated here. Different configurations are certainly possible!<br />
{|<br />
|-<br />
| [[image:Paparazzi_Equiped_Aircraft.jpg|Paparazzi Equipped Fixed-wing Aircraft]]<br />
|<br />
* '''A'''utopilot Control Board<br />
* '''B'''attery<br />
* '''D'''atalink Radio-Modem & Antenna<br />
* '''G'''PS Receiver<br />
* '''I'''R Sensor Board (if no IMU)<br />
* '''M'''otor & Controller<br />
* '''R'''C Receiver & Antenna<br />
* '''S'''ervos<br />
* '''P'''ayload (Example: Camera & Video Transmitter)<br />
|}<br />
<br />
The [[Gallery|User's Gallery]] and [[Booz/UserList|Booz User List]] show some of the many Paparazzi aircraft.<br />
<br />
=== Airborne Electronics ===<br />
<br />
==== [[Autopilots|Controller Board]] ====<br />
<br />
Over the years, a large number of autopilot main boards have been designed and tested for use as part of the Paparazzi system. Historically, Atmel AVR MCUs were used, though this transitioned to Philips/NXP ARM7 LPC21xx microcontrollers. More recently, support for the STMicroelectronics STM32Fxxx series of microcontrollers has been introduced. These boards include one or two microcontrollers and the required connectors to handle the servos, motor controllers, sensors, RC receiver, radio modem, and a variety of payloads.<br />
<br />
All of the hardware design files are available under the GPL and/or CC-BY-SA licences in the [https://github.com/paparazzi/paparazzi-hardware hardware file repository].<br />
<br />
Each control board was designed to meet some specific application. As such, most boards (even old designs) are still actively used. The software side is maintained to support all of the different hardware (exception being obsolete AVR-based boards). Some boards have onboard sensors for tighter integration while others separate all sensors from the main board to help with challenges mounting equipment and overcoming EMI, RFI and/or mechanical vibration issues.<br />
<br />
Work has also been completed in integrating Linux-based single board computers such as the Gumstix product line. These devices provide the computing power required for very advanced aircraft control schemes or payloads.<br />
<br />
More details on the controller boards are available on the [[Autopilots]] page.<br />
<br />
==== [[Sensors]] ====<br />
<br />
Paparazzi autopilots can interface with virtually any type of sensor. Many are supported by default, and adding support for new sensors is relatively straightforward given the software framework.<br />
<br />
Again, any Paparazzi-designed hardware sources are available under the GPL and/or CC-BY-SA licences in the [https://github.com/paparazzi/paparazzi-hardware hardware file repository].<br />
<br />
===== Attitude =====<br />
<br />
Historically, fixedwing aircraft used 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. More recently, full inertial measurement solutions have been integrated into the fixedwing systems. Paparazzi also uses conventional inertial systems on rotorcraft. There is software sources for a wide variety of inertial systems, including inexpensive analog accelerometers and gyroscopes, small paparazzi-targeted purpose-built IMUs, or commercially available AHRS solutions.<br />
<br />
Some autopilots have an IMU integrated on board while others use an external IMU. All autopilot main boards support both inertial and IR attitude sensing solutions.<br />
<br />
See the [[IMU]] page and the [[IR]] page for more details.<br />
<br />
===== [[GPS]] =====<br />
<br />
Generally, a standard GPS receiver from [http://www.u-blox.com/ u-blox] is used, either as an external stand-alone unit , or as a fully integrated package, like in the [[Tiny]] series of autopilot. This brand of GPS receiver is used because of its high performance and very efficient binary protocol. While more expensive than some other GPS units, the tighter integration, lower parsing overhead and generally better quality data makes it more advantageous. Support is also available for MediaTek MT3329 chipsets with DIYDrones firmware. In addition, limited or experimental support is available for SkyTraq binary and traditional NMEA sentence GPS data.<br />
<br />
GPS is required for UAV localization. It is used in the autonomous navigation stages of flight control to enable waypoint navigation, as well as to supplement Attitude Heading and Reference System (AHRS) state estimates (especially in fixedwing aircraft).<br />
<br />
More details are available on the [[GPS]] page.<br />
<br />
===== [[Sensors|Other Sensors]] =====<br />
<br />
A wide variety of other sensors may be useful onboard a UAV, either as part of flight control or just for measurement. Some examples of currently supported sensor types include:<br />
* differential pressure (airspeed)<br />
* barometric pressure (altitude)<br />
* sonar (altitude)<br />
* current (energy consumption)<br />
* temperature and humidity (meteorological measurements)<br />
<br />
==== Communications ====<br />
<br />
Airborne hardware also includes communications devices: Radio Modem (Datalink) & RC Receiver (Safety Link).<br />
<br />
===== Telemetry and Datalink =====<br />
<br />
Any wireless device providing a serial link can be used for the telemetry and the telecontrol (Datalink). Historically, even audio-channel based telemetry has been used. Bi-directional communication is generally recommended, but not required in very special applications. The most common datalink device is the venerable XBee series of radio modem. Other systems include powerful long range radios such as the Digi 9XTend modules, cellular network communications or satellite communications with Iridium satellite modems.<br />
<br />
The telemetry part of the link (from aircraft to ground) is used to obtain status information about the UAV to aid an operator and monitor mission progress, as well as provide some payload data. The datalink or telecontrol part of the link (from ground to aircraft) is used to send commands to the aircraft and interact with a payload. Example: telemetry provides the current location of the aircraft with can be viewed on the GCS map in real time, while the datalink allows a user to move a waypoint on the ground to modify the path the aircraft will follow in real time.<br />
<br />
More details on communications hardware are available on the [[Modems]] page.<br />
<br />
===== Safety Link =====<br />
<br />
A traditional radio control transmitter and receiver pair is used to provide a manual control option for the UAV. The airborne hardware and software support the connection to a standard (patched) radio-control receiver. The autopilot reads output from the R/C receiver onboard the aircraft and decides what control mode is desired. When in manual mode, a safety pilot on the ground may use the R/C transmitter to control the aircraft. In the case of rotorcraft, some level of computer control is usually necessary to maintain stable flight, even under "manual" control. The Paparazzi manual bypass or "Fly-by-Wire" system has been finely tuned over many years and provides a reliable method of providing override control even though the autopilot always remains inline between R/C receiver and actuators.<br />
<br />
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.<br />
<br />
Paparazzi can support almost all types of R/C system.<br />
<br />
Further information can be found on the [[RC_Receivers_and_Radios]] page.<br />
<br />
==== Example Setups and Tutorials ====<br />
<br />
List coming soon!<br />
<br />
==== Getting Hardware ====<br />
<br />
Because the Paparazzi project is open source, anyone can manufacture their own hardware. Alternatively, if this isn't really an option due to time or expertise, various vendors offer Paparazzi hardware or other useful products.<br />
<br />
Please see the [[Get_Hardware]] page for details.<br />
<br />
=== Airborne Software ===<br />
<br />
The airborne portion of the software runs on the main autopilot control board.<br />
<br />
The Paparazzi autopilot provides the following features:<br />
<br />
==== Fixed-Wing ====<br />
* Manual control with the RC<br />
* RC receiver (PPM signal or Spektrum) decoding<br />
* Servos and motor controller (PWM signal) control<br />
* Control with augmented stability (named '''AUTO1''')<br />
* Autonomous navigation (named '''AUTO2''') in 3D, including<br />
** Waypoint navigation<br />
** Segment and circle navigation<br />
** Altitude hold, glide following<br />
** High level flight plan language execution (takeoff, landing, sequence, loops, surveys, goto, etc.)<br />
** Advanced failsafe configurations (geo-fencing, lost link behaviour, etc.)<br />
* Telemetry to the ground station (sensor data, navigation data, status information, etc.)<br />
* Telecontrol (datalink) from the ground station (navigation control, waypoint modifications, tuning, etc.)<br />
<br />
==== Rotorcraft ====<br />
<br />
Description coming soon!<br />
* <br />
<br />
==== Configuration ====<br />
<br />
The autopilot code is written in C and features a level of hardware abstraction. Paparazzi uses code generation to allow for easy configuration through XML files. The primary configuration files are the:<br />
* [[Airframe_Configuration|Airframe XML File]]<br />
** defines all autopilot parameters including hardware configurations and control loop settings<br />
* [[Flight_Plans|Flight Plan XML File]]<br />
** defines autonomous flight behaviours and high level failsafes<br />
In addition, the following files are also used (either default or modified):<br />
* [[Radio_Control|Radio XML File]]<br />
** describes valid radio behaviour, only for PPM R/C systems<br />
* [[Telemetry|Telemetry XML File]]<br />
** describes what messages are sent and rates<br />
* [[Settings|Settings XML Files]]<br />
** describes the available and valid settings for various autopilot parameters as seen in the GCS<br />
<br />
Code is segregated into two processes respectively handling the ''fly by wire'' (manual control) and the ''autopilot'' itself (stabilization and navigation). Usually, rotorcraft do not use a direct manual control mode as some level of computer-aided stabilization is often needed to maintain stable flight. In addition, onboard code is split between ''periodic tasks'' and ''event tasks''. Periodic tasks are scheduled time sensitive tasks executed at specific periodic intervals. Examples include navigation actions, control loops and periodic telemetry messages. Event tasks are carried out in response to something. For example, receiving new GPS data or a datalink message. The fly by wire process is always given priority.<br />
<br />
== Ground Control Station (GCS) ==<br />
<br />
The ground control station is where an operator interacts with an Unmanned Aircraft System. It generally consists of several parts, usually providing feedback about UAV activity, allowing command and control of the aircraft and providing a method of override control for the system.<br />
<br />
=== Ground Computer ===<br />
<br />
The software suite was developed to be run on a i386 architecture based on the [http://www.debian.org Debian GNU/linux] operating system. Currently, Ubuntu is a popular and well supported choice for Paparazzi, while Mac OS X is also supported. Selection of a computer will vary based on application, but a small notebook easy to take to the flying field with good battery life is typical.<br />
<br />
For more information on operating system options, please visit the [[Installation]] page.<br />
<br />
=== Ground Software ===<br />
<br />
Just as important as the software running onboard the main autopilot board in the air is the corresponding software on the GCS, providing the human interface for configuration, monitoring and control of the UAS.<br />
<br />
The Paparazzi software suite is fully featured with solid core functionality, easy customization and flexible extensibility. It supports all types of airframes, as well as multiple UAVs.<br />
<br />
The software suite mainly provides<br />
* compilation tools to produce the airborne software from the configurations and source code<br />
* a GUI to control and interact with the UAV(s) during flight as well as mission planning and simulation<br />
* a basic simulator to ease the development of flight plans and verify some airborne code behaviour<br />
* a data logging system with plot-based viewer for real-time and post-flight analysis<br />
* a number of utilities for communicating with the UAV and other agents<br />
* a number of tools for calibration, etc.<br />
* a control panel GUI for configuration and program management<br />
* an easy method of extending functionality with the Ivy Bus<br />
<br />
=== Groundside Datalink ===<br />
<br />
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), as described above in the [[#Telemetry_and_Datalink|Airborne Telemetry and Datalink]] section. 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.<br />
<br />
The ground side of the link usually consists of a matching radio modem, like an XBee, connected to the ground station computer over USB or serial port.<br />
<br />
=== Groundside Safety Link ===<br />
<br />
The ground side of the safety link usually consists of a radio control transmitter (and safety pilot). It is used to provide manual control of the aircraft, as described above in the [[#Safety_Link|Airborne Safety Link]] section.<br />
<br />
== System Architecture ==<br />
<br />
The following figure shows the main agents (processes or programs), of the system: one (or several) aircraft and the distributed ground architecture (usually distributed on a single computer):<br />
<br />
[[Image:Pprz_communication_agents.gif]]<br />
<br />
The UAV (in blue) is navigating autonomously and is monitored and controlled from the ground (in brown). The [[GCS|ground control station (GCS)]], or '''gcs''' agent, 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:<br />
* '''server''' - an agent that logs, distributes, and preprocesses these messages for the [[GCS]] and other agents<br />
* '''messages''' - a real-time numeric display of all telemetry data<br />
* A number of other useful agents, including:<br />
** a GCS-based flight plan editor to modify waypoints<br />
** a UAV [[Simulation|simulator]] to test flight plans and code modifications<br />
** a [[RTPlotter|real-time plotter]] for graphical telemetry data visualization<br />
** a [[Plotter|log plotter]] for graphical telemetry visualization after a flight<br />
<br />
All of these processes run simultaneously and each module is independently launched and configured from [[Paparazzi_Center]], where further detail can be found.<br />
<br />
First experiments with the system should be with the [[Simulation|'''simulator''']] where everything runs on a local machine. The configuration is then slightly different:<br />
<br />
[[Image:comm_sitl.gif]]<br />
<br />
Here the aircraft and its radio link are replaced by the [[Simulation|'''simulator''']]. An optional '''gaia''' agent is also available to introduce some environmental parameters such as wind, infrared contrast, GPS quality, and time scale reference.<br />
<br />
Because of the modular nature of the Paparazzi software suite, custom agents enhancing functionality are (relatively) easy to create and integrate with existing software. Some examples include:<br />
* a [[WeatherStationInterface|weather station interface]]<br />
* an external [[GPSd_position|gps position]] display<br />
* a [[Input2Ivy|joystick interface]] for controlling aircraft or payloads from the GCS<br />
<br />
== Payloads ==<br />
<br />
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<sup>2</sup>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. Some boards can also be connected to a [http://www.gumstix.com Gumstix Computer] for highly sophisticated payload software applications, as described in [[OMAP|OMAP Integration]].<br />
<br />
== Disclaimers ==<br />
<br />
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.<br />
<br />
Linux itself can pose quite a challenge to install, configure, and learn. 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.<br />
<br />
The Paparazzi software and hardware are distributed without any guarantee, in particular they are not certified by any national or international authorities. Before flying, please refer to your country national aviation regulation for Unmanned Aerial Systems, or the one of the country you intend to overfly.<br />
<br />
[[Category:User_Documentation]]</div>
Scdwyer
http://wiki.paparazziuav.org/w/index.php?title=Autopilots&diff=12343
Autopilots
2012-05-17T21:29:00Z
<p>Scdwyer: updated the comparison table a bit, added some extra usage/version columns</p>
<hr />
<div>__NOTOC__<br />
__NOEDITSECTION__<br />
<br />
{|style="border-spacing:8px;margin:0px -8px" class="MainPageBG" style="width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;"<br />
|-valign="top"<br />
|<br />
<h3 style="-moz-border-radius-topright: 0.7em;<br />
background:#cedff2;margin:-2px;padding:4px;"><br />
[[Image:favicon32.png|32px]] Autopilots<br />
</h3><br />
<div style="padding:6px;"><br />
{{Autopilots}}<br />
</div><br />
<!-- Start of right-column --><br />
| class="MainPageBG" style="width:70%;border:1px solid #cedff2;background-color:#f5fffa;vertical-align:top"|<br />
{|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top;background-color:#f5fffa"<br />
|-valign="top"<br />
| <h2 style="margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;">Paparazzi Autopilots</h2><br />
|-<br />
|Hardware support for Autopilot versions currently in use. <br />
|-<br />
|[[Image:tiny13_family_top_sm.jpg|center|400px|Tiny 1.1 autopilots on the "assembly line"]]<br />
|-<br />
|One of the great advantages of Paparazzi is support for multiple hardware designs. Historically, Paparazzi was based around ATMega MCUs, while current autopilots are designed around two primary processors:<br />
*STM32 series microcontrollers <br />
*LPC21xx series microcontrollers<br />
There are active and current autopilots designs using both architectures. Not all autopilots have the same capabilities, peripherals or features, but each has advantages in different applications.<br />
<br />
The STM32 architecture is relatively new and still has bugs to be worked out. This is more suited for developers who are comfortable with joining in and working out the issues. Currently, boards are designed around the STM32F1 series, but there is future upgrade path capabilities to the F2 and F4 series, giving way to feature rich processors with a variety of peripherals and speeds. Architecture-dependent firmware code is supported in part by [http://www.libopencm3.org libopencm3]. The [[Lisa]] autopilots use the STM32.<br />
<br />
The LPC21xx based boards use the LPC2148 and have been flying fixed wing and multi-rotors for many years. This architecture is more mature and stable but at the expense of speed and extra ports available on the newer STM32 series processors. The [[Tiny]] series, [[Booz]], [[TWOG/v1.0 | TWOG]], [[YAPA]] and [[Umarim_v10 | Umarim]] autopilots all use the LPC2148.<br />
<br />
Some autopilots have also been designed for close integration with small single-board computers, particularly those based on [[OMAP]] processors such as the [http://www.gumstix.com/ Gumstix] [https://www.gumstix.com/store/index.php?cPath=33 Overo] series. The [[Lisa/L]] and [[Classix]] boards are designed with this in mind, though other autopilots can be easily interfaced. Further information can be found [[OMAP|here]].<br />
<br />
A basic feature comparison table is presented to help in the autopilot hardware selection process. Stable well tested and used LPC or more cutting edge STM32 that requires some debugging.<br />
<br />
For information regarding architecture and firmware compatibility of various subsystems and modules, please see the appropriate [[Subsystems]] overview and [[Modules_list|Modules List]] pages.<br />
<br />
NOTE: The accuracy of this table '''may not be 100% correct''', the best resource is always hardware and software source files and individual autopilot pages.<br />
<br />
<br />
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%" width="100%"<br />
|+'''Autopilot<sup>1</sup> Feature Matrix'''<br />
| align="center" width="15%" style="background:#f0f0f0;"|'''Feature'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/L|Lisa/L v1.1]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Lisa/M_v20|Lisa/M v2.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Umarim_v10|Umarim v1.0]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[Tiny/v2.11|Tiny v2.11]]'''<br />
| align="center" width="14%" style="background:#f0f0f0;"|'''[[TWOG/v1.0|TWOG v1.0]]'''<br />
| align="center" style="background:#f0f0f0;"|'''[[YAPA/v2.0|YAPA v2.0]]'''<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''MCU'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Part'''||STM32F103RE||STM32F105RCT6||LPC2148||LPC2148||LPC2148||LPC2148<br />
|-<br />
| style="background:#f0f0f0;"|'''Clock'''||72MHz||72MHz||60MHz||60MHz||60MHz||60MHz<br />
|-<br />
| style="background:#f0f0f0;"|'''Flash'''||512kB||256kB||512kB||512kB||512kB||512kB<br />
|-<br />
| style="background:#f0f0f0;"|'''RAM<sup>2</sup>'''||64kB||64kB||32kB & 8kB||32kB & 8kB||32kB & 8kB||32kB & 8kB<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Onboard Sensors<sup>3</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''MEMS IMU'''||no||aspirin||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Baro'''||yes||yes||yes||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Diff Pressure'''||yes||no||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''GPS'''||no||no||no||yes||no||no<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Input/Output<sup>4</sup>'''<br />
|-<br />
| style="background:#f0f0f0;"|'''UART'''||3 & 1RX||2 & 2RX||2||1||2||2<br />
|-<br />
| style="background:#f0f0f0;"|'''I2C'''||2||1 + 1<sup>5</sup>||2||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''SPI'''||2||1||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''ADC'''||3 (12bit)||3 + 2 (12bit)<sup>5</sup>||0 + 4 (10bit)<sup>6</sup>||8 (10bit)||8 (10bit)||6 (10bit)<br />
|-<br />
| style="background:#f0f0f0;"|'''PWM'''||6||6 + 2<sup>5</sup>||6||8||8||10<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Output'''||no||no||1||1||1||no<br />
|-<br />
| style="background:#f0f0f0;"|'''PPM Capture'''||1||0 + 1<sup>5</sup>||1||1||1||1<br />
|-<br />
| style="background:#f0f0f0;"|'''GPIO<sup>7</sup>'''||?||1||0 + 4<sup>6</sup>||2||2||1<br />
|-<br />
| style="background:#f0f0f0;"|'''Onboard LEDs'''||8||5||2||3||3||3<br />
|-<br />
| style="background:#f0f0f0;"|'''USB Peripheral'''||Onboard USB JTAG + UART||bootloader||bootloader||bootloader||bootloader||bootloader<br />
|-<br />
| style="background:#f0f0f0;"|'''CAN'''||1||1||no||no||no||no<br />
|-<br />
| style="background:#f0f0f0;"|'''Other'''||Overo w/ I/O incl. USB Host||Aspirin footprint, JTAG header||||||||XBee connector, RS232 options<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Power Management'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Input'''||6.1V - 18V||5V - 16V||5.5V - 17V||6.1V - 18V||6.1V - 18V||6.1V - 18V<br />
|-<br />
| style="background:#f0f0f0;"|'''Supply Output'''||2.25@5V, 2.25A@3.3V, Other||500mA@3.3V, 250mA@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 2.25A@5V||1A@3.3V, 2.25A@5V||2x 1A@3.3V, 2.25A@5V<br />
|-<br />
| style="background:#f0f0f0;"|'''Software Switch'''||2||no||no||1||1||1<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Mechanical'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Size'''||~100mm x ~50mm||34mm x 60mm x 10mm||56mm x 25mm||70.8mm x 40mm||40.2mm x 30.5mm||80.0mm x 40.0mm?<br />
|-<br />
| style="background:#f0f0f0;"|'''Weight'''||?||9.9g - 10.8g||9g||24g||8g||23g w/ XBee?<br />
|-<br />
| style="background:#f0f0f0;"|'''Connector Style'''||Picoblade||Picoblade & 0.1" Servo||Picoblade||Picoblade||Picoblade||0.1" Headers<br />
|-<br />
| style="background:#f0f0f0;"|'''PCB Style'''||4-layer||4-layer||4-layer||2-layer||2-layer||2-layer<br />
|-<br />
| style="background:#f0f0f0;"|'''Mounting Holes'''||4x M3||4x 2mm||4x 2mm||no||no||4x M3<br />
|-<br />
|style="background:#f0f0f0;"| || align="center" colspan="6"|'''Comments'''<br />
|-<br />
| style="background:#f0f0f0;"|'''Comments'''||IMU and Overo Mount Location, Many Features||||||||No onboard sensors or RF systems can help deal with interference challenges||Onboard XBee connector allows clean and easy radio modem integration<br />
|-<br />
| style="background:#f0f0f0;"|'''Typical Usage'''||Advanced payload and controls development using Gumstix; fixed-wing or rotorcraft||Small, general purpose w/ IMU; fixed-wing or rotorcraft||Small, general purpose w/ IMU; fixed-wing||Small, general purpose w/ GPS; fixed-wing with external IR or IMU||Small, general purpose; fixed wing with all external sensors||0.1" headers means easier wiring, at the cost of weight<br />
|-<br />
| style="background:#f0f0f0;"|'''Previous Versions'''||[[Lisa/L]] v1.0||[[Lisa/M_v10|Lisa/M v1.0]]|| ||[[Tiny/v1.1|Tiny v1.1]], [[Tiny/v0.99|Tiny v0.99]]|| ||[[YAPA/v1.0|YAPA v1.0]]<br />
|}<br />
<br />
'''Notes:'''<br />
<br />
'''1.''' Only the newest revisions of the more commonly used autopilots are listed<br />
<br />
'''2.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA<br />
<br />
'''3.''' The onboard sensors are almost always supplemented with external sensors. For example, TWOG can use an external IMU or IR sensors, and also needs an external GPS.<br />
<br />
'''4.''' Input/Outputs listed are generally those easily accessible on regular autopilot connectors, customization/hacks can modify available I/O, for example free an extra I2C on Tiny and TWOG<br />
<br />
'''5., 6.''' Some features use shared resources - denoted by X + Y where Y is shared - and cannot be used simultaneously<br />
<br />
'''5.''' Lisa/M v2.0 shared resources include: one I2C is shared with 2 PWM outputs, two ADCs are shared with LEDs, one RX only UART is shared with the PPM capture<br />
<br />
'''6.''' Umarim v1.0 shared resources include: 4 ADCs are shared with 4 GPIOs<br />
<br />
'''7.''' Usually other unused pins can be used for additional GPIO with some code modifications<br />
<br />
<br />
|-<br />
|<h2>When will the Schematics, CAD files, Gerber files, BOM be released?</h2><br />
|-<br />
|<h3>The hardware development and release process.</h3><br />
<br />
<P>8 June 2011 13:25:47 Antoine Drouin wrote on the mailing list:</P><br />
<br />
Schematics will be released ASAP, CAD files will come later. When ? I don't know.... Worst case would be when Joby Robotics releases a new version of the board, but I hope it will be sooner than that. <br />
<br />
Lisa/L CAD files have been released (http://svn.savannah.nongnu.org/viewvc/paparazzi-hardware/trunk/lisa/v1.1/?root=paparazzi ) 3 month ago. (...)<br />
<br />
I've started this project together with Pascal 8 years ago and since then I have dedicated my time to try and make it successful. I'm utterly convinced of the benefits of open source, but observing how Paparazzi grew over time, I came to the conclusion that hardware is a bit different than software... "gcc tiny.brd" is not going to make a board magically appear on your desktop. <br />
<br />
I'll list here some of my arguments in favor of releasing CAD files after the board is mature.<br />
# Unlike software, where an unskilled user can type make and get a piece of complex software to successfully build, assembling hardware requires tools and skills. Providing gerbers and BOM have lured a bunch of new users into believing otherwise and has created tons of frustration. I've myself fixed a number of badly assembled boards and I even recall that while helping debugging a board (so after assembly), discovering that the person had manufactured two layers PCBs instead of four layers. As the technology of the autopilot increases, this problem becomes more and more important.<br />
# The success of the project depends on the availability of affordable hardware. The price of hardware is directly and exponentially dependent on the number of manufactured units. If ten persons manufacture 10 boards each, the cost will be much higher than if one person manufactures 100.<br />
# Last and not least, the quality of assembly also depends very much on the number of manufactured units. Good quality can only be achieved through the use of automated placing and soldering, and those processes can only be used if the number of units reach a certain amount.<br />
<br />
|}<br />
|}<br />
<br />
[[Category:Hardware]] [[Category:User_Documentation]]</div>
Scdwyer