ROS Environmental variable problem

asked 2016-06-10 18:21:54 -0500

pbarile gravatar image

updated 2016-06-15 09:34:21 -0500

130s gravatar image

I"m running ROS Indigo virtually using Ubuntu 14.04 on my Mac Book laptop using Parallels. All was ok initially, I was able to execute ROS packages and do some openCV software development with the iSight camera. I'm not sure what happened but now when I open up a new terminal, sourcing the /opt/ros/indigo/setup.bash file, none of the ROS environmental variables are getting set. I reinstalled ROS and created a new catkin workspace but my ROS env. variables are still not set to anything. Here's a dump of the error when I tried to initialize my new workspace:

parallels@ubuntu:~/Documents/catkin_ws/src$ catkin_init_workspace
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/catkin_init_workspace", line 11, in <module>
    from catkin.init_workspace import init_workspace

Here's my path indicating that ROS indigo is in it:

parallels@ubuntu:~/Documents/catkin_ws$ echo $PATH
/opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Examining my ROS Env. variables yields a blank screen indicating none are set:

parallels@ubuntu:~/Documents/catkin_ws$ env | grep ROS

Can someone please help with this problem? I have been struggling with this for hours now to no avail. Thanks, Phil


UPDATE1: I'm continuing my response here since there isn't enough space in a 'Comment' field.
My apologies, since I've tried several other things since I posted this question, I can't duplicate that catkin_init_workspace error discussed above. However, I am posting my current command line outputs below to indicate my current state:

parallels@ubuntu:~/Documents/catkin_ws$  source devel/setup.bash
/home/parallels/Documents/catkin_wsparallels@ubuntu:~/Documents/catkin_ws$ echo $PATH /opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

parallels@ubuntu:~/Documents/catkin_ws$  env | grep ROS
[no environmental variables were printed out here]

parallels@ubuntu:~/Documents/catkin_ws$ catkin_init_workspace
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/catkin_init_workspace", line 11, in <module>
    from catkin.init_workspace import init_workspace
ImportError: No module named catkin.init_workspace

parallels@ubuntu:~/Documents/catkin_ws$ catkin_make
Traceback (most recent call last):
  File "/opt/ros/indigo/bin/catkin_make", line 12, in <module>
    from catkin.init_workspace import init_workspace
ImportError: No module named catkin.init_workspace

At this point, I believe I should uninstall ROS and then reinstall ROS. Would you agree? Can you please tell me the safest way to uninstall all ROS components so I can start clean again? Thanks for your help!


I checked my python path and it's matches yours so I decided to uninstall ROS and all my packages and then reinstall ROS. I also installed the image_transport package [with this command: git clone https://github.com/ros-perception/ima... ] which is the package I believe I was using successfully with my first install. After reinstalling ROS and sourcing /opt/ros/indigo/setup.bashrc I have two problems:

1) My ROS environmental variables are blank. Can you please tell me how/where ...

(more)
edit retag flag offensive close merge delete

Comments

1) Your snippet that includes catkin_init_workspace ended prematurely. We don't know what the error was 2) Usually copy-paste the command & output rather than verbally explaining like "sourcing the /opt/ros/indigo/setup.bash file, none of the ROS environmental variables are getting set" works.

130s gravatar image 130s  ( 2016-06-10 21:00:23 -0500 )edit

My apologies, since I've tried several other things since I posted this question, I can't duplicate that catkin_init_workspace error discussed above. However, I am posting more command line outputs below to indicate my current state: parallels@ubuntu:~/Documents/catkin_ws$ source devel/setup.bash /

pbarile gravatar image pbarile  ( 2016-06-11 11:58:30 -0500 )edit

Not sure how that happens to you, but root cause of your error might be that PYTHONPATH might not be set properly, given the error seems to be from Python. I get this:

$ env | grep PYTHONPATH
PYTHONPATH=/opt/ros/indigo/lib/python2.7/dist-packages
130s gravatar image 130s  ( 2016-06-11 12:34:30 -0500 )edit

I don't know how worthy to try tracking down the issue. I would go ahead uninstall-install and see.

130s gravatar image 130s  ( 2016-06-14 21:05:31 -0500 )edit

sourcing /opt/ros/indigo/setup.bashrc I have two problems:

I think this is typo; that file shouldn't exist IMO?

130s gravatar image 130s  ( 2016-06-15 09:43:43 -0500 )edit

The compilation error might be irrelevant from the suspicious environment issue you've originally raised. Try this or others.

130s gravatar image 130s  ( 2016-06-15 09:44:01 -0500 )edit

More info is great! But please try to use syntax to make the snippets more readable from next time. And paste what roswtf returns.

130s gravatar image 130s  ( 2016-06-15 09:44:42 -0500 )edit

Also if you can, share the tarball generated by

curl -sL https://raw.githubusercontent.com/130s/ros_comm/wtf/add_logtarball/utilities/roswtf/scripts/getlogball.sh | bash -
130s gravatar image 130s  ( 2016-06-15 09:45:34 -0500 )edit