Unitree.Net.Control 0.1.0

dotnet add package Unitree.Net.Control --version 0.1.0
                    
NuGet\Install-Package Unitree.Net.Control -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Unitree.Net.Control" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Unitree.Net.Control" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Unitree.Net.Control" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Unitree.Net.Control --version 0.1.0
                    
#r "nuget: Unitree.Net.Control, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Unitree.Net.Control@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Unitree.Net.Control&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Unitree.Net.Control&version=0.1.0
                    
Install as a Cake Tool

Unitree.Net

SDK .NET 10 untuk robot Unitree — wrapper modern di atas Unitree SDK 2, dengan kontrol low-level, lokomosi high-level, integrasi ROS 2, ML, dan LLM.

A .NET 10 SDK for Unitree robots — a modern wrapper over Unitree SDK 2, with low-level control, high-level locomotion, ROS 2 integration, ML, and LLM support.

CI NuGet

Bahasa Indonesia · English


Bahasa Indonesia

Apa ini

Unitree.Net memberi aplikasi .NET akses penuh ke robot Unitree — kuadruped (Go2, B2) dan humanoid (G1, H1, R1) — mulai dari perintah torsi per-motor pada 500 Hz sampai navigasi waypoint dan antarmuka bahasa alami.

Format kabel (wire format) diimplementasikan ulang di C# dan diverifikasi byte-per-byte terhadap tata letak struct C++ Unitree, sehingga CRC yang dihitung SDK ini persis sama dengan yang dihitung firmware. Ini penting: firmware membuang perintah dengan CRC salah tanpa pesan error apa pun.

Instalasi

dotnet add package Unitree.Net

Paket Unitree.Net adalah paket payung: ia menarik seluruh SDK sekaligus. Kalau hanya butuh sebagian, pasang paket per-modul saja (lihat tabel di bagian Packages).

Unitree.Net.Ml sengaja tidak ikut dalam paket payung — ML.NET dan TorchSharp membawa ratusan megabyte runtime native, dan hanya aplikasi analisis gait atau lokomosi hasil pembelajaran yang memerlukannya:

dotnet add package Unitree.Net.Ml

Untuk berbicara dengan firmware robot sungguhan masih dibutuhkan native shim Cyclone DDS, yang dibangun terpisah dengan CMake — lihat native/README.md. Transport murni-managed bawaan SDK hanya bisa bicara dengan simulator.

Mulai cepat

Tidak punya robot? Jalankan simulator dulu — ada tampilan 3D-nya, dan telemetrinya sungguhan:

dotnet run --project apps/Unitree.Net.Simulator          # simulator 3D (Windows)
dotnet run --project samples/Unitree.Net.Samples.VirtualRobot   # versi headless

Lalu di terminal lain:

dotnet run --project apps/Unitree.Net.Cli -- status     # snapshot telemetri
dotnet run --project apps/Unitree.Net.Cli -- monitor    # dashboard langsung
dotnet run --project apps/Unitree.Net.Dashboard         # dashboard web

Mau langsung bikin aplikasi robot? Buka Unitree Robot Wizard — editor kode dengan 16 template yang semuanya jalan di simulator tanpa perlu diubah:

dotnet run --project apps/Unitree.Net.Wizard

Perintah pertama yang harus dijalankan kalau robot "tidak terhubung":

dotnet run --project apps/Unitree.Net.Cli -- diagnose

Perintah ini tidak memerlukan robot dan langsung menunjukkan penyebab paling umum: interface jaringan salah, native library belum dibangun, atau multicast diblokir.

Contoh kode

var services = new ServiceCollection();
services.AddUnitreeRobot(configuration);

await using var provider = services.BuildServiceProvider();
var robot = provider.GetRequiredService<UnitreeRobot>();

await robot.ConnectAsync();
await robot.Sport.StandUpAsync();
await robot.Sport.BalanceStandAsync();

// Stream mengirim ulang perintah 20 kali per detik — robot meng-expire perintah kecepatan sekitar
// setengah detik setelah menerimanya. Kalau proses ini mati, request berhenti dan robot ikut berhenti.
using VelocityStream stream = robot.Sport.StartVelocityStream();
stream.Command = new VelocityCommand(Forward: 0.4f, Lateral: 0f, YawRate: 0.2f);

await Task.Delay(TimeSpan.FromSeconds(3));
stream.Stop();

Fitur

Komponen Isi
Core Model robot, peta sendi, matematika pose, batas keselamatan, loop real-time
Messages Codec CDR tanpa alokasi, tipe unitree_go / unitree_api, CRC-32 Unitree
Dds Abstraksi transport; transport UDP multicast murni-managed dan loopback
Interop Binding P/Invoke ke shim Cyclone DDS (kompatibel dengan firmware robot)
Control Kontrol sendi low-level, klien sport, navigasi waypoint, motion switcher
Manipulation Perencanaan trajektori quintic, kontrol lengan, koordinasi dual-arm
Sensors IMU, LiDAR (PointCloud2), kontak kaki, monitor baterai, telemetry hub
Ros2 Jembatan ke sensor_msgs/Imu, nav_msgs/Odometry, geometry_msgs/Twist
Diagnostics Metrik OpenTelemetry, health check ASP.NET Core
Firmware Paket terverifikasi, staging, gating kesehatan, rollback otomatis
Ml Analisis gait ML.NET, deteksi anomali, inferensi kebijakan TorchSharp
Ai Semantic Kernel dengan pilihan OpenAI / Anthropic / Gemini / Ollama
Simulation Kinematika delapan platform, dipakai simulator maupun test
Wizard.Core Template proyek, scaffolding, build, deploy SSH ke robot

Perkakas

Aplikasi Isi
Simulator Simulator robot 3D. Pilih platform (Go2, Go2-W, B2, B2-W, G1, H1, H1-2, R1), tekan Start, dan telemetri sungguhan mulai dipublikasikan. Ada panel status, panel log, dan drive pad.
Robot Wizard Editor kode dengan 16 template aplikasi robot, build/run/deploy, dan Jack The Code Bender — asisten yang membaca proyek Anda dan menulis kode dengan API SDK yang sebenarnya.
Extension VS Code Buat proyek, connect ke robot atau simulator, run, debug, dan deploy langsung dari editor. Ada panel status robot dan panel logs.
CLI diagnose, status, monitor, postur, move, chat AI, plus templates/new/probe/stream/deploy untuk otomasi
Dashboard Dashboard web Blazor dengan grafik telemetri langsung

Semua template di wizard sudah diverifikasi bisa dikompilasi:

dotnet run --project tools/Unitree.Net.TemplateCheck

Keselamatan

Robot ini berbobot puluhan kilogram dan bergerak di ruang nyata. Beberapa hal yang dibangun ke dalam SDK:

  • Envelope keselamatan membatasi kecepatan, torsi, gain, dan laju perubahan setpoint per tick.
  • Stream kecepatan menjaga perintah tetap mengalir; kalau proses mati robot berhenti sendiri.
  • Deteksi jatuh dan batas suhu motor memicu emergency stop yang terkunci.
  • Fungsi gerak untuk LLM dinonaktifkan secara default — harus diaktifkan secara sadar.

Baca docs/safety.md sebelum menjalankan kontrol low-level.

Dokumentasi

Dokumentasi lengkap ada di docs/, termasuk simulator dan Robot Wizard.

PROGRESS.md sengaja memisahkan "build dan test lulus" dari "tervalidasi di hardware". Belum ada yang dijalankan di robot sungguhan.

Kredit

Perkakas Unitree.Net — Simulator, Robot Wizard dengan Jack The Code Bender, dan extension VS Code — dibuat oleh Gravicode Studios, dipimpin Kang Fadhil.


English

What this is

Unitree.Net gives .NET applications full access to Unitree robots — quadrupeds (Go2, B2) and humanoids (G1, H1, R1) — from per-motor torque commands at 500 Hz up to waypoint navigation and a natural-language interface.

The wire format is reimplemented in C# and verified byte-for-byte against Unitree's C++ struct layout, so the CRC this SDK computes is exactly the one the firmware computes. That matters: the firmware discards a command with a bad CRC without reporting anything at all.

Installation

dotnet add package Unitree.Net

Unitree.Net is an umbrella package that pulls in the whole SDK. Install the individual packages instead if you only need part of it — they are listed under Packages below.

Unitree.Net.Ml is deliberately not part of the umbrella: ML.NET and TorchSharp bring hundreds of megabytes of native runtime with them, and only applications doing gait analysis or learned locomotion need it.

dotnet add package Unitree.Net.Ml

Talking to real robot firmware also needs the Cyclone DDS native shim, which is built separately with CMake — see native/README.md. The pure-managed transport that ships in the box reaches the simulator only.

Quick start

No robot? Start the simulator first — it has a 3D viewport, and the telemetry it publishes is real:

dotnet run --project apps/Unitree.Net.Simulator                  # 3D simulator (Windows)
dotnet run --project samples/Unitree.Net.Samples.VirtualRobot    # headless equivalent

Then, in another terminal:

dotnet run --project apps/Unitree.Net.Cli -- status     # one-shot telemetry
dotnet run --project apps/Unitree.Net.Cli -- monitor    # live dashboard
dotnet run --project apps/Unitree.Net.Dashboard         # web dashboard

To start writing a robot application, open the Unitree Robot Wizard — a code editor with 16 templates, every one of which runs against the simulator without edits:

dotnet run --project apps/Unitree.Net.Wizard

The first thing to run whenever a robot "won't connect":

dotnet run --project apps/Unitree.Net.Cli -- diagnose

It needs no robot and immediately distinguishes the three usual causes: the wrong network interface, a missing native library, or filtered multicast.

Example

var services = new ServiceCollection();
services.AddUnitreeRobot(configuration);

await using var provider = services.BuildServiceProvider();
var robot = provider.GetRequiredService<UnitreeRobot>();

await robot.ConnectAsync();
await robot.Sport.StandUpAsync();
await robot.Sport.BalanceStandAsync();

// The stream resends the command at 20 Hz, which is what keeps the robot going — it expires a
// velocity about half a second after receiving one. If this process dies the resends stop and so
// does the robot. Pass commandTimeout when the command's source is remote and can vanish.
using VelocityStream stream = robot.Sport.StartVelocityStream();
stream.Command = new VelocityCommand(Forward: 0.4f, Lateral: 0f, YawRate: 0.2f);

await Task.Delay(TimeSpan.FromSeconds(3));
stream.Stop();

Packages

Package Contents
Unitree.Net Umbrella package — references everything below except Unitree.Net.Ml
Unitree.Net.Core Robot models, joint maps, pose maths, safety limits, real-time loop
Unitree.Net.Messages Zero-allocation CDR codec, unitree_go / unitree_api types, Unitree CRC-32
Unitree.Net.Dds Transport abstraction; pure-managed multicast and loopback transports
Unitree.Net.Interop P/Invoke bindings to the Cyclone DDS shim (firmware-compatible)
Unitree.Net.Control Low-level joint control, sport client, waypoint navigation, motion switcher
Unitree.Net.Manipulation Quintic trajectory planning, arm control, dual-arm coordination
Unitree.Net.Sensors IMU, LiDAR (PointCloud2), foot contact, battery monitoring, telemetry hub
Unitree.Net.Ros2 Bridge to sensor_msgs/Imu, nav_msgs/Odometry, geometry_msgs/Twist
Unitree.Net.Diagnostics OpenTelemetry-compatible metrics, ASP.NET Core health checks
Unitree.Net.Firmware Verified packages, staging, health gating, automatic rollback
Unitree.Net.Ml ML.NET gait analysis, anomaly detection, TorchSharp policy inference
Unitree.Net.Ai Semantic Kernel with OpenAI / Anthropic / Gemini / Ollama providers
Unitree.Net.Extensions.DependencyInjection AddUnitreeRobot, configuration binding, health checks, hosted services
Unitree.Net.Simulation Rig-driven kinematics for all eight platforms, shared by the simulator and the tests
Unitree.Net.Wizard.Core Project templates, scaffolding, build orchestration, SSH deployment

Tools

Application What it does
Simulator A 3D robot simulator. Pick a platform (Go2, Go2-W, B2, B2-W, G1, H1, H1-2, R1), press Start, and it publishes real telemetry on the SDK's own transport — the CLI and dashboard connect to it exactly as they would to hardware. Status panel, drive pad, system log, and a ribbon showing each topic's measured rate.
Robot Wizard A code editor with 16 project templates, build/run/deploy, and Jack The Code Bender — an assistant that reads your project, looks things up, and writes code against the real SDK API rather than a remembered one.
VS Code extension Create a project, connect to a robot or the simulator, run, debug and deploy without leaving the editor. Live robot status and logs in the sidebar.
CLI diagnose, status, monitor, postures, move, AI chat, plus templates / new / probe / stream / deploy for automation
Dashboard Blazor web dashboard with live telemetry charts

Every wizard template is verified to compile:

dotnet run --project tools/Unitree.Net.TemplateCheck

The simulator and the wizard are WPF shells and therefore Windows-only. The engines behind them — Unitree.Net.Simulation and Unitree.Net.Wizard.Core — are plain net10.0 and run anywhere.

Transports

Three transports sit behind one interface, so the same application runs against hardware, a host-only link, or an in-process loopback with only a configuration change:

Transport Talks to firmware Needs native library Use for
CycloneNative Yes Yes Real robots
ManagedMulticast No No Simulators, host-to-host, integration tests
Loopback No No Unit tests

ManagedMulticast carries CDR payloads inside Unitree.Net's own framing — it is not RTPS and cannot reach robot firmware. See native/README.md to build the native shim.

Safety

These robots weigh tens of kilograms and move in a real space. Built into the SDK:

  • A safety envelope bounds velocity, torque, gains and per-tick setpoint slew.
  • The velocity stream keeps commands flowing; if the process dies the robot stops within half a second, and an explicit commandTimeout covers a remote source that vanishes.
  • Fall detection and motor temperature limits latch an emergency stop.
  • LLM motion functions are off by default and require two separate opt-ins to enable.

Read docs/safety.md before running low-level control.

Building

dotnet build Unitree.Net.slnx
dotnet test  Unitree.Net.slnx

Requires the .NET 10 SDK. The native shim is optional and built separately with CMake.

Documentation

Full documentation lives in docs/:

Project planning is in PLAN.md; current status in PROGRESS.md.

PROGRESS.md deliberately separates "builds and passes tests" from "validated on hardware". Nothing in this repository has been run against a real robot.

Credits

The Unitree.Net tooling — the Simulator, the Robot Wizard with Jack The Code Bender, and the VS Code extension — dibuat oleh Gravicode Studios, dipimpin Kang Fadhil.

Licence

MIT. Not affiliated with or endorsed by Unitree Robotics.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Unitree.Net.Control:

Package Downloads
Unitree.Net.Ai

Semantic Kernel workflow engine for Unitree robots, with pluggable OpenAI, Anthropic, Gemini and Ollama providers and safety-gated robot plugins.

Unitree.Net.Ros2

ROS 2 bridge for Unitree.Net: republishes robot telemetry as sensor_msgs/nav_msgs types and accepts geometry_msgs/Twist velocity commands.

Unitree.Net.Manipulation

Trajectory planning and arm control for Unitree manipulators, including dual-arm coordination for G1 and R1.

Unitree.Net.Extensions.DependencyInjection

Dependency-injection wiring for Unitree.Net: registers the transport, robot, telemetry, metrics, health checks and AI workflow engine from configuration.

Unitree.Net

The Unitree.Net SDK for .NET — control, telemetry, DDS transport, navigation, manipulation, diagnostics, firmware management, ROS 2 bridging and AI workflows for Unitree quadrupeds (Go2, B2) and humanoids (G1, H1, R1). This is the umbrella package; it references the whole SDK except Unitree.Net.Ml, which is installed separately.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 137 9/1/2026