0
$\begingroup$

Rosanswers logo

I'm using robot_localization offered by ROS downloaded from gihub .It can be compiled and I haven't changed anything of it. When I executed the command: 'roslaunch ekf_template.launch' in a terminal,I got several warnings as follows:

Traceback (most recent call last): File "/home/pantiq/robot/devel/bin/roslaunch", line 6, in exec(fh.read()) File "", line 34, in File "/home/pantiq/robot/devel/lib/python2.7/dist-packages/roslaunch/init.py", line 35, in exec(__fh.read()) File "", line 56, in File "/home/pantiq/robot/src/ros_comm/tools/roslaunch/src/roslaunch/launch.py", line 55, in from roslaunch.nodeprocess import create_master_process, create_node_process File "/home/pantiq/robot/src/ros_comm/tools/roslaunch/src/roslaunch/nodeprocess.py", line 52, in from rosmaster.master_api import NUM_WORKERS File "/home/pantiq/robot/src/ros_comm/tools/rosmaster/src/rosmaster/init.py", line 35, in from .main import rosmaster_main File "/home/pantiq/robot/src/ros_comm/tools/rosmaster/src/rosmaster/main.py", line 43, in import rosmaster.master File "/home/pantiq/robot/src/ros_comm/tools/rosmaster/src/rosmaster/master.py", line 47, in import rosmaster.master_api File "/home/pantiq/robot/src/ros_comm/tools/rosmaster/src/rosmaster/master_api.py", line 72, in from rosmaster.util import xmlrpcapi File "/home/pantiq/robot/src/ros_comm/tools/rosmaster/src/rosmaster/util.py", line 48, in from defusedxml.xmlrpc import monkey_patch ImportError: No module named defusedxml.xmlrpc Then I downloaded a folder named defusedxml from a website,and put it in the robot_localization/src path,still it doesn't work.

What should I do with it?Shall I custimaze it or do something else? I do appreciate it if anyone can help me out.


Originally posted by DaDaLee on ROS Answers with karma: 113 on 2017-04-26

Post score: 5

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

It seems like you're missing the defulsedxml python package; and it looks like your probably can't run any roslaunch or roscore commands as a result.

defulsedxml should have been installed when you installed ROS. If you're running Ubuntu, you can reinstall it by running sudo apt-get install python-defusedxml


Originally posted by ahendrix with karma: 47576 on 2017-04-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by DaDaLee on 2017-04-27:
Thank you so much that your proposal really works.But here pops up another problem: After running the command: roslaunch ekf_template.launch , I run rostopic echo /odometry/filtered in another terminal.Then I got nothing.Does it mean that the node isn't operating at all or something else goes wrong?

Comment by ahendrix on 2017-04-27:
I'm not very familiar with robot_localization, so I'm not sure what's wrong. That sounds like a topic for a new question.

Comment by DaDaLee on 2017-04-27:
Thank you Ahendrix.Maybe I should raise a new question about it.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Even I was facing a similar error. Running pip install defusedxml helped me!


Originally posted by Preeti Mukherjee with karma: 41 on 2019-01-26

This answer was NOT ACCEPTED on the original site

Post score: 4


Original comments

Comment by gvdhoorn on 2019-10-08:
Please be aware of the downsides to using pip to install Python packages on a platform which normally uses apt (ie: no automatic upgrades, no visibility to the package manager, etc).

In general, use of pip for managing Python dependencies of (core) ROS packages is discouraged on Debian based platforms.

There are certainly legitimate use-cases for it, but it should not be regarded an appropriate solution to the problem reported by the OP.

Comment by ahendrix on 2021-12-02:
"under the hood" your python interpreter isn't able to find the defusedxml module on the PYTHONPATH. Since your version of ROS uses python 3, you probably need the defusedxml apt package for python3: python3-defusedxml

$\endgroup$

Your Answer

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