Installation/Linux

From PaparazziUAV
Jump to navigation Jump to search

This page only describes the installation of the prerequisite tools and dependencies needed for Paparazzi.

See the general Installation page for how to download Paparazzi and launching it.

Introduction

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

The steps required to install the software needed to be able to let your UAS fly

  • Install a recent Ubuntu Linux operating system
  • The basic Paparazzi tools installed via a Package Manager.
  • Download the source code from the source repository.
  • Allow access to your PC hardware connection by adding appropriate Udev rules.
  • Compile the binaries from the sources (cd paparazzi && make)

That's all.

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 it's dependencies. The repository hosted at ENAC holds their latest version.

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 virtual machines 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.

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.

Installation of Compilers and Handlers

For the impatient:

  • Add paparazzi the paparazzi-uav ppa for Ubuntu for Ubuntu: ppa:paparazzi-uav/ppa
    or for Debian: deb http://paparazzi.enac.fr/debian squeeze main
  • Install: paparazzi-dev and paparazzi-arm-multilib

Adding the APT repository

For any Ubuntu version run from the command line:

sudo add-apt-repository ppa:paparazzi-uav/ppa

Alternate Ubuntu repository and Debian

The ubuntu repository at paparazzi.enac.fr/ubuntu contains the some older packages for cross-compilation (gcc-arm (3.4.4), binutils-arm, newlib-arm) and flashing (lpc21isp (1.27)).

The debian repository at paparazzi.enac.fr/debian contains both new packages available in launchpad for ubuntu and the older packages for cross-compilation and flashing.

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. squeeze or natty):

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 lenny main
# deb http://paparazzi.enac.fr/debian squeeze main
# deb http://paparazzi.enac.fr/debian wheezy main
# deb http://paparazzi.enac.fr/debian sid main
# deb http://paparazzi.enac.fr/ubuntu lucid main
# deb http://paparazzi.enac.fr/ubuntu maverick main
# deb http://paparazzi.enac.fr/ubuntu natty main
# deb http://paparazzi.enac.fr/ubuntu oneiric main
# or for Debian squeeze
# deb http://widehat.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_6.0/ ./

Installing the packages

Update your sources and install the dependencies needed for recompiling from the source (dev), and the cross-compiler toolchain arm-multilib:

sudo apt-get update
sudo apt-get install paparazzi-dev paparazzi-arm-multilib

The paparazzi-arm-multilib package provides support for both ARM7 (i.e. Tiny or TWOG boards) as well as STM32 (i.e. Lisa boards).

Using Ubuntu Software Center

For Ubuntu Oneiric (11.10)

  • Launch Software Sources (Red Wrench and gear icon -> System section)
  • Search for paparazzi-dev and paparazzi-arm-multilib packages and click on install.

Using Synaptic Package Manager

Note: The Synaptic Package Manager is not installed by default anymore under Ubuntu Oneiric (11.10). Either use the Software Center, command line or install Synaptic again.

  • Launch Synaptic Package Manager (Menu System/Administration)
  • Click Reload to update your sources.
  • Search for paparazzi-dev and paparazzi-arm-multilib packages (use the Search button)
  • Mark them for installation (right-click on package names)
  • Left-click on Apply

Optional Packages

sudo apt-get install lpc21isp openocd

The packages lpc21isp and openocd are normally automatically installed as they are recommended packages of paparazzi-dev, if not you can manually install them. lpc21isp is needed to serially flash the LPC2148 based autopilots (e.g. bootloader for tiny, twog, umarim), openocd is for flashing via JTAG (e.g. for Lisa boards) and debugging.

Obsolete Packages

These packages are in the paparazzi.enac.fr/ubuntu (or debian) repository and unmaintained, but still might be of some use...

  • paparazzi-avr Users of the older AVR based boards will need this.
  • paparazzi-arm7 To use the old gcc 3.4.4 for ARM7, superseded by paparazzi-arm-multilib. To use paparazzi-arm7 remove paparazzi-arm-multilib.
  • paparazzi-stm32 Can be used for the Lisa autopilots, superseded by paparazzi-arm-multilib. To use paparazzi-stm32 remove paparazzi-arm-multilib.

Older Ubuntu Versions

On older Linux distributions (not needed for lucid and later), 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

Manual Installation of Individual Packages

Users of other Linux flavors than a recent Ubuntu or Debian and anyone needing manual control of each individual package can install them independently.

Installing and running Paparazzi

Please see Getting the Source Code on the general Installation page for details on downloading the Paparazzi source code, compiling and running it.

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 Paparazzi Center follow these steps:

  1. Save this image file to your /paparazzi folder
  2. Right click anywhere on the Ubuntu desktop and click Create Launcher.
  3. Enter the following in the fields provided:
    • Name: Paparazzi Center
    • Command: /home/YOUR_USER_NAME/paparazzi/paparazzi
    • Comment: Runs the Paparazzi Center
    • 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.

Udev rules

Add the appropriate Udev rule (available in fhe file 50-paparazzi.rules) to the USB handler. Simply copy as root conf/system/udev/rules/50-paparazzi.rules to /etc/udev/rules.d/, e.g in a terminal:

cd <your paparazzi directory>
sudo cp conf/system/udev/rules/50-paparazzi.rules /etc/udev/rules.d/

See the Udev page for more details.

Setting access rights for USB download

On recent Ubuntu releases this is not necessary. For other distributions/releases this may be required to flash the Paparazzi-boards directly through USB. For flashing details, see Compiling.

Some Linux distributions, don't allow standard (non root) users to directly access the USB bus by default. 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.

Using 32Bit on 64Bit

As there are 64bit packages available this is not needed anymore, nevertheless if you want to do this for whatever reason...

One solution is to use an i386 installation instead. In rare circumstances however, this may be problematic (certain engineering software for example requires 64 bit kernels). In these cases, a chroot is a good compromise, while avoiding the overhead of a virtual machine (and USB device problems which may occur). Initial instructions are here for now: https://help.ubuntu.com/community/DebootstrapChroot The command you use for the bootstrap needs to reflect your architecture - I used

 sudo debootstrap --variant=buildd --arch i386 lucid /var/chroot/lucid http://gb.archive.ubuntu.com/ubuntu/

The format for schroot config files has changed as of lucid however - here is mine:

 $ cat /etc/schroot/chroot.d/lucid-i386 
 [lucid]
 description=Ubuntu 10.04 Lucid for i386
 directory=/var/chroot/lucid
 personality=linux32
 root-users=my_user
 type=directory
 users=my_user

Once you've installed the ubuntu minimal package, make sure you also enable the uni- and multiverse repos (the easiest way for me is to simply copy my host's /etc/apt/sources.lst to /var/chroot/lucid/etc/apt/sources.lst). Then follow the standard instructions above. You may need to manually set the PAPARAZZI_HOME and PAPARAZZI_SRC environment variables. You will also have to set the DISPLAY environment variable to :0.0 like so:

 export DISPLAY=:0.0

Please note, this is more advanced than the standard paparazzi installation and therefore you may encounter strange problems.