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 — это среда выполнения и SDK на Rust для создания, запуска, записи и детерминированного воспроизведения статических графов задач роботов. Его часто называют «операционной системой для роботов». Он работает везде: от Linux до микроконтроллеров без операционной системы (bare-metal).
Это полноценное ядро операционной системы или фреймворк, который я компилирую в код своего робота?Несмотря на формулировку «ОС для роботов», это фреймворк и среда выполнения на Rust. Граф задач вы описываете в конфигурационном файле RON, и он встраивается в вашу программу на этапе компиляции, а не запускается как отдельное ядро системы.
Как собрать своё первое приложение на Copper?Установите последнюю стабильную версию набора инструментов Rust, затем с помощью генератора проектов Copper создайте каркас приложения с файлами copperconfig.ron, src/main.rs и src/tasks.rs. В проект входит justfile для просмотра логов, анализа графа, планирования и воспроизведения.
Есть ли подводные камни при работе с bare-metal оборудованием?Если при создании проекта выбрать цель bare-metal/nostd, генератор пропустит каркас для Profile-Guided Scheduling, а файл schedule.ron по умолчанию будет лишь осторожной заглушкой, которую всё равно нужно настроить под вашу реальную нагрузку.
Какое железо Copper реально может запускать?Copper работает на компьютерах разработчиков с Linux и macOS, на одноплатных компьютерах вроде Raspberry Pi и на микроконтроллерах без операционной системы (bare-metal), например на полётных контроллерах STM32H7, которые используются в демонстрации квадрокоптера.
Можно ли использовать Copper вместе с существующим роботом на ROS 2?Да, Copper подключается к ROS 2 через Zenoh, поэтому его можно интегрировать в стек на базе ROS и переходить на него постепенно, а не переписывать всё сразу.
Что такое отладка с путешествием во времени?Можно перематывать записанный запуск, восстанавливать состояние задач в любой момент и повторно выполнять код с теми же записанными входными данными и часами робота. Так проще разобраться, что именно произошло на реальном роботе.
Что такое планирование на основе профилирования (PGS)?PGS преобразует измеренные тайминги, частоты датчиков и дедлайны в варианты расписания выполнения. Их можно сравнить по производительности и скомпилировать в среду выполнения, используя вспомогательные команды just pgs-baseline и just pgs-measure.
Copper уже использовался на настоящих роботах?В README сказано, что его уже применяют для полётов в воздухе, вождения, плавания, космических миссий и управления гуманоидами. Также есть симуляции, которые можно запустить в браузере: это точные копии приложений, работающих на балансирующем роботе на Raspberry Pi и квадрокоптере на STM32H7.
Какие есть похожие проекты?betaflight, Jet, ftl, zxdesk, rt-thread, xgoduck_hardware, autoware, fprime
Автор
copper-project
Размер
1.4 GB
Звёзды
1.6K
Возраст
6 г
Коммиты · 90 дней