This is the first in what I hope will be a series of posts, where I describe the installation procedures of software – stating the issues I faced and how I solved them.
Why? Because Linux….and literally every other piece of open source software aimed at the scientific/engineering community. You can only reinstall them a few times before you realize you should actually write down how you circumvented those same old bugs.
So first ROS.
Note: I believe most of these errors could have been avoided had I simply commented out Anaconda’s path in ~/.bashrc before beginning the installation
In installing ROS (Kinetic) on Ubuntu 16.04, I followed the instructions here for the Full desktop install. It was flawless.
After following the installation procedure stated at
I proceeded to run
only to get the error
ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg' Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH. CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
So I checked the python path…
$ echo $PYTHONPATH /opt/ros/kinetic/lib/python2.7/dist-packages
but knowing I had Anaconda with Python 3.5 installed, I checked to confirm which version was available
$ python Python 3.5.2 |Anaconda custom (64-bit)
This implied installing catkin_pkg via apt-get would fail as it would be installed into Anaconda.
However, by using pip, I could install it into ROS’s python installation.
pip install catkin_pkg
With that cleared, catkin_make could run normally.
Continuing to the next tutorial, I tried to run rospack find, but got this
$ rospack find roscpp $ [rospack] Unable to create temporary cache file /home/myusername/.ros/.rospack_cache.mnAamf: Permission denied
Taking ownership of the ~/.ros folder solved that.
sudo chown -R myusername ~/.ros
Everything looked good with the subsequent tutorials till I had to run this in the Understanding ROS topics tutorial.
$ rosrun rqt_graph rqt_graph
$ rosrun rqt_graph rqt_graph Traceback (most recent call last): File "/opt/ros/kinetic/lib/rqt_graph/rqt_graph", line 5, in from rqt_gui.main import Main File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/main.py", line 38, in import rospy File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in from .client import spin, myargv, init_node, \ File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/client.py", line 52, in import roslib File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in from roslib.launcher import load_manifest File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in import rospkg ImportError: No module named 'rospkg'
Seemed easy…so I run pip
$ pip install rospkg
and got it installed, and run rqt_graph again…to get this
$ rosrun rqt_graph rqt_graph Traceback (most recent call last): File "/opt/ros/kinetic/lib/rqt_graph/rqt_graph", line 8, in sys.exit(main.main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph')) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/main.py", line 59, in main return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH']))) File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/main.py", line 349, in main from .perspective_manager import PerspectiveManager File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 44, in class PerspectiveManager(QObject): File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_gui/perspective_manager.py", line 48, in PerspectiveManager perspective_changed_signal = Signal(basestring) NameError: name 'basestring' is not defined
It seemed like it had to do with my messy python setup. I considered fixing the basestring issue as it was a python 2 vs 3 compatibility issue. That brought up another similar error and usually that’s a bad sign.
I gave up on a fixing that as it did not look critical, but thankfully I found out I could access the node graphs from rqt directly.
and heading to Plugins > Introspection > Node Graph, you could access the same functionality.
Also, in following the rqt_console tutorial, I had to run
$ rosrun rqt_console rqt_console
$ rosrun rqt_logger_level rqt_logger_level
…which could be replicated by running rqt like stated earlier, and going to Plugins > Logging > Console and also Plugins > Logging > Logger level
$ rqt_graph &
$ rqt_console &
$ rqt_logger_level &
works just as well.
I would be using that ad-hoc fix till cracks in this approach surface and probably prompt a full installation of ROS and possibly Python/Anaconda.
In running the tutorial on messages and services, my attempts to run catkin_make install failed with this
Traceback (most recent call last): File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in Traceback (most recent call last): File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in import genmsg.template_tools File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in import genmsg.template_tools File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in import em ImportError: No module named 'em' import em ImportError: No module named 'em'
Installing empy fixed that
$ pip install empy
Also, consider reviewing this to get Anaconda to play nice with other python installations.