'rostopic' and other commands fail after upgrade
I've got an issue after upgrading my machines where I can't run rostopic or other key ros commands.
I foolishly ran 'sudo apt-get update && sudo apt-get upgrade' on both robots and my workstation without checking upgrading didn't break anything, and they're all displaying the same behavior, so I'm certain it's not my config.
Here's what I get when I try and run 'rostopic':
turtlebot@turtleVM:~$ rostopic
Traceback (most recent call last):
File "/opt/ros/groovy/bin/rostopic", line 34, in <module>
import rostopic
File "/opt/ros/groovy/lib/python2.7/dist-packages/rostopic/__init__.py", line 58, in <module>
import rospy
File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/client.py", line 59, in <module>
import rospy.impl.init
File "/opt/ros/groovy/lib/python2.7/dist-packages/rospy/impl/init.py", line 107, in <module>
class RosStreamHandler(rosgraph.roslogging.RosStreamHandler):
AttributeError: 'module' object has no attribute 'RosStreamHandler'
My .bashrc doesn't have anything super special in it, here's the end:
source /opt/ros/groovy/setup.bash
. /opt/ros/groovy/stacks/turtlebot/setup_kobuki.sh
export TURTLEBOT_3D_SENSOR=asus_xtion_pro
export ROS_MASTER_URI="http://localhost:11311"
export ROS_MASTER_URI="http://bert:11311"
Some other enviornment variables that might be relevant: ROS_DISTRO is 'groovy' PYTHONPATH is /opt/ros/groovy/lib/python2.7/dist-packages $PYTHON_CODE_BUILD_ROS_PACKAGE_PATH is set to 'from __future__ import print_function import os env_name = 'CMAKE_PREFIX_PATH' paths = [path for path in os.environ[env_name].split(os.pathsep)] if env_name in os.environ and os.environ[env_name] != '' else [] workspaces = [path for path in paths if os.path.exists(os.path.join(path, '.catkin'))] paths = [] for workspace in workspaces: filename = os.path.join(workspace, '.catkin') data = '' with open(filename) as f: data = f.read() if data == '': paths.append(os.path.join(workspace, 'share')) paths.append(os.path.join(workspace, 'stacks')) else: for source_path in data.split(';'): paths.append(source_path) print(os.pathsep.join(paths))'
Don't know where that last one came from, but it looks like it's something quite deliberate.
My default python is 2.7.3, and if I run it and type 'import ros' it finds the package.
Any ideas what to check or how to get my system working again?
Thanks, Gavin
What happens when you get rid of the source of setup_kobuki.sh?