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

installed ros_comm and now file is missing

asked 2016-06-03 02:07:36 -0600

billy gravatar image

I have been using JADE on Ubuntu 14.04 for a while. Yesterday I installed ROS_COMM from https://github.com/ros/ros_comm.git .

After that all was fine. roscore and the luanch files working. Today got error starting roscore about missing module - did not capture exact error, but it ended with the same issue, with that module (defusedxml.xmlrpc)couldn't be found. Based on suggestions found here, I deleted the build and devel folders and rebuilt the entire work space with catkin_make. Since then roscore has been working but the error below as shown occurring with a particular launch. Have not tried other launches. The error is:

[100%] Built target record
linux@linux-Latitude-D630:~/catkin_ws$ source devel/setup.bash
linux@linux-Latitude-D630:~/catkin_ws$ roslaunch hector_slam_launch neato.launch
Traceback (most recent call last):
  File "/home/linux/catkin_ws/devel/bin/roslaunch", line 6, in <module>
    exec(fh.read())
  File "<string>", line 34, in <module>
  File "/home/linux/catkin_ws/devel/lib/python2.7/dist-packages/roslaunch/__init__.py", line 35, in <module>
    exec(__fh.read())
  File "<string>", line 56, in <module>
  File "/home/linux/catkin_ws/src/ros_comm/tools/roslaunch/src/roslaunch/launch.py", line 55, in <module>
    from roslaunch.nodeprocess import create_master_process, create_node_process
  File "/home/linux/catkin_ws/src/ros_comm/tools/roslaunch/src/roslaunch/nodeprocess.py", line 52, in <module>
    from rosmaster.master_api import NUM_WORKERS
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/__init__.py", line 35, in <module>
    from .main import rosmaster_main
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/main.py", line 43, in <module>
    import rosmaster.master
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/master.py", line 47, in <module>
    import rosmaster.master_api
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/master_api.py", line 72, in <module>
    from rosmaster.util import xmlrpcapi
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/util.py", line 48, in <module>
    from defusedxml.xmlrpc import monkey_patch
ImportError: No module named defusedxml.xmlrpc

The launch file hasn't changed so I doubt anything wrong with launch.

The file reported (module?) as missing is really not on the PC: defusedxml.xmlrpc. I do not know if it was ever on the computer and was never needed before, or it was there and is now gone.

The file is part of python, but the file that calls it is a ROS file and it does not make note of py version. This is the util.py file requesting the file.

"""
Utility routines for rosmaster.
"""
try: 
    from urllib.parse import urlparse
    except ImportError:
    from urlparse import urlparse
try:
    from xmlrpc.client import ServerProxy
except ImportError:
    from xmlrpclib import ServerProxy

from defusedxml.xmlrpc import monkey_patch
monkey_patch()
del monkey_patch

_proxies = {} #cache ServerProxys
def xmlrpcapi(uri):
    """
@return: instance for calling remote server or None if not a valid URI
@rtype: xmlrpc.client.ServerProxy
"""
if uri is None:
    return None
uriValidate = urlparse(uri)
if not uriValidate[0] or not uriValidate[1]:
    return None
if not uri in _proxies:
    _proxies[uri] = ServerProxy(uri)
return _proxies[uri ...
(more)
edit retag flag offensive close merge delete

Comments

If you feel your question has been answered, please indicate that by ticking the checkmark to the left of the answer. That will clearly mark the question as answered in the question list.

gvdhoorn gravatar image gvdhoorn  ( 2016-06-16 03:02:12 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-06-03 02:27:07 -0600

ahendrix gravatar image

updated 2016-06-03 02:39:42 -0600

gvdhoorn gravatar image

It looks like the dependency on defusedxml was added quite recently in the Kinetic branch in PR 782, which was merged Apr 12. This is part of the sros work by Morgan Quigley. That patch does not exist in the Indigo/Jade branch (indigo-devel)

Depending on why you installed a newer version of ros_comm, you have a couple of different options:

  • If you installed ros_comm because you didn't think it was installed, you can remove it; it's part of every ROS install from debs. Just remove the ros_comm folder from your workspace, delete the build and devel directories to clear out any cached paths, and rebuild your workspace.
  • If you installed ros_comm because you wanted patches for Jade that aren't available in the public repository yet, you can try to check out the indigo-devel branch of ros_comm (used for both Indigo and Jade), and rebuild your workspace.
  • If you really wanted to use the Kinetic version of ros_comm with Jade, you can try to install the python-defusedxml package through apt. (no guarantees that the API is identical between Jade and Kinectic versions of ros_comm).

Also note that building the C++ parts of ros_comm in your overlay is not recommended. ROS uses dynamic linking, and rebuilding core libraries such as roscpp in your workspace can result in broken run-time library dependencies. Any nodes or libraries that are installed through apt were built against the version of roscpp in apt, but if you put a newer version of roscpp in your workspace they will try to use that version at run-time. If there are any conflicts or changes between the two versions of roscpp the packages installed from apt won't work.

edit flag offensive delete link more

Comments

Didn't notice your answer before posting. Removed my own (which mostly duplicated @ahendrix's).

gvdhoorn gravatar image gvdhoorn  ( 2016-06-03 02:38:55 -0600 )edit

Thanks for quick responses. I did think it wasn't installed because I could not find the rosconsole config file anywhere. I will follow your instructions tomorrow and see how it goes. Then I;m back to looking for the config file.

billy gravatar image billy  ( 2016-06-03 03:18:20 -0600 )edit

On my Indigo machine the rosconsole config is at /opt/ros/indigo/share/ros/config/rosconsole.config ; should be in a similar location for Jade. You should set the ROSCONSOLE_CONFIG_FILE environment variable to point to your custom config instead of modifying that file.

ahendrix gravatar image ahendrix  ( 2016-06-03 12:31:48 -0600 )edit

Thanks again Hendrix. I found it in the same place as you showed. The tutorial had me off in another part of the machine. Really cool you're helping out the newbs.

billy gravatar image billy  ( 2016-06-06 16:33:54 -0600 )edit

Question Tools

Stats

Asked: 2016-06-03 02:07:36 -0600

Seen: 1,561 times

Last updated: Jun 03 '16