0
$\begingroup$

Rosanswers logo

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 
    exec(fh.read())
  File "", line 34, in 
  File "/home/linux/catkin_ws/devel/lib/python2.7/dist-packages/roslaunch/__init__.py", line 35, in 
    exec(__fh.read())
  File "", line 56, in 
  File "/home/linux/catkin_ws/src/ros_comm/tools/roslaunch/src/roslaunch/launch.py", line 55, in 
    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 
    from rosmaster.master_api import NUM_WORKERS
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/__init__.py", line 35, in 
    from .main import rosmaster_main
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/main.py", line 43, in 
    import rosmaster.master
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/master.py", line 47, in 
    import rosmaster.master_api
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/master_api.py", line 72, in 
    from rosmaster.util import xmlrpcapi
  File "/home/linux/catkin_ws/src/ros_comm/tools/rosmaster/src/rosmaster/util.py", line 48, in 
    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]

def remove_server_proxy(uri):
    if uri in _proxies:
        del _proxies[uri]

Does it look like simply the file is missing now and the missing file is all that is wrong, or you you think that the file was never here and that installing ros_comm has caused an issue where the file is now being requested in response?

Thanks for your help.


Originally posted by billy on ROS Answers with karma: 1850 on 2016-06-03

Post score: 0


Original comments

Comment by gvdhoorn on 2016-06-16:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by ahendrix with karma: 47576 on 2016-06-03

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by gvdhoorn on 2016-06-03:
Didn't notice your answer before posting. Removed my own (which mostly duplicated @ahendrix's).

Comment by billy on 2016-06-03:
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.

Comment by ahendrix on 2016-06-03:
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.

Comment by billy on 2016-06-06:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.