cu29/lib.rs
1//! # Copper Runtime & SDK
2//!
3//! Think of Copper as a robotics game engine: define a task graph, compile once,
4//! and get deterministic execution, unified logging, and sub-microsecond
5//! latency from Linux workstations all the way down to bare-metal MPU builds.
6//!
7//! ## Quick start
8//!
9//! ```bash
10//! cargo install cargo-generate
11//! git clone https://github.com/copper-project/copper-rs
12//! cd copper-rs/templates
13//! cargo cunew /path/to/my_robot # scaffolds a full Copper project
14//! ```
15//!
16//! It will generate a minimal Copper robot project at `/path/to/my_robot`. `cargo build` should
17//! compile it out of the box.
18//!
19//! ## Concepts behind Copper
20//!
21//! Check out the [Copper Wiki](https://github.com/copper-project/copper-rs/wiki) to understand the
22//! deployments concepts, task lifecycle, available components, etc ...
23//!
24//! ## More examples to get you started
25//!
26//! - `examples/cu_caterpillar`: a minimal running example passing around booleans.
27//! - `examples/cu_rp_balancebot`: a more complete example try Copper without hardware via
28//! `cargo install cu-rp-balancebot` + `balancebot-sim` (Bevy + Avian3d).
29//!
30//! ## Key traits and structs to check out
31//!
32//! - `cu29_runtime::app::CuApp`: the main trait the copper runtime will expose to run your application. (when run() etc .. is coming from)
33//! - `cu29_runtime::config::CuConfig`: the configuration of your runtime
34//! - `cu29_runtime::cutask::CuTask`: the core trait and helpers to implement your own tasks.
35//! - `cu29_runtime::cubridge::CuBridge`: the trait to implement bridges to hardware or other software.
36//! - `cu29_runtime::curuntime::CuRuntime`: the runtime that manages task execution.
37//! - `cu29_runtime::simulation`: This will explain how to hook up your tasks to a simulation environment.
38//!
39//! Need help or want to show what you're building? Join
40//! [Discord](https://discord.gg/VkCG7Sb9Kw) and hop into the #general channel.
41//!
42
43#![cfg_attr(not(feature = "std"), no_std)]
44#[cfg(not(feature = "std"))]
45extern crate alloc;
46
47pub use cu29_derive::resources;
48pub use cu29_runtime::config;
49pub use cu29_runtime::copperlist;
50#[cfg(feature = "std")]
51pub use cu29_runtime::cuasynctask;
52pub use cu29_runtime::cubridge;
53pub use cu29_runtime::curuntime;
54pub use cu29_runtime::cutask;
55pub use cu29_runtime::input_msg;
56pub use cu29_runtime::monitoring;
57pub use cu29_runtime::output_msg;
58pub use cu29_runtime::payload;
59pub use cu29_runtime::resource;
60pub use cu29_runtime::rx_channels;
61#[cfg(feature = "std")]
62pub use cu29_runtime::simulation;
63pub use cu29_runtime::tx_channels;
64
65pub use bincode;
66pub use cu29_clock as clock;
67#[cfg(feature = "std")]
68pub use cu29_runtime::config::read_configuration;
69pub use cu29_traits::*;
70
71#[cfg(feature = "std")]
72pub use rayon;
73
74pub mod prelude {
75 #[cfg(feature = "std")]
76 pub use ctrlc;
77 pub use cu29_clock::*;
78 pub use cu29_derive::*; // includes resources! proc macro
79 pub use cu29_log::*;
80 pub use cu29_log_derive::*;
81 pub use cu29_log_runtime::*;
82 pub use cu29_runtime::app::*;
83 pub use cu29_runtime::config::*;
84 pub use cu29_runtime::copperlist::*;
85 pub use cu29_runtime::cubridge::*;
86 pub use cu29_runtime::curuntime::*;
87 pub use cu29_runtime::cutask::*;
88 pub use cu29_runtime::input_msg;
89 pub use cu29_runtime::monitoring::*;
90 pub use cu29_runtime::output_msg;
91 pub use cu29_runtime::payload::*;
92 pub use cu29_runtime::resource::*;
93 pub use cu29_runtime::rx_channels;
94 #[cfg(feature = "std")]
95 pub use cu29_runtime::simulation::*;
96 pub use cu29_runtime::tx_channels;
97 pub use cu29_runtime::*;
98 pub use cu29_traits::*;
99 pub use cu29_unifiedlog::*;
100 pub use cu29_value::Value;
101 pub use cu29_value::to_value;
102 #[cfg(feature = "std")]
103 pub use pool::*;
104 pub use serde::Serialize;
105}