arXiv:2603.07442cs.RO2026-03被引 3

让Python实时动态更新C++机器人控制代码,无需中断1kHz控制循环

LITHE: Bridging Best-Effort Python and Real-Time C++ for Hot-Swapping Robotic Control Laws on Commodity Linux

  • 用CPU隔离+无锁通信+流水执行,实现高精度时序控制
  • 在负载下仍保持100μs内最坏执行时间、4μs内最大抖动
  • 首次实现大模型在线调整实时控制器,支持人机协同进化

现代机器人系统采用分层控制架构:高层‘大脑’(Python)指挥底层‘脊柱’(C++实时控制器)。这一结构使大脑难以完全重写脊柱的固定控制逻辑,阻碍了对不同任务和环境的深度适应。传统方法需复杂中间件、专用硬件或牺牲实时性能。我们提出LITHE(Linux隔离线程分层执行),一种轻量级软件架构,将机器人控制层级部署于普通单板计算机(树莓派4B + pi3hat),同时保持大脑与脊柱间安全的频率解耦。LITHE通过严格CPU隔离(isolcpus)、无锁进程间通信(IPC)及流水线执行,满足高频实时任务,抖动极小。新增多线程动态链接后,可实现基于Python的大脑动态演化1kHz C++脊柱的控制逻辑而不停止运行。验证显示,在重载下最坏执行时间(WCET)<100 μs,最大释放抖动(MRJ)<4 μs。我们演示了创新应用:大语言模型(LLM)监督器在线完成系统辨识,并实时演化控制器,不中断1kHz控制回路。本质上,LITHE消除了‘不可变编译代码’瓶颈,使高阶人工智能能持续合成并注入全新控制策略至实时脊柱中,弥合高层智能与底层实时控制间的鸿沟,推动安全、人在回路系统的持续实时进化。

原文摘要 · Abstract (English)

Modern robotic systems rely on hierarchical control, where a high-level "Brain" (Python) directs a lower-level "Spine" (C++ real-time controller). Despite its necessity, this hierarchy makes it difficult for the Brain to completely rewrite the Spine's immutable control logic, consequently inhibiting fundamental adaptation for different tasks and environments. Conventional approaches require complex middleware, proprietary hardware, or sacrifice real-time performance. We present LITHE (Linux Isolated Threading for Hierarchical Execution), a lightweight software architecture that collapses the robot control hierarchy onto a commodity single-board computer (Raspberry Pi 4B with pi3hat), while maintaining safe frequency decoupling between the Brain and Spine. LITHE integrates strict CPU isolation (isolcpus), lock-free inter-process communication (IPC), and pipelined execution to meet high-frequency deadlines with minimal jitter. By adding multi-threaded dynamic linking, LITHE enables a Python-based Brain to dynamically evolve the logic of a 1kHz C++ Spine without interruption. We validate "functional real-time" system performance with worst-case execution time (WCET) < 100 $μ$s and maximum release jitter (MRJ) < 4 $μ$s under heavy load. We demonstrate a novel application where a large language model (LLM) supervisor performs online system identification to evolve a real-time controller on-the-fly, without interrupting the 1 kHz control loop. In essence, LITHE eliminates the "immutable compiled code" bottleneck for best-effort Brains to synthesize and inject completely new control laws into the real-time Spine. This bridges a critical gap between high-level AI and low-level real-time control to unlock continuous real-time evolution of embodied intelligence in safe, human-in-the-loop systems.

机器人控制实时系统PythonLLM应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。