Expand description
§Copper Runtime & SDK
Think of Copper as a robotics game engine: define a task graph, compile once, and get deterministic execution, unified logging, and sub-microsecond latency from Linux workstations all the way down to bare-metal MPU builds.
§Quick start
cargo install cargo-generate
git clone https://github.com/copper-project/copper-rs
cd copper-rs/templates
cargo cunew /path/to/my_robot # scaffolds a full Copper projectIt will generate a minimal Copper robot project at /path/to/my_robot. cargo build should
compile it out of the box.
§Concepts behind Copper
Check out the Copper Wiki to understand the deployments concepts, task lifecycle, available components, etc …
§More examples to get you started
examples/cu_caterpillar: a minimal running example passing around booleans.examples/cu_rp_balancebot: a more complete example try Copper without hardware viacargo install cu-rp-balancebot+balancebot-sim(Bevy + Avian3d).
§Key traits and structs to check out
cu29_runtime::app::CuApp: the main trait the copper runtime will expose to run your application. (when run() etc .. is coming from)cu29_runtime::config::CuConfig: the configuration of your runtimecu29_runtime::cutask::CuTask: the core trait and helpers to implement your own tasks.cu29_runtime::cubridge::CuBridge: the trait to implement bridges to hardware or other software.cu29_runtime::curuntime::CuRuntime: the runtime that manages task execution.cu29_runtime::simulation: This will explain how to hook up your tasks to a simulation environment.
Need help or want to show what you’re building? Join Discord and hop into the #general channel.
Re-exports§
pub use bincode;pub use cu29_clock as clock;pub use rayon;
Modules§
- config
- This module defines the configuration of the copper runtime. The configuration is a directed graph where nodes are tasks and edges are connections between tasks. The configuration is serialized in the RON format. The configuration is used to generate the runtime code at compile time.
- copperlist
- CopperList is the main data structure used by Copper to communicate between tasks. It is a queue that can be used to store preallocated messages between tasks in memory order.
- cuasynctask
- cubridge
- Typed bridge traits and helpers used to connect Copper to external components both as a sink and a source.
- curuntime
- CuRuntime is the heart of what copper is running on the robot.
It is exposed to the user via the
copper_runtimemacro injecting it as a field in their application struct. - cutask
- This module contains all the main definition of the traits you need to implement or interact with to create a Copper task.
- monitoring
- Some basic internal monitoring tooling Copper uses to monitor itself and the tasks it is running.
- payload
- prelude
- simulation
cu29::simulationModule
Macros§
- input_
msg - output_
msg - rx_
channels - Declares the receive channels of a
CuBridgeimplementation. - tx_
channels - Declares the transmit channels of a
CuBridgeimplementation.
Structs§
- CuCompact
String - CuError
- Common copper Error type.
Enums§
- Unified
LogType - Defines the types of what can be logged in the unified logger.
Constants§
Traits§
- Copper
List Tuple - A CopperListTuple needs to be encodable, decodable and fixed size in memory.
- CuMsg
Metadata Trait - Key metadata piece attached to every message in Copper.
- Erased
CuStamped Data - A generic trait to expose the generated CuStampedDataSet from the task graph.
- Erased
CuStamped Data Set - Trait to get a vector of type-erased CuStampedDataSet This is used for generic serialization of the copperlists
- Matching
Tasks - Trait to trace back from the CopperList the origin of the messages
- Metadata
- Represent the minimum set of traits to be usable as Metadata in Copper.
- Write
Stream - Defines a basic write, append only stream trait to be able to log or send serializable objects.
Functions§
- read_
configuration - Read a copper configuration from a file.