[ros-users] $PYTHONPATH in launch files

Armin Hornung HornungA at informatik.uni-freiburg.de
Thu May 20 08:43:57 UTC 2010


Hi!

I have some problems starting a python node in a launch file, which 
otherwise starts fine when executed from the command line. The node in 
question ([1]) tries to import a 3rd party library (Aldebaran's NaoQI). 
In my .bashrc the $PYTHONPATH is adjusted accordingly, but is seems like 
$PYTHONPATH is set to $ROS_ROOT/core/roslib/src as soon as a node is 
executed from within a launch file. Could that be fixed, so that ROS' 
pythonpath is prepended (or appended) to the existing environment variable?

One place to change that is "setup.sh" (e.g. in /opt/ros/boxturtle when 
installed via apt-get):
export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH}

but that did not seem to be enough to change the behavior within the 
launch files.

Cheers,
Armin



[1] 
http://code.google.com/p/alufr-ros-pkg/source/browse/branches/nao_experimental_1.6/nao_ctrl/scripts/nao_walker.py

-- 
Armin Hornung                              Albert-Ludwigs-Universität
www.informatik.uni-freiburg.de/~hornunga   Dept. of Computer Science
HornungA at informatik.uni-freiburg.de        Humanoid Robots Lab
Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany




More information about the ros-users mailing list