Meta ROS

These instructions are for building ROS 2 galactic and ROS 1 noetic using OpenEmbedded release series dunfell (Yocto 3.1) or kirkstone (Yocto 4.0) on IoT Yocto. An overview of OpenEmbedded/Yocto can be found in the Yocto Project Overview and Concepts Manual. Additional information on meta-ros can be found in Superflore OE Recipe Generation Scheme.

Important

Users can only choose RO2 or ROS1 to install, we do not support both versions existing in the system at the same time

Add meta-ros to rity-demo-image

In conf/local.conf , change MACHINE to your desired platform and comment out multilib-relevant configuration:

# change MACHINE to your desired platform, default is i300a-pumpkin
MACHINE ??= "genio-700-evk"

# Define multilib target
#require conf/multilib.conf
#MULTILIBS = "multilib:lib32"
#DEFAULTTUNE:virtclass-multilib-lib32 = "armv7athf-neon"

# Video Encode on i300a is only supported in the 32-bits binaries
#IMAGE_INSTALL:remove:i300a = "mtk-vpud"
#IMAGE_INSTALL:append:i300a = "lib32-mtk-vpud"

Build ROS on Kirkstone

Please run following command to download the meta-ros layer:

git clone https://github.com/ros/meta-ros.git $PROJ_ROOT/src/meta-ros

Modify the compatible series in configuration file to kirkstone

vim src/meta-ros/meta-ros-common/conf/ros-distro/ros-distro.conf

# change ROS_OE_RELEASE_SERIES to kirkstone, default is honister
ROS_OE_RELEASE_SERIES = "kirkstone"

Add ROS2 layer

  1. Add meta-ros layers to conf/bblayers.conf

<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros2 \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-common \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros2-galactic \
  1. Add this to the bottom of conf/local.conf

ROS_DISTRO = "galactic"
EXTRA_IMAGE_FEATURES ?= "ros-implicit-workspace"
IMAGE_INSTALL:append = " ros-core "

Note

Currently we only support ROS2 on Kirkstone.

  1. Build image. Please refer to Build Image section for details.

Build ROS on Dunfell

Please run following command to download the meta-ros layer:

git clone https://github.com/ros/meta-ros.git -b dunfell $PROJ_ROOT/src/meta-ros

Add ROS2 layer

  1. Add meta-ros layers to conf/bblayers.conf

<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros2 \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-common \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros2-galactic \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-backports-gatesgarth \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-backports-hardknott \
  1. Add this to the bottom of conf/local.conf

ROS_DISTRO = "galactic"
EXTRA_IMAGE_FEATURES ?= "ros-implicit-workspace"
IMAGE_INSTALL:append = " ros-core "
  1. Build image. Please refer to Build Image section for details.

Add ROS1 layer

  1. Add meta-ros layers to conf/bblayers.conf

<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros1 \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-common \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros1-noetic \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-backports-gatesgarth \
<absolute_path_to_rity-dunfell>/src/poky/../meta-ros/meta-ros-backports-hardknott \
  1. Add this to the bottom of conf/local.conf

ROS_DISTRO = "noetic"
EXTRA_IMAGE_FEATURES ?= "ros-implicit-workspace"
IMAGE_INSTALL:append = " ros-core "
  1. Comment out the blacklisted roslisp and genlisp to avoid the building rejection

vim src/meta-ros/meta-ros1-noetic/conf/ros-distro/include/noetic/ros-distro-recipe-blacklist.inc

# Comment out the following lines
#PNBLACKLIST[roslisp] ?= "${@bb.utils.contains('ROS_WORLD_SKIP_GROUPS', 'lisp', 'depends on sbcl for which there is no OE recipe', '', d)}"
#PNBLACKLIST[genlisp] ?= "${@bb.utils.contains('ROS_WORLD_SKIP_GROUPS', 'lisp', 'depends on sbcl for which there is no OE recipe', '', d)}"
  1. Build image. Please refer to Build Image section for details.

Build Image

Please refer to Build from Source Code to build the demo images of each board.

Note

Various WARNING-s will be issued by bitbake when building these images. They can be ignored. After a successful build of an image, it can be found under TMPDIR/deploy/images/MACHINE.

Image Sanity Testing

ROS 2 Sanity Test

Note

Without a network connection, there’s no output from ros2 topic echo /chatter.

$ source /etc/profile.d/ros/setup.sh

$ ros2 topic list
/parameter_events
/rosout

$ (sleep 5; ros2 topic pub /chatter std_msgs/String "data: Hello world") &

$ ros2 topic echo /chatter
publisher: beginning loop
publishing #1: std_msgs.msg.String(data='Hello world')

data: Hello world

publishing #2: std_msgs.msg.String(data='Hello world')

data: Hello world

ROS 1 Sanity Test

For now, only the barest minimum sanity testing is done on the images.

$ source /opt/ros/noetic/setup.sh

$ roscore &
...
started core service [/rosout]

$ rosnode list
/rosout

$ rosnode info /rosout
Node [/rosout]
Publications:
 * /rosout_agg [rosgraph_msgs/Log]

Subscriptions:
 * /rosout [unknown type]

Services:
 * /rosout/get_loggers
 * /rosout/set_logger_level


contacting node http://genio-700-evk:40943/ ...
Pid: 967