[ros-users] $PYTHONPATH in launch files
Ken Conley
kwc at willowgarage.com
Tue May 25 16:26:55 UTC 2010
My comments have been added to the ticket, but to summarize here:
1. roslaunch automatically will include roslib/src on your
PYTHONPATH in the remote launch
2. 3rdparty Python dependencies need to be system installed (via
rosdep) or made into ROS packages, just like any other dependency, in
order to be portable. If you follow this model, then there should be
no need to set PYTHONPATH manually.
3. In the odd event that another location needs to be added to the
PYTHONPATH, roslaunch supports an $(env FOO) syntax to parameterize
this particular setting. This behavior is encouraged as it exposes the
fact that any user of that launch file has to manually perform
additional setup on each machine the launch file is used. You can
also use $(env PYTHONPATH) to push your current PYTHONPATH to the
remote machine, assuming you are using NFS or identical layouts.
- Ken
On Mon, May 24, 2010 at 11:48 AM, Armin Hornung
<HornungA at informatik.uni-freiburg.de> wrote:
> Hi all,
>
>
> > Wait... what part of this env variable is portable?
> >
> > <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"
> > />
> >
> > If your user name changes on the remote machine, wouldn't your launch
> > file stop working? It seems that the remote machine's $PYTHONPATH
> > would be more likely to know where all its libraries are than a
> > .launch file, right?
>
> I agree with Hai on this, Advait's example (unintentionally?) shows that
> this does not really help making launch files more portable, but less.
> Re-specifying the PYTHONPATH in the launch file might work as a
> workaround for the current behavior, but this would need to be done with
> a launch file specific for every machine or ros installation path.
>
> What do the ROS developers think on this? Making use of my newly-created
> trac-account, I just created a ticket for this ;)
>
> https://code.ros.org/trac/ros/ticket/2735
>
> Cheers,
> Armin
>
>
> --
> 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
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
More information about the ros-users
mailing list