Yocto for Robotics
Advanced
jetson-robot.yml Terminal window
build/conf/local.conf build/conf/bblayers.conf
meta-myrobot/recipes-images/myrobot-image.bb
Terminal window
Terminal window
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
ROS 2 Robot Operating System integrated via meta-ros
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)
| Release | Codename | Status | ROS 2 Distro |
|---|---|---|---|
| 5.0 | Scarthgap | LTS | Jazzy |
| 5.1 | Styhead | Stable | Jazzy, Rolling |
| 4.0 | Kirkstone | LTS (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:
header: version: 14
machine: jetson-agx-orin-devkitdistro: 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"# Install kaspip install kas
# Build the imagekas build jetson-robot.yml
# Enter shell for manual bitbake commandskas shell jetson-robot.yml
# Checkout repos only (no build)kas checkout jetson-robot.ymlConfiguration Files
MACHINE = "jetson-agx-orin-devkit"DISTRO = "poky"
# Enable ROS 2 JazzyROS_DISTRO = "jazzy"
# Parallelism (adjust to your CPU cores)BB_NUMBER_THREADS = "8"PARALLEL_MAKE = "-j 8"
# Image featuresIMAGE_INSTALL:append = " \ ros-jazzy-ros-base \ ros-jazzy-nav2-bringup \ ros-jazzy-slam-toolbox \"
# Accept NVIDIA licenses for CUDA componentsLICENSE_FLAGS_ACCEPTED = "commercial_nvidia"BBLAYERS ?= " \ /path/to/poky/meta \ /path/to/poky/meta-poky \ /path/to/meta-openembedded/meta-oe \ /path/to/meta-openembedded/meta-python \ /path/to/meta-tegra \ /path/to/meta-ros/meta-ros2 \ /path/to/meta-ros/meta-ros2-jazzy \ /path/to/meta-myrobot \"Creating a Custom Robot Image
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/32GBjetson-orin-nano-devkit-nvme— Orin Nano 8GB/4GBjetson-orin-nx-xavier-nx-devkit— Orin NX 16GB/8GB
Real-Time Linux (PREEMPT_RT)
For deterministic robot control loops, enable the real-time kernel:
# In local.confPREFERRED_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
# Add new recipe for custom ROS packagedevtool add myrobot-pkg /path/to/source
# Modify existing recipe for debuggingdevtool modify ros-jazzy-nav2-bringup
# Finish and incorporate changes into your layerdevtool finish myrobot-pkg meta-myrobotRelated Terms
ROS 2 Robot Operating System integrated via meta-ros
Isaac ROS NVIDIA GPU-accelerated ROS packages
TensorRT Inference runtime included in Jetson images
Learn More
- Yocto Project Documentation — Official reference
- tegra-demo-distro — Working Jetson example
- kas Documentation — Build automation tool
- meta-ros GitHub — ROS 2 layer for Yocto
Sources
- Yocto Project Homepage — Linux Foundation project overview
- Scarthgap 5.0 Release Notes — Current LTS release details
- meta-tegra GitHub — Official Jetson BSP layer
- meta-ros GitHub — ROS/ROS 2 integration layer
- kas GitHub — Siemens build automation tool
- OpenEmbedded Layer Index — Layer compatibility info