copper-rs README

项目的 README,来自 github.com/copper-project/copper-rs。合并为一个 markdown 文件:README.md。

Copper logo
Copper Runtime & SDK

A Rust runtime for building, running, recording, and deterministically replaying static robot task graphs, from Linux to bare metal.

CI/CD status cu29 on crates.io Read the Copper book Copper documentation Browse the Copper component catalog Copper release notes Join Copper Discord

Hacker News

▶ Try Copper in your browser  ·  ⚒︎ Build your first app

Why Copper

Built for robots Built to ship
Static by design: task graphs are declared in RON and wired at compile time. Runs anywhere: Linux, macOS, SBCs, and bare-metal microcontrollers.
Realtime first: zero-allocation, data-oriented execution on the hot path. Deterministic replay: record a run, reproduce it, and inspect it offline.
Rust-first: ergonomic task APIs with compile-time guarantees. Interoperable: connect to ROS 2 through Zenoh and migrate progressively.

Already flying, driving, swimming, spacefaring, powering humanoids, and moving robot arms.

See It Run

These are the same Copper applications used on physical robots, recompiled for the browser. The simulator runs beside a live view of the Copper task graph and latency.

BalanceBot browser demo
BalanceBot
A self-balancing robot simulation using the application that runs on Raspberry Pi hardware.
Source code
Flight controller browser demo
Flight Controller
A quadcopter simulation using the control stack deployed on STM32H7 flight hardware.
Source code

Watch more robots built with Copper in the community showcase, or explore the cross-framework benchmarks.

Build Your First Copper App

Install the latest stable Rust toolchain, then:

cargo install cargo-cunew
cargo cunew hello_copper
cd hello_copper
cargo run

The generated app has a typed source → task → sink graph that prints its first messages and records logs/hello-copper.copper. Start with copperconfig.ron, src/main.rs, and src/tasks.rs; the generated justfile also provides helpers for logs, CopperLists, topology (just graph), the exact generated process schedule (just sched), post-execution timing from the default Copper log (just sched-log), and replay. Host projects also include just pgs-baseline, just pgs-optimize, just pgs-candidate, and just pgs-measure; the starter schedule.ron is a conservative placeholder to tune for the real workload. Project creation asks whether the target is bare metal/no_std and omits PGS scaffolding for that choice.

How Copper Fits Together

Stage What happens
Declare Define the static task graph in copperconfig.ron.
Generate #[copper_runtime] wires the graph at compile time.
Run Execute deterministically with a zero-allocation hot path.
Record Capture messages, timing, and state in a unified .copper log.
Inspect Replay a recorded run, export its data, and inspect its state.

The robot is a static thing: Copper turns its declared graph into a purpose-built runtime, then records messages, timing, and state into one replayable log. RobotClock makes time explicit across hardware, simulation, and replay.

What Sets Copper Apart

Explore Copper

Learn Book · Runtime overview · API docs
Build Project templates · RON reference · Component catalog
Go deeper Architecture notes · Examples · Logging and replay · Python support
Project Supported platforms · Release notes
Community Contributing · GitHub Discussions · Discord

copper-rs (copper-project/copper-rs)

正在搜索数据库…

这是什么?Copper 是一个 Rust 运行时和 SDK,用于构建、运行、记录和确定性回放静态的机器人任务图。它常被称为“机器人操作系统”,可运行在从 Linux 到裸机微控制器的各类设备上。
这是一个完整的操作系统内核,还是一个可以编译进机器人代码里的框架?尽管常被称为“机器人操作系统”,它实际上是一个 Rust 框架/运行时。你在 RON 配置文件中声明任务图,它会在编译时被集成进你的二进制文件中,而不是作为独立内核启动。
我该如何构建第一个 Copper 应用?安装最新的稳定版 Rust 工具链,然后使用 Copper 项目生成器搭建应用骨架,其中包含 copperconfig.ron、src/main.rs 和 src/tasks.rs,并附带一个 justfile,可用于查看日志、检查任务图、调度和回放。
在裸机硬件上运行时有哪些需要注意的地方?如果你在创建项目时选择了裸机/nostd 目标,生成器会跳过基于性能剖析的调度(PGS)的脚手架代码。它生成的默认 schedule.ron 只是一个保守的占位配置,你仍需根据实际工作负载进行调优。
Copper 实际能在什么硬件上运行?它可以运行在 Linux 和 macOS 开发机、树莓派等单板计算机,以及裸机微控制器上,例如四旋翼无人机演示中所用的 STM32H7 飞控。
我可以把 Copper 和现有的 ROS 2 机器人一起使用吗?可以。Copper 通过 Zenoh 与 ROS 2 连接,因此你可以将它集成到基于 ROS 的技术栈中,并逐步迁移,而无需一次性重写所有代码。
什么是时间旅行调试?你可以在一次已记录的运行中前后定位,恢复任意时间点的任务状态,并使用记录下来的精确输入和机器人时钟重新执行代码,从而调试机器人在真实环境中实际发生的情况。
什么是基于性能剖析的调度(PGS)?PGS 会把实测的时序、传感器频率和截止时间转换为候选执行调度方案,你可以对这些方案进行基准测试,并将其编译进运行时中。相关辅助命令包括 just pgs-baseline 和 just pgs-measure。
Copper 真的在实际机器人上用过吗?README 中称,它已经用于飞行、驾驶、水中游动、太空任务以及为人形机器人提供动力。此外,它还提供可在浏览器中运行的模拟程序,分别对应树莓派平衡机器人和 STM32H7 四旋翼无人机上实际运行的同款应用。
有哪些类似的项目?betaflight, Jet, ftl, zxdesk, rt-thread, xgoduck_hardware, autoware, fprime
大小
1.4 GB
星标
1.6K
时长
6年
提交 · 90 天