Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Adding ROS to Petalinux - which recipes to include?

Adding ROS to Petalinux - which recipes to include?

Hi,

For those who don't know petalinux is a xilinx tool that uses yocto and OpenEmbedded as base to generate embedded linux images.

I am having trouble adding ros melodic to my petalinux image. What i did so far was:

  1. downloaded the zeus branch of meta-ros from the github repo to <petalinux-directory>/project-spec/meta-ros
  2. renamed the following directories to match the layer.conf dependencies:
    • meta-ros-common -> ros-common-layer
    • meta-ros1 -> ros1-layer
    • meta-ros1-melodic -> ros1-melodic-layer
  3. Run petalinux-config → Yocto Settings → User Layers.
  4. Enter the following:
    • ${proot}/project-spec/meta-ros/ros-common-layer
    • ${proot}/project-spec/meta-ros/ros1-layer
    • ${proot}/project-spec/meta-ros/ros1-melodic-layer
  5. Save and exit.
  6. Add the following line in <plnx-proj-root>/project-spec/meta-user/conf/user-rootfsconfig.
    • CONFIG_ros_1.14.8-1
  7. Run petalinux-config -c rootfs. Select user packages → ros. Enable it, save and exit.
  8. Run petalinux-build.
  9. Move the generated image to a SD card and boot.

With the previous procedure, i included the ros_1.14.8-1.bb recipe which only has some of ros functionalities (it doesn't have roscore for example - see attachment for the contents of /opt/ros/melocic).

So, my question is which is the correct recipe to include? Is any of the steps mentioned wrong?

Note: i tried other recipes like: packagegroup-ros-world, packagegroup-ros1-comm, packagegroup-ros-turtlebot3-core, packagegroup-ros1-industrial-core, packagegroup-ros-turtlebot3-extended, packagegroup-ros-world-melodic.

But this recipes returned errors like:

ERROR: Nothing PROVIDES 'mesa' (but /home/simon/Workspace/Dev/MarsEB1XU3/Linux/Images/SD_BSP_RD_grayTDC_UIO_ROS/project-spec/meta-ros/ros1-melodic-layer/generated-recipes/moveit/moveit-ros-perception_1.0.2-1.bb DEPENDS on or otherwise requires it)
mesa was skipped: PREFERRED_PROVIDER_virtual/libgl set to mesa-gl, not mesa
NOTE: Runtime target 'industrial-trajectory-filters' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['industrial-trajectory-filters', 'moveit-ros-planning', 'moveit-ros-perception', 'mesa']
NOTE: Runtime target 'packagegroup-ros1-industrial-core' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['packagegroup-ros1-industrial-core', 'industrial-trajectory-filters', 'moveit-ros-planning', 'moveit-ros-perception', 'mesa']
ERROR: Required build target 'petalinux-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['petalinux-image-minimal', 'packagegroup-ros1-industrial-core', 'industrial-trajectory-filters', 'moveit-ros-planning', 'moveit-ros-perception', 'mesa']

Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

ERROR: Nothing RPROVIDES 'python-pycryptodomex' (but /home/simon/Workspace/Dev/MarsEB1XU3/Linux/Images/SD_BSP_RD_grayTDC_UIO_ROS/project-spec/meta-ros/ros1-melodic-layer/generated-recipes/ros-comm/rosbag_1.14.5-1.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python-pycryptodomex' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python-pycryptodomex']
NOTE: Runtime target 'rosnode' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['rosnode', 'rostopic', 'rosbag', 'python-pycryptodomex']
NOTE: Runtime target 'packagegroup-ros1-comm' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['packagegroup-ros1-comm', 'rosnode', 'rostopic', 'rosbag', 'python-pycryptodomex']
ERROR: Required build target 'petalinux-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['petalinux-image-minimal', 'packagegroup-ros1-comm', 'rosnode', 'rostopic', 'rosbag', 'python-pycryptodomex']

Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

LINUX BOOT:

root@EB1_MA-XU3-3EG-2I-D11:~# source /opt/ros/melodic/setup.bash
root@EB1_MA-XU3-3EG-2I-D11:~# which roscore
root@EB1_MA-XU3-3EG-2I-D11:~# which ros
root@EB1_MA-XU3-3EG-2I-D11:~# rospack
[rospack] Error: no command given.  Try 'rospack help'
root@EB1_MA-XU3-3EG-2I-D11:~# rospack help
USAGE: rospack <command> [options] [package]
  Allowed commands:
    help
    cflags-only-I     [--deps-only] [package]
    cflags-only-other [--deps-only] [package]
    depends           [package] (alias: deps)
    depends-indent    [package] (alias: deps-indent)
    depends-manifests [package] (alias: deps-manifests)
    depends-msgsrv    [package] (alias: deps-msgsrv)
    depends-on        [package]
    depends-on1       [package]
    depends-why --target=<target> [package] (alias: deps-why)
    depends1          [package] (alias: deps1)
    export [--deps-only] --lang=<lang> --attrib=<attrib> [package]
    find [package]
    langs
    libs-only-L     [--deps-only] [package]
    libs-only-l     [--deps-only] [package]
    libs-only-other [--deps-only] [package]
    list
    list-duplicates
    list-names
    plugins --attrib=<attrib> [--top=<toppkg>] [package]
    profile [--length=<length>] [--zombie-only]
    rosdep  [package] (alias: rosdeps)
    rosdep0 [package] (alias: rosdeps0)
    vcs  [package]
    vcs0 [package]
  Extra options:
    -q     Quiets error reports.

 If [package] is omitted, the current working directory
 is used (if it contains a package.xml or manifest.xml).

root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/lib
gencpp                      libroslib.so
genmsg                      librospack.so
gennodejs                   librostime.so
genpy                       python2.7
libcpp_common.so            roslib
libroscpp_serialization.so
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/bin
catkin_find               catkin_topological_order  rospack
catkin_init_workspace     rosboost-cfg              rosrun
catkin_make               rosclean                  rosstack
catkin_make_isolated      roscreate-pkg             rosunit
catkin_test_results       rosmake
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/share
catkin                mk                    roscpp_traits
cpp_common            ros                   roscreate
gencpp                ros_environment       roslang
genmsg                rosbash               roslib
gennodejs             rosboost_cfg          rosmake
genpy                 rosbuild              rospack
message_generation    rosclean              rostime
message_runtime       roscpp_serialization  rosunit
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/
_setup_util.py    etc               local_setup.sh    setup.sh
bin               lib               local_setup.zsh   setup.zsh
env.sh            local_setup.bash  setup.bash        share
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/etc
catkin  ros
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/bin
catkin_find               catkin_topological_order  rospack
catkin_init_workspace     rosboost-cfg              rosrun
catkin_make               rosclean                  rosstack
catkin_make_isolated      roscreate-pkg             rosunit
catkin_test_results       rosmake
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/lib
gencpp                      libroslib.so
genmsg                      librospack.so
gennodejs                   librostime.so
genpy                       python2.7
libcpp_common.so            roslib
libroscpp_serialization.so
root@EB1_MA-XU3-3EG-2I-D11:~# ls /opt/ros/melodic/share
catkin                mk                    roscpp_traits
cpp_common            ros                   roscreate
gencpp                ros_environment       roslang
genmsg                rosbash               roslib
gennodejs             rosboost_cfg          rosmake
genpy                 rosbuild              rospack
message_generation    rosclean              rostime
message_runtime       roscpp_serialization  rosunit
root@EB1_MA-XU3-3EG-2I-D11:~# ros
-sh: ros: command not found
root@EB1_MA-XU3-3EG-2I-D11:~# rostime
-sh: rostime: command not found
root@EB1_MA-XU3-3EG-2I-D11:~# rosunit
Usage: rosunit [options] <file> [test args...]

rosunit: error: You must supply a test file.
root@EB1_MA-XU3-3EG-2I-D11:~# rosclean
usage: rosclean [-h] {check,purge} ...
rosclean: error: too few arguments
root@EB1_MA-XU3-3EG-2I-D11:~# rosrun
Usage: rosrun [--prefix cmd] [--debug] PACKAGE EXECUTABLE [ARGS]
  rosrun will locate PACKAGE and try to find
  an executable named EXECUTABLE in the PACKAGE tree.
  If it finds it, it will run it with ARGS.
root@EB1_MA-XU3-3EG-2I-D11:~#

Best regards,

Simão Araújo