Project

General

Profile

Environment setup

In order to effectively use the installed software, some variables may be set in your shell environment. Nothing is really specific to telekyb3, this is just standard shell setup. But a sample script setting the most commonly used variables is shown below for convenience:

Sample bash startup script
# -*- Mode: Shell-script -*-

# default path
export PATH=/bin:/sbin

# reset
export PKG_CONFIG_PATH=
export MANPATH=

export TCLLIBPATH=
export PYTHONPATH=

export GENOM_TMPL_PATH=
export ROS_PACKAGE_PATH=

export GAZEBO_MODEL_DATABASE_URI=
export GAZEBO_PLUGIN_PATH=
export GAZEBO_MODEL_PATH=

# test $2 with flag $1 and prepend $2 to variable $3 using $4 separator or `:'
testandset() { test $1 $2 && eval $3=$2\${$3:+${4:-:}\$$3}; }

# iterate over a list of directories
for dir in                      \
    /usr                        \
    /usr/local                  \
    $HOME/openrobots            \
    $HOME/devel                 \
    ; do

    # paths
    testandset -d $dir/sbin PATH
    testandset -d $dir/bin PATH

    # man
    testandset -d $dir/man MANPATH
    testandset -d $dir/share/man MANPATH

    # pkgconfig
    testandset -d $dir/lib/pkgconfig PKG_CONFIG_PATH
    testandset -d $dir/share/pkgconfig PKG_CONFIG_PATH

    # tcl
    testandset -d $dir/share TCLLIBPATH ' '
    testandset -d $dir/lib TCLLIBPATH ' '

    # pythonpath - get the last (i.e. latest version)
    for pydir in $dir/lib/python*/site-packages; do :; done
    testandset -d $pydir PYTHONPATH

    # genom3
    testandset -d $dir/share/genom/site-templates GENOM_TMPL_PATH

    # ros
    testandset -f $dir/.catkin ROS_PACKAGE_PATH

    # gazebo
    testandset -d $dir/share/gazebo/models GAZEBO_MODEL_PATH
    testandset -d $dir/lib/gazebo GAZEBO_PLUGIN_PATH
done

# add final .
PATH=${PATH}:.

This script defines a set of directories in which it looks for specific subdirectories. The order matters: the last directory specified in the list has higher precedence.

If you are using a bourne-shell compatible shell (e.g. bash), you add this fragment to your .bashrc startup file (or similar).

Important variables include:

PATH

to locate executables.

MANPATH

manual location.

PKG_CONFIG_PATH

for compiling and linking against dependencies.

TCLLIBPATH

for importing tcl libraries.

PYTHONPATH

for importing python libraries.

GENOM_TMPL_PATH

for GenoM code generation templates.

ROSPKGPATH

for locating ROS packages.

GAZEBO_MODEL_PATH

for locating Gazebo models.

GAZEBO_PLUGIN_PATH

for locating Gazebo plugins.

Those variable are defacto standards and you can easily find more detail about them online.