Introduction

This page describes how to get osgART, and its dependencies ARToolkit and Open Scene Graph, installed in your Linux system.

1. ARToolkit Installation

Before building ARToolkit, consider which video input you will be using. In Linux, ARToolkit supports video input using either Video4Linux, an IIDC-compliant or DV camera connected via IEEE-1394, or a Sony EyeToy camera connected via USB. Alternatively you can use GStreamer 0.10 (0.8 is not supported and also not recommended) as input method. This requires you to install certain development packages for your Linux distribution, and will depend on what packages you already have installed. On a fresh installation of Ubuntu 9.04 Jaunty, it was necessary to install the gstreamer, gtk2.0 and glib development packages. These can be installed using the synaptic package manager, and are marked with a -dev prefix.

The instructions for building ARToolkit are in its packaged README.txt file, but are repeated here. You will be prompted for which video input you wish to use at the Configure step.

  • Unpack the ARToolkit.tgz to a convenient location. The root of this location will be referred to below as {ARToolKit}:

cd {ARToolKit} ./Configure make

Following a successful build, you will be able to run the examples included in the {ARToolkit}/bin/ folder. However, first you must configure the ARToolkit video input. This is important as the same configuration will be used in your osgART applications. Information on video configuration is in {ARToolkit}/docs/video/index.html.

If you are using GStreamer, using a webcam on /dev/video0 through Video4Linux v2 (V4L2) you will need to set the ARTOOLKIT_CONFIG environment variable using the following bash command - put this line into your .bashrc or .profile to save you having to repeat this command every session:

export ARTOOLKIT_CONFIG="v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink"

Now you should be able to run the example binaries such as simpleTest, graphicsTest etc., located in the {ARToolKit}/bin/ folder, and go onto the next step - installing OpenSceneGraph.

2. Open Scene Graph Installation

Open Scene Graph Libraries

  • Install cmake if you do not already have it
    • in Ubuntu you can install it via the synaptic package manager.
  • Checkout the latest version of Open Scene Graph from the subversion repository. The following command will create a directory named OpenSceneGraph in the current directory, and place the checked out files in it:

svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.2 OpenSceneGraph 

You can either build Open Scene Graph in this source directory, or do an out of source build.

For an out-of-source build, create a new directory (named, for example, OSGBuild), alongside the OpenSceneGraph directory. Then:

 cd OSGBuild  cmake {path to OpenSceneGraph}/OpenSceneGraph -DCMAKE_BUILD_TYPE=Release  make  sudo make install

(The -DCMAKE_BUILD_TYPE=Release will ensure best performance from your applications.)

Alternatively, to build in the source directory:

 cd OpenSceneGraph  ./configure  make  sudo make install

(The configure script will run “cmake . -DCMAKE_BUILD_TYPE=Release” for you.)

Towards the end of the build, you may see the message: “Your applications may not be able to find your installed libraries unless you set your LD_LIBRARY_PATH (user specific) or update your ld.so configuration (system wide)“. If so, follow the instructions that are suggested.

Open Scene Graph Examples

Open Scene Graph also comes with many examples. You have to build these separately, and also need to checkout a separate svn repository which contains all the data (such as 3D models) necessary to run the examples.

  • To build the examples use

cd OpenSceneGraph cmake -DBUILD_OSG_EXAMPLES=1 make

  • To obtain the data for the examples use the following command, which will create a folder named OpenSceneGraph-Data and place all the data in it:

svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph-Data/trunk OpenSceneGraph-Data

Before you can run the examples, you need to set a couple of environment variables, to specify the path to the binaries so you can run them from any directory, and set the Open Scene Graph file path up so the examples can find the data. Add the following lines to your .bashrc or .profile. Obviously you will have to use your own path.

bash: export PATH={$PATH}:/usr/local/home/anna/Programs/OpenSceneGraph/bin/ bash: export OSG_FILE_PATH=/home/anna/Programs/OpenSceneGraph-Data

3. osgART Installation

As with the OSG installation, you can either build in the source directory, or in a separate directory such as osgART-Build. Inside your build directory, use the commands:

cmake {path to osgART folder}/osgART/trunk/ make sudo make install

Upon a successful build, some example binaries will be placed in /usr/local/bin/. Here you will also find a directory named data/, which contains a file named camera_para.dat, used by osgART to configure the camera at runtime. A copy of this data/ directory, or a link to it, must be present in the same directory as any osgART executable you wish to run. You can make a symbolic link in the current working directory using

ln -s /usr/local/bin/data/ .

2