ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unable to start roscore, Indigo on Ubuntu 14.04

asked 2014-05-06 23:43:34 -0500

bajo gravatar image

updated 2014-05-12 05:53:14 -0500

Hi,

i recently tried to use Indigo on my notebook (Lenovo T440s). I tried the Install from source as well es the Install from repository methods to install a basic ROS Indigo. As long as i do not need to start a roscore on this machine pretty much everything works as expected. Connections to other machines, robots with roscore running work just fine.

As soon as i want to run a roscore it receive the following error:

./install_isolated/bin/roscore                                                                                                                                     :(
... logging to /home/bajo/.ros/log/a54a89fe-d5bd-11e3-9fec-28d244198e8b/roslaunch-roscosmos-3532.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/__init__.py", line 279, in main
    p.start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 257, in start
    self._start_infrastructure()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 215, in _start_infrastructure
    self._start_server()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 166, in _start_server
    self.server.start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/server.py", line 352, in start
    super(ROSLaunchNode, self).start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/rosgraph/xmlrpc.py", line 199, in start
    _thread.start_new_thread(self.run, ())
AttributeError: 'module' object has no attribute 'start_new_thread'

The same problem arises when i use the installation from the repository. The error messages just differ in terms of the paths.

source /opt/ros/indigo/setup.zsh                                                                        :(
bajo@roscosmos ~ % roscore                         
... logging to /home/bajo/.ros/log/e287ee68-d74a-11e3-ad4f-28d244198e8b/roslaunch-roscosmos-3568.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 279, in main
    p.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 257, in start
    self._start_infrastructure()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 215, in _start_infrastructure
    self._start_server()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 166, in _start_server
    self.server.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/server.py", line 352, in start
    super(ROSLaunchNode, self).start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/xmlrpc.py", line 199, in start
    _thread.start_new_thread(self.run, ())
AttributeError: 'module' object has no attribute 'start_new_thread'

As operating system i use Ubuntu 14.04 64bit and i have installed python 2.7 and 3.4. I am not sure if i installed both of them manually or if Ubuntu did this on its own. But the problem seems to happen because in /home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/rosgraph/xmlrpc.py we try to import _thread and if this fails import ... (more)

edit retag flag offensive close merge delete

Comments

roscore works for me, installed from the Ubuntu packages. Your example uses you manually compiled version. Try ``source /opt/ros/indigo/setup.bash`` followed by ``roscore``.

joq gravatar image joq  ( 2014-05-08 12:20:34 -0500 )edit

Thank you joq for your answer. Unfortunately the result is the same. I edited my original post to include the output from roscore which was installed from the repository. Can you please tell me which versions of python (2 and 3) you have installed on your system and what system you are running? Thank you.

bajo gravatar image bajo  ( 2014-05-08 21:29:35 -0500 )edit

Python versions: 2.7.6 and 3.4.0; should be the same on any up-to-date Trusty system. The _thread problem should only happen with python3. What does your /usr/bin/python point to?

joq gravatar image joq  ( 2014-05-09 05:09:50 -0500 )edit

There is something wrong with your environment. You are still resolving things to your hand-built workspace. Try creating a new shell with a clean environment (not sourcing your workspace, *only* /opt/ros/indigo/setup.zsh).

joq gravatar image joq  ( 2014-05-09 05:17:00 -0500 )edit

I think it is not a problem with my ROS environment. I can even import _thread in my python2 interpreter, which is of course independent from ROS. Also in my edited post i have both versions. The hand-built as well as the on from the repository.

bajo gravatar image bajo  ( 2014-05-10 00:24:42 -0500 )edit

Please post the output of ``ls -l /usr/bin/python``.

joq gravatar image joq  ( 2014-05-10 04:29:47 -0500 )edit

ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 Apr 5 17:23 /usr/bin/python -> python2.7*

bajo gravatar image bajo  ( 2014-05-10 05:31:45 -0500 )edit

Please post the values of $PYTHONPATH, $ROS_PACKAGE_PATH, and $CMAKE_PREFIX_PATH in your environment.

joq gravatar image joq  ( 2014-05-10 09:34:48 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-05-14 03:44:41 -0500

bajo gravatar image

I think i finally found the problem. A month ago I was playing around with a few vim plugins for python development. One of them seemed to place the file _thread.py at /usr/local/lib/python2.7/dist-packages/_thread.py. Through this it was available to python2.7 even though it was not meant to be used with it.

After I deleted the files /usr/local/lib/python2.7/dist-packages/_thread.py and /usr/local/lib/python2.7/dist-packages/_thread.pyc roscore is able to start without any problems.

Thank you joq for all your input and help on this matter. It is really nice to finally be able to use roscore again. :-)

edit flag offensive delete link more
0

answered 2014-05-11 08:46:15 -0500

joq gravatar image

My ros-indigo-rosgraph, version 1.11.0-1trusty-20140305, already has the fix you propose.

Perhaps you have a down-level version?

edit flag offensive delete link more

Comments

Strange. That is the exact same version i have installed. Just checked and reinstalled this version from the repository. Can you tell me what how the import of thread looks like in the file /opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/xmlrpc.py

bajo gravatar image bajo  ( 2014-05-11 21:43:08 -0500 )edit
joq gravatar image joq  ( 2014-05-12 04:55:55 -0500 )edit

Please edit your question and add the relevant contents of your unmodified /opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/xmlrpc.py version.

joq gravatar image joq  ( 2014-05-12 05:09:12 -0500 )edit

Edited the original question. Unfortunately it is so long that it hides behind the more... link.

bajo gravatar image bajo  ( 2014-05-12 05:54:47 -0500 )edit

That looks the same to me. It still does not work?

joq gravatar image joq  ( 2014-05-12 08:32:06 -0500 )edit

No. Unfortunately not. Should python2.7 be able to import _thread ? On ubuntu12.04 python 2.7.3 can not import it, therefore ROS imports thread as _thread. But on ubuntu 14.04 python 2.7.6 is able to import it and therefore ROS uses the wrong module.

bajo gravatar image bajo  ( 2014-05-13 21:00:33 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-06 23:43:34 -0500

Seen: 2,253 times

Last updated: May 14 '14