Ask Your Question
0

roscd returns "bash: reldir: unbound variable"

asked 2012-03-19 05:09:13 -0600

ultinate gravatar image

updated 2012-03-19 06:19:31 -0600

Hi everyone,

When going through the tutorial, I get errors with certain ROS (navigation) functions:

$ roscd roscpp
bash: reldir: unbound variable
$ rosls roscpp_tutorials
bash: reldir: unbound variable
$ rosed roscpp
bash: 2: unbound variable

Any ideas how to resolve this?


Info:

System: Ubuntu 11.10
Bash: GNU bash, version 4.2.10(1)-release (i686-pc-linux-gnu)
Affected tutorial step: http://www.ros.org/wiki/ROS/Tutorials/NavigatingTheFilesystem
I tried so far: Reinstalling ROS (using apt-get).
What works: rosnode, roscore, rospack, ... (most methods)
What doesn't work: roscd, rosls, rosed

Note: During first config as described in the tutorial, I got the following errors:

$ source /opt/ros/electric/setup.bash
bash: PYTHONPATH: unbound variable
bash: ROS_MASTER_URI: unbound variable

I resolved this by manually defining these variables in ~/.bashrc:

$ export PYTHONPATH=$ROS_ROOT/core/roslib/src
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-03-21 01:53:04 -0600

ultinate gravatar image

Thanks dornhege,

my .bashrc didn't contain set -u, but it contained set -o nounset instead.

After uncommenting that, all problems mentioned above disappear. I did not change any ROS scripts. Does this mean that ROS scripts are not programmed robustly enough?

In any case, ticket closed.

edit flag offensive delete link more

Comments

-u is short for -o nounset. About the script: I'm not sure, maybe it only works like this in bash. Otherwise it would be worth ticketing.

dornhege gravatar imagedornhege ( 2012-03-21 02:50:10 -0600 )edit
1

answered 2012-03-19 05:24:38 -0600

dornhege gravatar image

You .bashrc probably contains set -u.

The proper fix would be to change the line in /opt/ros/electric/setup.sh:

export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH}

to

export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH-}

I would say that this is the intended behaviour.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-03-19 05:09:13 -0600

Seen: 1,307 times

Last updated: Mar 21 '12