Skip to content

Yocto for Robotics

Advanced

Yocto Project is a Linux Foundation collaborative project that produces tools for creating custom Linux distributions for embedded systems. For robotics, Yocto enables building production-grade operating systems optimized for specific robot hardware—including only necessary components for minimal footprint and maximum reproducibility.

Prerequisites

Why Yocto for Robotics?

  • Reproducibility: Identical builds across machines and time
  • Minimal footprint: Include only what your robot needs
  • Custom kernel: Enable PREEMPT_RT for real-time control
  • Hardware optimization: BSP layers for Jetson, Raspberry Pi, etc.
  • Production-ready: OTA updates, security hardening, long-term support

Current Releases (January 2026)

ReleaseCodenameStatusROS 2 Distro
5.0ScarthgapLTSJazzy
5.1StyheadStableJazzy, Rolling
4.0KirkstoneLTS (EOL Apr 2026)Humble

Layer Architecture

Yocto uses a layered architecture where each meta-* layer adds functionality:

┌────────────────────────────────────────────────────────────┐
│ Yocto Layer Stack for Robotics │
├────────────────────────────────────────────────────────────┤
│ │
│ Application Layer │
│ ┌────────────────────────────────────────────────────┐ │
│ │ meta-myrobot (your custom robot packages) │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ Middleware Layer │
│ ┌─────────────────┐ │ ┌─────────────────────┐ │
│ │ meta-ros2-jazzy │◄────┼────►│ meta-tegra-community│ │
│ │ (ROS 2 runtime) │ │ │ (extra packages) │ │
│ └─────────────────┘ │ └─────────────────────┘ │
│ │ │
│ BSP Layer │
│ ┌────────────────────────────────────────────────────┐ │
│ │ meta-tegra (Jetson Linux, CUDA 12.6, TensorRT) │ │
│ └────────────────────────────────────────────────────┘ │
│ │ │
│ Core Layer │
│ ┌────────────────────────────────────────────────────┐ │
│ │ openembedded-core / poky (base recipes, tools) │ │
│ └────────────────────────────────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────┘

Getting Started with kas

kas simplifies Yocto builds through YAML configuration:

jetson-robot.yml
header:
version: 14
machine: jetson-agx-orin-devkit
distro: poky
repos:
poky:
url: "https://git.yoctoproject.org/poky"
refspec: scarthgap
layers:
meta:
meta-poky:
meta-openembedded:
url: "https://git.openembedded.org/meta-openembedded"
refspec: scarthgap
layers:
meta-oe:
meta-python:
meta-networking:
meta-tegra:
url: "https://github.com/OE4T/meta-tegra.git"
refspec: scarthgap
meta-ros:
url: "https://github.com/ros/meta-ros.git"
refspec: scarthgap
layers:
meta-ros2:
meta-ros2-jazzy:
local_conf_header:
robotics: |
ROS_DISTRO = "jazzy"
IMAGE_INSTALL:append = " ros-jazzy-ros-base"
LICENSE_FLAGS_ACCEPTED = "commercial_nvidia"

Configuration Files

build/conf/local.conf
MACHINE = "jetson-agx-orin-devkit"
DISTRO = "poky"
# Enable ROS 2 Jazzy
ROS_DISTRO = "jazzy"
# Parallelism (adjust to your CPU cores)
BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 8"
# Image features
IMAGE_INSTALL:append = " \
ros-jazzy-ros-base \
ros-jazzy-nav2-bringup \
ros-jazzy-slam-toolbox \
"
# Accept NVIDIA licenses for CUDA components
LICENSE_FLAGS_ACCEPTED = "commercial_nvidia"

Creating a Custom Robot Image

meta-myrobot/recipes-images/myrobot-image.bb
SUMMARY = "Custom robot image with ROS 2 and navigation"
LICENSE = "MIT"
inherit core-image
IMAGE_FEATURES += "ssh-server-openssh"
IMAGE_INSTALL = " \
packagegroup-core-boot \
${CORE_IMAGE_EXTRA_INSTALL} \
ros-jazzy-ros-base \
ros-jazzy-nav2-bringup \
ros-jazzy-slam-toolbox \
ros-jazzy-robot-state-publisher \
myrobot-bringup \
"
# Increase rootfs size for ROS packages (2GB extra)
IMAGE_ROOTFS_EXTRA_SPACE = "2097152"

Jetson Deployment Flow

┌────────────────────────────────────────────────────────────┐
│ Yocto → Jetson Deployment │
├────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ bitbake │───►│ .wic │───►│ Flash │ │
│ │ build │ │ image │ │ Tool │ │
│ └──────────┘ └──────────┘ └────┬─────┘ │
│ │ │
│ ▼ │
│ Recovery Mode USB ──────────► ┌─────────────┐ │
│ │ Jetson Orin │ │
│ │ (eMMC/NVMe) │ │
│ └─────────────┘ │
│ │
│ Alternative: A/B OTA updates via swupdate │
│ │
└────────────────────────────────────────────────────────────┘

Supported Jetson Platforms (meta-tegra)

  • jetson-agx-orin-devkit — AGX Orin 64GB/32GB
  • jetson-orin-nano-devkit-nvme — Orin Nano 8GB/4GB
  • jetson-orin-nx-xavier-nx-devkit — Orin NX 16GB/8GB

Real-Time Linux (PREEMPT_RT)

For deterministic robot control loops, enable the real-time kernel:

Terminal window
# In local.conf
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"

This provides:

  • Deterministic control loop timing
  • Consistent sensor polling intervals
  • Predictable actuator response
  • Required for safety-critical applications

Development Workflow

Terminal window
# Add new recipe for custom ROS package
devtool add myrobot-pkg /path/to/source
# Modify existing recipe for debugging
devtool modify ros-jazzy-nav2-bringup
# Finish and incorporate changes into your layer
devtool finish myrobot-pkg meta-myrobot

Learn More

Sources