Back to Blog
Backend Development

Unitree SDK2 (G1): C++ Development Kit for Unitree Robotics

View Repository on GitHub

What Is Unitree SDK2?

unitree_sdk2_g1 is a fork of the official Unitree Robotics SDK version 2. It provides the core C++ development environment required to write custom control software, read sensor data, and interface directly with Unitree robotic platforms (such as their quadruped or humanoid robots).

This SDK acts as the bridge between high-level logic (like autonomous navigation or computer vision) and the low-level hardware actuation of the robot.

Tech Stack

LayerTechnology
Core LanguageC++
Build SystemCMake (3.10+) / Make
Compiler targetGCC (9.4.0)
Math / KinematicsEigen3
Logging / IOspdlog, fmt, boost
Target OSUbuntu 20.04 LTS (x86_64 and aarch64)

Architecture & Features

The SDK is designed to be compiled natively on Linux environments (specifically targeting Ubuntu 20.04) and supports both x86_64 (standard PCs/servers) and aarch64 (ARM architectures like NVIDIA Jetson or Raspberry Pi, which are commonly mounted directly on the robots).

High-Performance Dependencies

The SDK relies heavily on industry-standard C++ libraries for high-performance robotics:

  • Eigen3: Handles the intensive linear algebra required for inverse kinematics, joint space calculations, and robot dynamics.
  • Boost: Provides robust networking, threading, and system-level utilities.
  • spdlog & fmt: Ensures ultra-fast, non-blocking logging which is crucial when debugging real-time control loops running at hundreds of Hertz.

CMake Build Pipeline

The repository is structured around a standard CMake pipeline. By utilizing find_package and standard CMakeLists.txt configurations, developers can easily compile the included examples (mkdir build && cd build && cmake .. && make) or link the SDK into their own standalone ROS or C++ applications.

What I Learned / Engineering Decisions

A critical engineering reality revealed by this SDK is the strict dependency on specific compiler versions (GCC 9.4.0) and OS targets (Ubuntu 20.04). In hardware robotics, API stability and ABI (Application Binary Interface) compatibility are paramount. Upgrading a compiler or OS can subtly break the memory layout or linking of proprietary hardware drivers.

Furthermore, the explicit support for aarch64 highlights the modern robotics paradigm: running compute-heavy SDKs on edge devices (like an ARM-based NVIDIA Jetson) directly onboard the robot, allowing for low-latency control without relying on an external tethered computer.

View on GitHub →