Difference between revisions of "Installation/MacOSX"

From PaparazziUAV
Jump to navigation Jump to search
m
(added initial section on installing FlightGear on OS X - needs work)
Line 92: Line 92:
#: crw-rw-rw-  1 root  wheel  11,  26 20 Jan 14:38 /dev/tty.usbserial-000013FD
#: crw-rw-rw-  1 root  wheel  11,  26 20 Jan 14:38 /dev/tty.usbserial-000013FD
#: lrwxr-xr-x  1 root  wheel        0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre>
#: lrwxr-xr-x  1 root  wheel        0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD</pre>
=Installing FlightGear=
FlightGear has been packaged for use on OS X. This package can be downloaded from:
http://macflightgear.sourceforge.net/home/downloads/
There are currently two packages available. The one 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).
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
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.
* In Paparazzi Center, add to the simulator command the <tt>-fg</tt> option plus the IP address of the machine running flightgear:
.../sw/simulator/launchsitl -a TJ1 -fg 224.255.255.255 -boot -norc
* Launch Flight Gear with the following command:
fgfs --fdm=null --native-gui=socket,in,30,,5501,udp
Note the IP address change for the <tt>-fg</tt> option compared to that on the [[Simulation]] page. See the [[InstallationMacOSX#Configuration|Configuration]] section above for more details.
The <tt>--native-gui</tt> option is specified with 6 arguments as detailed on the FlightGear Wiki: http://wiki.flightgear.org/index.php/Property_Tree/Sockets
For more information, the FlightGear source can be inspected. It is available for download from the FlightGear website [http://www.flightgear.org/Downloads/source.shtml here]. Most relevant source files can be found in the /src/Network directory.
Right now, FlightGear hangs almost as soon as the Paparazzi simulation begins sending packets of data to FlightGear. This is currently under investigation.

Revision as of 23:33, 23 January 2011

The task of building Paparazzi on for Apple MacOS X is on going.

The current installation instructions are as follows. As the process evolves and the more people begin to use it the process will become easier and more simplified.

Installing from source

The tools that are required to work with paparazzi on a Mac are installed from MacPorts.

If you already have MacPorts installed it is advised to run the following steps before proceeding.

  1. sudo port selfupdate
  2. sudo port upgrade outdated

You can then run the installation steps below from step 3.

If you don't already have MacPorts installed run the following steps

  1. Install the latest XCode http://developer.apple.com/technologies/tools/xcode.html
  2. Install MacPorts from http://www.macports.org/install.php
  3. Install GIT sudo port install git-core
  4. Get a local copy of the Paparazzi Portability Support source git clone git://github.com/paparazzi/paparazzi-portability-support.git
  5. edit /opt/local/etc/macports/sources.conf and above the rsync://... line add file://<local path>/paparazzi-portability-support/darwin/macports/ports/ [nosync] for example:
    file:///Users/dummyuser/projects/paparazzi/paparazzi-portability-support/darwin/macports/ports/ [nosync]
  6. If you don't already have your own copy of the paparazzi source then you now need to install paparazzi sudo port install paparazzi 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 sudo port install paparazzi-tools # then go and have lunch, get a coffee, get some sleep. this will probably take a long time


If you want to follow the standard Paparazzi Git install then the prerequisite software can be installed by running the command sudo port install paparazzi-tools

Trouble shooting

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.

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

  1. sudo port -f uninstall installed
  2. sudo port clean --all uninstalled
  3. sudo port selfupdate
  4. sudo port install paparazzi-tools or sudo port install paparazzi

This was in fact the process used to check that the code installed on a clean machine.

Installation using the binary installer

  1. Install the latest XCode http://developer.apple.com/technologies/tools/xcode.html
  2. Download the paparazzi binary installer from http://TODO find a place to host this file
  3. Install paparazzi by double clicking on the downloaded file paparazzi.mpkg


If you want to follow the standard Paparazzi Git install then the prerequisite software can be installed by downloading the paparazzi-tools binary installer from http://TODO find a place to host this file and installing the tools by doublclicking on the downloaded file paparazzi-tools.mpkg


Configuration

NetworkPreferences.png
PaparazziMacOSX.png

Curently the Ivy bus library cannot utilse the standard loopback network interface on a Mac. If on ocassion you intend operate without a network (ie at the flying field) then set the environment variable IVY_BUS to the following multicast address thus:

export IVY_BUS=224.255.255.255

If the intent is to run the ground segment distributed across a number of computers the the IVY_BUS environment variable should be set to a local network address.

For example:

export IVY_BUS=192.168.1.255


Note that your network address is the network you are currently using. If you are at home configuring on a wireless network, that network won't be available out in the field. Thus in nearly every case

Alternatively the bus can be specified as arguments to each command in the GCS.

  1. Close all processes using the stop button
  2. add -b <network>.255 to each command
  3. start the processes again

Running Paparazzi

Paparazzi can be started in the usual way

cd ~/paparazzi
./paparazzi

Changing the GTK look and feel

Run /opt/local/bin/switch2 to select a different theme. More detailed instructions can be found at http://gtk.php.net/manual/en/html/tutorials/tutorials.installation.macosx-stepbystep.html

Additional themes can be downloaded from http://art.gnome.org/themes/gtk2

USB Drivers for Telemetry

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 conected 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 driers for modems using other chipsets.


FTDI drivers can be downloaded from FTDI

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

Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.

  1. Remove all USB devices from the computer and run the command ls -l /dev/*usb* /dev/*USB* hopefully this will not list anything
  2. Plug in your radio and repeat the command ls -l /dev/*usb* /dev/*USB* this should now list the serial port that the radio has been connected to. In my case I get
        ls -l /dev/*usb* /dev/*USB*
    crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD
    crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD
  3. Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0
  4. To check that everything is correct run the first command again ls -l /dev/*usb* /dev/*USB* and you should get something like this
        ls -l /dev/*usb* /dev/*USB*
    crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD
    crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD
    lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD

Installing FlightGear

FlightGear has been packaged for use on OS X. This package can be downloaded from: http://macflightgear.sourceforge.net/home/downloads/

There are currently two packages available. The one released March 18, 2010 (2.0.0) installs and runs properly on OS X 10.6. Follow the directions here for installation and basic usage. Additional documentation can be found here. The Development Snapshot from August 21, 2010 does not seem as stable (did not work properly when tried on one machine).


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


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.

  • In Paparazzi Center, add to the simulator command the -fg option plus the IP address of the machine running flightgear:
.../sw/simulator/launchsitl -a TJ1 -fg 224.255.255.255 -boot -norc
  • Launch Flight Gear with the following command:
fgfs --fdm=null --native-gui=socket,in,30,,5501,udp

Note the IP address change for the -fg option compared to that on the Simulation page. See the Configuration section above for more details.

The --native-gui option is specified with 6 arguments as detailed on the FlightGear Wiki: http://wiki.flightgear.org/index.php/Property_Tree/Sockets For more information, the FlightGear source can be inspected. It is available for download from the FlightGear website here. Most relevant source files can be found in the /src/Network directory.

Right now, FlightGear hangs almost as soon as the Paparazzi simulation begins sending packets of data to FlightGear. This is currently under investigation.