0
$\begingroup$

Rosanswers logo

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

Originally posted by ultinate on ROS Answers with karma: 16 on 2012-03-19

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2012-03-19

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by ultinate with karma: 16 on 2012-03-21

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by dornhege on 2012-03-21:
-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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.