Difference between revisions of "Installation/Linux"

From PaparazziUAV
Jump to navigation Jump to search
Line 160: Line 160:
To create an icon on the desktop so you don’t have to manually type codes into the Terminal each time you want to start the GCS follow these steps:
To create an icon on the desktop so you don’t have to manually type codes into the Terminal each time you want to start the GCS follow these steps:


#Save [[Media:Paparazzi_logo.gif‎|this image file]] to your /paparazzi3 folder
#Save [[Media:Paparazzi_logo.png|this image file]] to your /paparazzi3 folder
#Right click anywhere on the Ubuntu desktop and click Create Launcher.
#Right click anywhere on the Ubuntu desktop and click Create Launcher.
#Enter the following in the fields provided:
#Enter the following in the fields provided:

Revision as of 15:11, 21 September 2010

Introduction

Paparazzi is very easily installed on any laptop or workstation running the Ubuntu Linux OS or virtually any Debian based Linux.

At a high-level here are the steps required to install Paparazzi:

  • Dedicate a Laptop or PC for Paparazzi. Dedicate means during install you select to use the entire disk for the installation and erase any previous Linux or Windows OS installed.
  • Installation takes place with a recent build of Linux using the default options.
  • The Linux package sources file is updated to add the Paparazzi packages (/etc/apt/sources.list)
  • The Linux packages are updated from the network with the "update" command
  • The Paparazzi packages are installed (sudo apt-get install paparazzi-dev paparazzi-arm7)
  • The brltty package is removed to avoid issues (sudo apt-get remove brltty)
  • Install subversion to get SVN (sudo apt-get install subversion). Don't worry if it's already installed.
  • Bring down the sources from the SVN repository: (svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3). Just change the paparazzi3s to paparazzi4s for Booz files.
  • Allow access to the ports by copying the rules file: (export PAPARAZZI_HOME=~/paparazzi3; sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/)
  • Compile the binaries from the sources (cd paparazzi3 && make)

That's all. For the sources file (sources.list) you only add the line required for your version. Linux names their versions.

Operating System

Paparazzi is very easily installed on any laptop or workstation running the Ubuntu Linux OS or virtually any Debian based Linux. Paparazzi is packaged for Debian as well as all of its dependencies. The repository hosted at ENAC holds their latest version.

It is also possible to have your Debian/Ubuntu running in a virtual machine, for instance with VirtualBox. This requires minimal changes to your computer setup, as you can run the VM from all common platforms (Windows, Mac OS X, Linux). The virtual machine image can easily be transferred between different laptops, giving greater flexibility. Unfortunately, the Open-Source Edition of VirtualBox doesn't include the necessary USB support, so you'll need to get the regular version from the website.

If you are new and this is your first time installing it is suggested you keep it simple. Select a system you can dedicate to the Linux installation. No VMs or dual boot configurations. The idea is do a very simple generic installation that is certain to have no issues. This reassures you that the installation process works and you can see and use a working Paparazzi install for some time before you try a more complicated install. The install is well documented below and certain to succeed if followed exactly. Most issues arise when someone unfamiliar with Linux tries a non-standard install that requires special steps not documented here.

Precompiled Binaries

Precompiled binaries can be downloaded and executed with the paparazzi-bin package. To enjoy the power and flexibility of open-source code, you will soon want to configure the airborne autopilot and ground station according to your needs and recompile it. Therefore you need to install the compilers and download the source code.

The Paparazzi packages for a Debian based Linux are hosted at the ENAC repository.

Compilers and Handlers

The typical installation contains all of the necessary C and OCaml compilers as well as some XML and Ivy handlers. These tools are provided by the paparazzi-dev package. Have no fear, this is all taken care of for you so all you must do is type a few simple commands. Below are those commands and helpful information. Commands can be copied and pasted from these pages to make it as easy as possible.

Source Code

The Paparazzi source code is hosted by Savannah. It is downloaded using Subversion or git.

Installation of Compilers and Handlers

From the Command Line

Just add the following lines to your repository list (/etc/apt/sources.list) and then uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):

Note: Because of the sources.list file permissions maybe you will need to edit it with root access. In Terminal write this:

gksudo gedit /etc/apt/sources.list


File: /etc/apt/sources.list
# Uncomment just _one_ of the following lines - depending on your OS version
# deb http://paparazzi.enac.fr/debian etch main
# deb http://paparazzi.enac.fr/debian lenny main
# deb http://paparazzi.enac.fr/ubuntu gutsy main
# deb http://paparazzi.enac.fr/ubuntu hardy main
# deb http://paparazzi.enac.fr/ubuntu intrepid main
# deb http://paparazzi.enac.fr/ubuntu jaunty main
# deb http://paparazzi.enac.fr/ubuntu karmic main
# deb http://paparazzi.enac.fr/ubuntu lucid main

Then, update your sources and either install the precompiled binaries

sudo apt-get update
sudo apt-get install paparazzi-bin

or the dependencies needed for recompiling from the source (dev), and the cross-compiler (arm7) :

sudo apt-get update
sudo apt-get install paparazzi-dev paparazzi-arm7

It is not recommended to install both paparazzi-bin and paparazzi-dev. While the bin package is self-contained and should be sufficient for users who do not want to patch the code, the dev meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the SVN repository.

Note: The ivy-python package now among the dependencies of paparazzi-dev is also available in the normal paparazzi repository. Allen Ibara might have some newer versions in his PPA but you should not need them.

Optional/Obsolete Packages

Users of older AVR based boards will also need the paparazzi-avr package.

Extra for Ubuntu

On older Linux distributions, the Braille TTY driver interferes with FTDI USB Serial adapters. If somehow your FTDI serial adapter does not work, remove the package via:

sudo apt-get remove brltty

Using Synaptic Package Manager

  • Launch Synaptic Package Manager (Applications/System Tools Menu)
  • In Settings/Repositories, add a new repository on URI = http://paparazzi.enac.fr/debian, Distribution = etch, Section = main . For Ubuntu, replace debian by ubuntu and etch by gutsy, hardy, karmic or lucid
  • Search for paparazzi-bin, paparazzi-dev, and paparazzi-arm7 packages (use the Search button)
  • Mark them for installation (right-click on package names)
  • Left-click on Apply

Manual Installation of Individual Packages

Users of other Linux flavors or anyone needing manual control of each individual package can install them independently. The list of dependencies of the Debian package is located in the debian/control.lenny file and may help users of other distributions.

The binary packages and some corresponding source tarballs can be downloaded from

http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/

For distributions using RPM packaging, the alien tool can be used to translate a .deb package into a .rpm package.

For Fedora (Core8) users, you can install the following packages from standard repository:

  • ocaml.i386
  • ocaml-camlimages-devel.i386
  • ocaml-lablgtk-devel.i386
  • ocaml-xml-light-devel.i386
  • boa.i386
  • libgnomecanvas-devel.i386
  • libusb-devel.i386
  • pcre-devel.i386
  • arm-gp2x-linux-gcc.i386
  • arm-gp2x-linux-binutils.i386
  • glade2.i386
  • and gcc, make, subversion, gnuplot, imagemagik...

Then you need alien tool to convert packages from the paparazzi repository:

  • ivy-c
  • ivy-c-dev
  • ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/<version> vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/<version> to /usr/lib/ocaml)
  • lpc21isp

Downloading the Source Code

Important: If you use paparazzi-bin you need not to download the source code.

After the paparazzi-dev package is installed the complete source code should be downloaded from one of the software repositories.

Subversion

See the project page at Savannah for more details. From the directory of your choice type:

svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3

or if you are behind a firewall with an http proxy available:

svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3

after configuration of your proxy in the ~/.subversion/servers file

This will download all of the code and install it into paparazzi3/

If you cannot use the Subversion install, daily updated tarballs can also be fetched from the Downloads page.

Git

You can also get the source code via git.

Launching the Software

Using paparazzi-bin

If you are using the paparazzi-bin package or the Live-CD, just launch the paparazzi binary application and you will be guided through the installation of your personal configuration files.

Using Source Code

If you are using the source code, the first step is to compile it. From the paparazzi3 directory (cd paparazzi3), run

make

You will have to run this command after each update of the source (svn update command). Launch the software from the paparazzi3 directory with

./paparazzi

From the Paparazzi Center interface, select the MJ5 aircraft, select the sim target and Build it. Then Execute the Simulation session. The prcedure is detailed in the Simulation page.

Quick Launch Icon

To create an icon on the desktop so you don’t have to manually type codes into the Terminal each time you want to start the GCS follow these steps:

  1. Save this image file to your /paparazzi3 folder
  2. Right click anywhere on the Ubuntu desktop and click Create Launcher.
  3. Enter the following in the fields provided:
    • Name: Paparazzi GCS
    • Command: /home/YOUR_USER_NAME/paparazzi3/paparazzi
    • Comment: Runs the Paparazzi GCS
    • Then click the icon image in the top left on the dialog box and select the Paparazzi logo you just downloaded.
  4. Click the OK button and that’s it! Your icon should appear on the desktop and you are ready to go.

Agents

If (and only if) you want to directly launch some Paparazzi agents (the Tools of the Paparazzi Center), without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:

File: ~/.bashrc
export PAPARAZZI_HOME=your paparazzi3 directory
export PAPARAZZI_SRC=your paparazzi3 directory

env Variables

If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:

export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`

Verify that your variables are set correctly with the following command:

env | grep PAPARAZZI

which should return the following:

PAPARAZZI_HOME=your paparazzi3 directory
PAPARAZZI_SRC=your paparazzi3 directory

Setting access rights for USB download

This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see Compiling.

Default linux rights may not allow standard (non root) users to directly access the USB bus. You will need to make yourself a member of the plugdev "group" and then create a "rule", associated with that "group".
Make yourself a member of the plugdev group:

sudo adduser <your login> plugdev

Logout and login again. Then add the appropriate rule (available ine fhe file 10-paparazzi.rules) to the USB handler. Simply copy as root $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules to /etc/udev/rules.d/

sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/

Software Updates

Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed. Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. Your airframe file will not be updated by the Subversion (SVN) system and therefore any new or modified variable names will need to be added manually. The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on SVN to find the proper syntax. See the Compiling page for more help if needed.
That said, keeping your software up to date is easy with the Subversion system. The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.

To download and automatically merge any updated source files, run the following command from your Paparazzi directory

svn update

After any SVN update or source code modification the code can be recompiled from your paparazzi3 directory with the following command:

make

The make command will only recompile portions of the software where changed have been detected. If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:

make clean
make

See the Compiling page for more info.

Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use tkdiff instead which provides highlighted comparisons of any files that differ between your code and the SVN server and allows for a file by file update.

To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following:

sudo apt-get update
sudo apt-get upgrade

Using the Live CD

LightScribe CD Cover

The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer. Simply burn the image as a boot CD and reboot! The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers). It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly.

The CD image and a howto on Using the Boot CD is available from the Downloads page.

The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.

Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (knoppix.img).

  • From the Knoppix menu (second from bottom left), choose Configure, Create a persistent KNOPPIX disk image
  • Choose your media (be sure to connect your USB pendrive before booting!)
  • Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )
  • Choose the size of your home directory (100Mb is recommended)

On the next reboot, this saved state will be automatically located and loaded.

Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.

The Live CD can also be used to install a Debian system on the hard disk, using the knoppix-installer command. Be sure to backup the hard disk before trying ...


A LiveCD needs some looks... In color or in LightScribe format, your CD will always look cool.

  • The LightScribe version is in Nero Cover Design format (.ncd) and it's here for download LightScribe CD Cover 1
  • Better is of course to use it on an OpenSource OS, some Linux software to be found here: Lightscribe for Linux

From Scratch

In very rare occasions one needs to install the tools used, third-party libraries used by Paparazzi all from scratch. There are are the moment no 64Bit Linux repositories, that is a very good reason to install from scratch. Sometime one just wants to be able to use all the latest and greatest compilers, or source code of everything to improve something. Then there is no other way than to install from scratch. To help you out getting it all smoothly working a special page is created just click here. If you do not understand what that all means, do not panic, then the information on that page is not important to you. Just pretend you never read this part of the Wiki. You are advised just to follow the regular step as described on the install page.