[ros-users] ni setup.bash issue

Patrick Bouffard bouffard at eecs.berkeley.edu
Wed Feb 23 18:37:15 UTC 2011

But, and Tully will surely correct me if I'm wrong here, if you are
like me and just find the whole rosinstall thing causes confusion, you
can just ignore it and setup ROS_PACKAGE_PATH explicitly in ~/.bashrc
(or equivelant if you use some other shell, I suppose).

I've found that prepending each path separately on its own line helps
keep things clean, e.g.:

# ROS exports:
source /opt/ros/diamondback
export ROS_PACKAGE_PATH=~/ros/ccny-ros-pkg:${ROS_PACKAGE_PATH}
export ROS_PACKAGE_PATH=~/ros/starmac-ros-pkg:${ROS_PACKAGE_PATH}
#export ROS_PACKAGE_PATH=~/ros/pcl/trunk:${ROS_PACKAGE_PATH}
export ROS_PACKAGE_PATH=~/ros/pcl/0.9.0:${ROS_PACKAGE_PATH}

.. that way you can quickly comment out one path or another to, e.g.,
switch between different versions of a stack.


On Wed, Feb 23, 2011 at 10:27 AM, Tully Foote <tfoote at willowgarage.com> wrote:
> Hi Miguel,
> We have specifically chosen to have setup.(ba)sh files use the current
> environment.  This ended up being a constant source of confusion due to the
> fact that if you were using one environment and then "changed" to another
> you might still  have remnants of the old one on your path.  And then if you
> created a new terminal it would not have the remnants and would behave
> differently.
> It is recommended that you setup rosinstall to contain your whole desired
> tree and then it will generate your setup.(ba)sh You can use the "other" tag
> to add arbitrary paths to your rosinstall file.
> http://www.ros.org/wiki/rosinstall
> Tully
> On Wed, Feb 23, 2011 at 1:23 AM, Miguel Prada Sarasola
> <miguel.prada.sarasola at gmail.com> wrote:
>> I just found another issue with how this setup file works.
>> I upgraded from cturtle to diamondback, and as I source the setup.sh in
>> the ni stack _after_ sourcing the setup.sh in diamondback, the setup file in
>> the ni stack overwrites the package path, removing the diamondback directory
>> and including the cturtle one. I now this can be easily fixed (by rerunning
>> rosinstall if I'm not mistaken, or even manually fixing the setup file), but
>> it wouldn't be necessary if the setup file did append the ni stack dir to
>> $ROS_PACKAGE_PATH instead of a hardcoded value that's created by rosinstall.
>> Regards,
>> Miguel.
>> El 22/02/2011, a las 12:46, Miguel Prada escribió:
>> > Hi all,
>> >
>> > I just realised about a potential pitfall in how the setup.sh file in
>> > the ni stack works. Sorry if this has already been brought to
>> > attention, but I couldn't find any reference.
>> >
>> > I've seen that the setup.sh file inside the ni stack writes the
>> > ROS_PACKAGE_PATH with the path of ni and the path where ros is
>> > installed (e.g. /opt/ros/diamondback). The thing is that if I have
>> > added some extra folders to the ROS_PACKAGE_PATH in my .bashrc before
>> > sourcing the setup.sh in ni stack, it will erase those extra folders.
>> >
>> > For example, if my .bashrc has:
>> >
>> > source /opt/ros/diamondback/setup.bash
>> > export ROS_PACKAGE_PATH=/my/additional/ros/stacks:$ROS_PACKAGE_PATH
>> > source ~/ni/setup.bash
>> >
>> > Then /my/additional/ros/stacks will not be part of the environment
>> > variable, and thus my packages won't be found by ROS.
>> >
>> > Wouldn't it be better if the setup.sh in the ni stack would prepend
>> > the ni stack folder to $ROS_PACKAGE_PATH instead of
>> > /opt/ros/diamondback? Or am I doing something wrong?
>> >
>> > Regards,
>> > Miguel.
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
> --
> Tully Foote
> Systems Engineer
> Willow Garage, Inc.
> tfoote at willowgarage.com
> (650) 475-2827
> _______________________________________________
> 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