Re: [ros-users] $PYTHONPATH in launch files

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Advait Jain
Date:  
To: ros-users
Subject: Re: [ros-users] $PYTHONPATH in launch files
You can change environment variables through your launch file:
http://www.ros.org/wiki/roslaunch/XML/env

Example:
<env name="PYTHONPATH"
value="/home/advait/svn/robot1/src/libraries:/home/advait/svn/robot1/src/libraries/katana:/home/advait/ros/ros/core/roslib/src:/usr/lib/python2.5/site-packages"
/>

Advait


On Thu, May 20, 2010 at 4:43 AM, Armin Hornung
<> wrote:
> 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
>        Humanoid Robots Lab
> Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
> Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany
>
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>




--
PhD student
College of Computing
Georgia Tech

http://www.cc.gatech.edu/~advait