ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

Meta-ros Kinetic runtime issue with roscore



Hey everyone,

I’m adding ros-meta to a Yocto/OpenEmbedded build of a Linux distribution for a custom Xilinx Zynq based camera board and it looks like I’m running into some runtime dependency issues when running roscore.

I’m using the experimental kinetic distribution of ros-meta at:

My bblayers.conf file looks as follows:

  ${TOPDIR}/../poky/meta \
  ${TOPDIR}/../poky/meta-poky \
  ${TOPDIR}/../poky/meta-yocto-bsp \
  ${TOPDIR}/../meta-openembedded/meta-oe \
  ${TOPDIR}/../meta-openembedded/meta-python \
  ${TOPDIR}/../meta-openembedded/meta-multimedia \
  ${TOPDIR}/../meta-xilinx \
  ${TOPDIR}/../meta-ros \
  ${TOPDIR}/../meta-shadowbox \

Added the following line to by file:

IMAGE_INSTALL += "roslaunch"

Used the following command to create my own image.

bitbake core-image

Build completed without any errors. Created an SD card including the kernel
and file system that includes ROS.

On the booted Xilinx Zynq based system running the Linux environment I just built, I’m configuring ROS Kinetic with the

export ROS_ROOT=/opt/ros/kinetic
export ROS_DISTRO=kinetic
export ROS_PACKAGE_PATH=/opt/ros/kinetic/share
export PATH=$PATH:/opt/ros/kinetic/bin
export LD_LIBRARY_PATH=/opt/ros/kinetic/lib
export PYTHONPATH=/opt/ros/kinetic/lib/python2.7/site-packages
export ROS_MASTER_URI=http://localhost:11311
export CMAKE_PREFIX_PATH=/opt/ros/kinetic
touch /opt/ros/kinetic/.catkin

I have the following problems running roscore.

root@microzed-camera:~# roscore
Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/roscore", line 36, in <module>
    from rosmaster.master_api import NUM_WORKERS
  File "/opt/ros/kinetic/lib/python2.7/site-packages/rosmaster/", line 35, in <module>
    from .main import rosmaster_main
  File "/opt/ros/kinetic/lib/python2.7/site-packages/rosmaster/", line 43, in <module>
    import rosmaster.master
  File "/opt/ros/kinetic/lib/python2.7/site-packages/rosmaster/", line 47, in <module>
    import rosmaster.master_api
  File "/opt/ros/kinetic/lib/python2.7/site-packages/rosmaster/", line 72, in <module>
    from rosmaster.util import xmlrpcapi
  File "/opt/ros/kinetic/lib/python2.7/site-packages/rosmaster/", line 48, in <module>
    from defusedxml.xmlrpc import monkey_patch
ImportError: No module named defusedxml.xmlrpc

From what I can find on ROS Answers, it looks like defusedxml was as a fairly recent dependency added to ROS Kinetic. I assume this dependency probably didn’t make it into the meta-ros dependencies. Any suggestions on how I go about adding it to the Yocto/OpenEmbedded build of the system?




Hey Mike,

Nice to hear that the “custom Xilinx Zynq based board” is still going :wink:

Defusedxml is a python package that was added to facilitate adding security to ROS, as it provides protection against a bunch of different XML attacks. This is part of the SROS effort to add some security and hardening to ROS.

Anyway to get roscore to run, have you tried adding python-defusedxml as a dependency here:

I have only done some looking around at OpenEmbeded stuff, and never got around to actually using it so I am not sure if this is the ‘right’ way to fix this, or if it would even work.

Out of curiosity what is the size of the image that comes out the build process? I would think it would quite small relative to a Ubuntu image.



Hey Rohan,

I resolved this issue by adding the following recipe for defusedxml to:


The contents of the recipe is:

DESCRIPTION = "XML bomb protection for Python stdlib modules"
SECTION = "devel/python"
LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a560e172e996ab553d352ccff41c7d20"
SRCNAME = "defusedxml"

SRC_URI = "${PV}.tar.gz"
SRC_URI[md5sum] = "230a5eff64f878b392478e30376d673a"
SRC_URI[sha256sum] = "cd551d5a518b745407635bb85116eb813818ecaf182e773c35b36239fc3f2478"


inherit setuptools

Then adding a dependency to for this python module.

The following commit is a complete fix.

The resulting image file for the entire Linux OS including roscore is about 47MB in size which is considerably smaller than an Ubuntu image. However, this is for the absolute minimum user tools and ROS install.



Hi Mike,

I am interested in doing something similar using a Microzed, but honestly don’t know where to even start, can you point me to some good resources, so I might be able to do the same?



Hi Qnetjoe,

I would propose that you start as follows:

  1. Get an understanding of yocto and bitbake following the Yocto Quick Start:
    After stepping through that document, you should be able to build and start a small Linux image in the qemu emulator.

  2. Build and run an image with ROS for the qemu emulator following the instructions at:

  3. Build and run a minimal image for the Microzed board, using the microzed configuration provided
    in the meta-xilinx layer at:
    By the way, I found this by searching on,
    and it quickly linked me to:

  4. Combine what you learned in Step 2 and Step 3, and build an image
    with ROS for the Microzed board. When combining, you will probably need
    to choose the build configuration that is a compromise between the build
    configurations you used in step 2 and in step 3. This will then probably need
    certain adjustments in meta-ros.

Here some further advice:

  • Get a build machine with a lot of CPU power, RAM and a SSD disk to
    build images much quicker. You will not get away with some laptop
    and some Linux virtual machine. when bitbaking the images.

  • Report issues you encounter on the meta-ros github issue tracker. Please
    always provide at least the build configuration you use, and possibly even
    the bblayers.conf file, so that others can reproduce the reported issue.

I hope this helps.