### Format SD Card for Copper Example Source: https://github.com/copper-project/copper-rs/wiki/Baremetal-Development Prepare an SD card for use with Copper examples by running a formatting script. This script requires `wipefs` and `sgdisk` to be installed. Ensure the path to the SD card block device is accurate to avoid data loss. ```bash support/mk_cu29_sdcard.sh ``` -------------------------------- ### Start Zenoh Daemon Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_zenoh_bridge_demo/README.md Starts the Zenoh daemon. This is optional for local peer-to-peer runs but necessary for routed setups. ```bash zenohd ``` -------------------------------- ### Run cu-msp-bridge-loopback Example Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_msp_bridge_loopback/README.md Execute the example using Cargo. Ensure you are in the correct project directory. ```bash cargo run -p cu-msp-bridge-loopback ``` -------------------------------- ### Run cu-image-aligner Example Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_image_aligner/README.md Execute the example from the workspace root using cargo. ```bash cargo run -p cu-image-aligner ``` -------------------------------- ### Run Example App Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cunew/templates/cu_full/README.md Execute the primary example application within the Copper workspace. ```bash cargo run -p cu_example_app ``` -------------------------------- ### Running the Demo with Cargo Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_run_in_sim/README.md Execute the example using Cargo. This command builds and runs the `cu_run_in_sim` example from your workspace. ```bash cargo run -p cu_run_in_sim ``` ```bash cd examples/cu_run_in_sim cargo run ``` -------------------------------- ### Install and Run cargo cubuild Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cubuild/README.md Install the cargo-cubuild extension using cargo install and then run it to process your project. ```bash cargo install --path . cargo cubuild ``` -------------------------------- ### Install cargo-cunew Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cunew/templates/README.md Install the `cargo-cunew` tool using cargo. ```bash cargo install cargo-cunew ``` -------------------------------- ### Run ROS2 Bridge Demo Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_ros2_bridge_demo/README.md Execute the ROS2 bridge demo using Cargo. This command starts the example application. ```bash cargo run -p cu-ros2-bridge-demo ``` -------------------------------- ### Run CuLogMon Example App Source: https://github.com/copper-project/copper-rs/blob/master/components/monitors/cu_logmon/README.md Run the minimal Copper app example that is wired to CuLogMon, logging to logs/logmon_copper_app.copper. ```bash cargo run -p cu-logmon --example copper_app ``` -------------------------------- ### Start Replay-Backed Debug Server Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cunew/templates/cu_full/README.md Manually start the replay-backed remote debug server using the Justfile. ```bash just resim-debug ``` -------------------------------- ### Install and Use cargo-cunew Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cunew/README.md Install cargo-cunew using cargo install and then use it to create a new Copper project. Navigate into the project directory and run the project. ```bash cargo install cargo-cunew cargo cunew my_robot cd my_robot cargo run ``` -------------------------------- ### ROS2 Topic Interaction Example Source: https://github.com/copper-project/copper-rs/blob/master/components/payloads/cu_ros2_payloads/README.md Demonstrates how to run a ROS2 node, echo a topic, and get topic information. This is useful for debugging and understanding topic communication. ```bash ros2 run rmw_zenoh_cpp rmw_zenohd ros2 topic echo /FOO std_msgs/String ros2 topic info /FOO -v ``` -------------------------------- ### Install Nix Package Manager Source: https://github.com/copper-project/copper-rs/blob/master/support/nix/README.md Installs the Nix package manager. Ensure you have curl installed. ```sh sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon ``` -------------------------------- ### Install Rerun CLI Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_pointclouds/README.md Install the Rerun command-line interface to enable visualization. ```bash $ cargo install rerun-cli ``` -------------------------------- ### CuSimBridge::start Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the CuSimBridge, initializing its simulation operations within the given context. ```APIDOC ## CuSimBridge::start ### Description Starts the `CuSimBridge` component for simulation. ### Method Signature `pub fn start(&mut self, _ctx: &cu29_runtime::context::CuContext) -> cu29_traits::CuResult<()>` ### Parameters - `_ctx`: A reference to the `CuContext` (unused in this implementation). ### Return Value Returns a `CuResult<()>` indicating success or failure. ``` -------------------------------- ### Install cargo-nextest Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Installs 'cargo-nextest' for efficient test execution. ```bash cargo install cargo-nextest ``` -------------------------------- ### Clone and Run Copper Example Source: https://github.com/copper-project/copper-rs/wiki/Using-Copper-an-NVidia-Jetson Clones the Copper repository and runs an example project named 'cu_caterpillar' using Cargo. ```bash $ git clone https://github.com/copper-project/copper-rs $ cd copper-rs/examples/cu_caterpillar $ cargo run -r ``` -------------------------------- ### Install and Run Demo Crates Source: https://github.com/copper-project/copper-rs/blob/master/README.md Install and run the published demo crates for BalanceBot and Flight Controller from crates.io. These commands allow you to quickly try out Copper's capabilities. ```bash cargo install cu-rp-balancebot balancebot-sim ``` ```bash cargo install cu-flight-controller quad-sim ``` -------------------------------- ### Run Remote Debug Session Example Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_remote_debug_session/README.md Execute the remote debug session example from its directory. Ensure you have the Rust toolchain and have built the workspace containing this example. ```bash cd examples/cu_remote_debug_session cargo run ``` -------------------------------- ### CuBridge::start Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the CuBridge, initializing its operations within the given context. ```APIDOC ## CuBridge::start ### Description Starts the CuBridge component. ### Method Signature `pub fn start(&mut self, _ctx: &cu29_runtime::context::CuContext) -> cu29_traits::CuResult<()>` ### Parameters - `_ctx`: A reference to the `CuContext` (unused in this implementation). ### Return Value Returns a `CuResult<()>` indicating success or failure. ``` -------------------------------- ### RON Configuration Example Source: https://github.com/copper-project/copper-rs/blob/master/components/tasks/cu_python_task/README.md Example of how to configure a Python task in RON format, specifying the script path and execution mode. ```ron ( id: "py", type: "tasks::ExamplePythonTask", config: { "script": "python/task.py", "mode": "process", }, ) ``` -------------------------------- ### Install and Create a New Copper Project Source: https://github.com/copper-project/copper-rs/blob/master/README.md Use `cargo-cunew` to install the Copper new project generator and create a new Copper application. Then, navigate into the project directory and run the application. ```bash cargo install cargo-cunew cd hello_copper cargo run ``` -------------------------------- ### Install Cargo-Shear Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Install the cargo-shear tool to manage project dependencies. ```bash cargo install cargo-shear ``` -------------------------------- ### Install and Reinstall Git Hooks with prek Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md After installing `prek`, reinstall the git hooks to enable them for your local repository. Use the `-f` flag to force reinstallation if hooks already exist. ```bash prek install -f ``` -------------------------------- ### CuSimBridge::start Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the CuSimBridge. This method initializes the bridge for operation. ```APIDOC ## `CuSimBridge::start` ### Description Starts the `CuSimBridge`. This method initializes the bridge for operation. ### Method `fn start(&mut self, ctx: &CuContext) -> CuResult<()>` ### Parameters * `ctx` (&CuContext) - The current Copper context. ### Response * `CuResult<()>` - A `CuResult` indicating success or failure of the start operation. ``` -------------------------------- ### DistributedReplayPlan::start Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the distributed replay engine. This method consumes the `DistributedReplayPlan` and returns a `DistributedReplayEngine`. ```APIDOC ## DistributedReplayPlan::start ### Description Starts the distributed replay engine. This method consumes the `DistributedReplayPlan` and returns a `DistributedReplayEngine`. ### Method Call ### Parameters None ### Returns `cu29_runtime::distributed_replay::DistributedReplayEngine` on success. ``` -------------------------------- ### Install prek for Git Hooks Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Install the `prek` tool to manage pre-commit hooks for local linting and formatting checks. This ensures code quality before committing. ```bash cargo binstall install prek ``` ```bash cargo install install prek ``` -------------------------------- ### Minimal soft_ratatui Example Source: https://github.com/copper-project/copper-rs/blob/master/vendor/soft_ratatui/README.md Demonstrates the basic setup for using soft_ratatui with embedded-graphics fonts to render a simple paragraph in a terminal window. Ensure the 'unicodefonts' feature is enabled. ```Rust use soft_ratatui::embedded_graphics_unicodefonts:: mono_8x13_atlas, mono_8x13_bold_atlas, mono_8x13_italic_atlas, }; use ratatui::Terminal; use ratatui::widgets::{Block, Borders, Paragraph, Wrap}; use soft_ratatui::{EmbeddedGraphics, SoftBackend}; fn main() { let font_regular = mono_8x13_atlas(); let font_italic = mono_8x13_italic_atlas(); let font_bold = mono_8x13_bold_atlas(); let backend = SoftBackend::::new( 100, 50, font_regular, Some(font_bold), Some(font_italic), ); let mut terminal = Terminal::new(backend).unwrap(); terminal.clear(); terminal.draw(|frame| { let area = frame.area(); let textik = format!("Hello soft! The window area is {}", area); frame.render_widget( Paragraph::new(textik) .block(Block::new().title("Ratatui").borders(Borders::ALL)) .wrap(Wrap { trim: false }), area, ); }); } ``` -------------------------------- ### Read Interned Strings at Runtime Source: https://github.com/copper-project/copper-rs/blob/master/core/cu29_intern_strs/README.md After compilation, you can read the generated index file to retrieve interned strings by their index. This example shows how to read the index and get a string by its ID. ```rust use cu29_intern_strs::intern_strs; fn main() { let index = read_interned_strings("path/to/cu29_log_index"); // this file is generated at compile time println!("Read string 42: {}", index.get(42).unwrap_or(&"String not found")); } ``` -------------------------------- ### Initialize and Use EMMCLogger for Unified Logging Source: https://github.com/copper-project/copper-rs/blob/master/components/libs/cu_sdlogger/README.md Demonstrates the complete workflow for setting up and using EMMCLogger. This includes wrapping the block device, locating the Copper partition, initializing the logger, adding a log section, appending entries, and flushing. Ensure your block device is Sync or use ForceSyncSend for serialized access. ```rust use cu_sdlogger::{find_copper_partition, EMMCLogger, EMMCSectionStorage, ForceSyncSend}; use cu29::prelude::*; use embedded_sdmmc::SdCard; // 1) Wrap your block device if it is not Sync and access is serialized. let sd = ForceSyncSend::new(SdCard::new(device, timer)); // 2) Locate the Copper partition (GUID 29A2E0C9-0000-4C75-9229-000000000029). let Some((start, len)) = find_copper_partition(&sd)? else { panic!("Copper partition missing on card"); }; // 3) Create the logger and allocate a section for your stream. let mut logger: EMMCLogger<_> = EMMCLogger::new(sd, start, len)?; let mut telem = logger.add_section(UnifiedLogType::Telemetry, 32 * 1024)?; // bytes of payload // 4) Append log entries and flush before shutdown. telem.append(&my_entry)?; logger.flush_section(&mut telem); ``` -------------------------------- ### Complete RON Configuration Example Source: https://github.com/copper-project/copper-rs/wiki/Copper-RON-Configuration-Reference Demonstrates a complete Copper RON configuration including tasks, connections, console monitoring, task logging, and modular includes with parameters. Use this as a template for complex configurations. ```ron ( tasks: [], cnx: [], monitor: ( type: "cu_consolemon::CuConsoleMon" ), logging: ( enable_task_logging: true, keyframe_interval: 100 ), includes: [ ( path: "base.ron", params: {} ), ( path: "motors.ron", params: { "id": "left", "pin": 4, "direction": "forward" } ), ( path: "motors.ron", params: { "id": "right", "pin": 5, "direction": "reverse" } ), ], ) ``` -------------------------------- ### Install just command runner Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Installs the 'just' command runner, used for common development tasks. Can be installed via cargo or a package manager. ```bash cargo install just ``` -------------------------------- ### DistributedReplayPlan::start_recording_logs_under Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the distributed replay engine and begins recording logs under a specified output directory. This method consumes the `DistributedReplayPlan`. ```APIDOC ## DistributedReplayPlan::start_recording_logs_under ### Description Starts the distributed replay engine and begins recording logs under a specified output directory. This method consumes the `DistributedReplayPlan`. ### Method Call ### Parameters #### Path Parameters - **output_root** (impl core::convert::AsRef) - Required - The root path where logs will be recorded. ### Returns `cu29_runtime::distributed_replay::DistributedReplayEngine` on success. ``` -------------------------------- ### Replay and Resimulation CLI Setup Source: https://context7.com/copper-project/copper-rs/llms.txt Integrate `ReplayCli` and `ReplayArgs` with `clap` for building replay binaries. These helpers resolve log and replay paths. The `remote-debug` feature allows attaching a Zenoh-backed debug server during replay. ```rust use cu29::prelude::*; use cu29::replay::{ReplayArgs, ReplayCli, ReplayDefaults}; use clap::Parser; #[derive(Parser)] struct MyCli { #[command(flatten)] replay: ReplayArgs, #[arg(long)] mission: Option, } fn main() -> CuResult<()> { let cli = MyCli::parse(); let defaults = ReplayDefaults::new("logs/robot.copper", "logs/replay.copper"); let resolved: ReplayCli = cli.replay.resolve(&defaults); // `resolved.log_base` — path to recorded log // `resolved.replay_log_base` — path for replay output log // `resolved.debug_base` — optional Zenoh debug namespace // Feed into a sim-mode application to drive it from recorded data // (see cu_distributed_resim_demo for a full example) println!("Replaying from {:?}", resolved.log_base); Ok(()) } ``` -------------------------------- ### Build Host Helper Application Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_rp2350_skeleton/README.md Compile and run the host helper application using this command, enabling the 'host' feature for the 'main' binary. ```bash cargo run --features host --bin main ``` -------------------------------- ### Install typos-cli Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Installs the 'typos-cli' tool for spell checking code. ```bash cargo install typos-cli ``` -------------------------------- ### CuSimSinkTask Start Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Starts the simulation sink task, preparing it to process inputs. ```APIDOC ## start CuSimSinkTask ### Description Starts the simulation sink task. ### Method `start` ### Parameters - `_ctx` (`&cu29_runtime::context::CuContext`): The context for the operation. ### Return Value - `cu29_traits::CuResult<()>`: A result indicating success or failure. ``` -------------------------------- ### Spawning Split Layout with Monitor Source: https://github.com/copper-project/copper-rs/blob/master/components/monitors/cu_bevymon/README.md Demonstrates how to spawn a split layout using `spawn_split_layout`, integrating a monitor texture with a Bevy UI camera and a scene camera. It also shows how to add child UI elements to the simulation panel. ```rust let layout = spawn_split_layout( &mut commands, monitor_texture.0.clone(), CuBevyMonSplitLayoutConfig::new(scene_camera).with_ui_camera(ui_camera), ); commands.entity(layout.sim_panel).with_children(|panel| { panel.spawn(( Node { position_type: PositionType::Absolute, bottom: Val::Px(5.0), right: Val::Px(5.0), ..default() }, Pickable::IGNORE, )); }); ``` -------------------------------- ### Enter Development Environment Source: https://github.com/copper-project/copper-rs/blob/master/support/nix/README.md Enters the Nix development environment. For CUDA support on Linux, append '#cuda'. ```sh nix develop ``` ```sh nix develop #cuda ``` -------------------------------- ### Install Optional Tooling with Cargo Source: https://github.com/copper-project/copper-rs/wiki/Using-Copper-an-NVidia-Jetson Installs optional development tools like git, just, and cargo-cunew using Cargo. ```bash $ sudo apt install git $ cargo install just # to use the justfiles in the repo $ cargo install cargo-cunew # if you want the Copper project/workspace scaffolder ``` -------------------------------- ### Install Rust on Jetson Source: https://github.com/copper-project/copper-rs/wiki/Using-Copper-an-NVidia-Jetson Installs Rust using the official script and sources the bashrc to load the environment variables. ```bash $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh $ source ~/.bashrc ``` -------------------------------- ### Build and Test with Features Source: https://github.com/copper-project/copper-rs/blob/master/support/nix/README.md Builds the project workspace and runs tests using the pre-configured features flag. ```bash cargo build --workspace $FEATURES_FLAG ``` ```bash cargo nextest run --workspace $FEATURES_FLAG ``` -------------------------------- ### Render Configuration with cu29-rendercfg Source: https://github.com/copper-project/copper-rs/wiki/Config-and-Missions-Visualization Use the `cu29-rendercfg` binary to render missions from a configuration file. Use `--help` to see available options for listing missions, rendering specific missions, or opening the output directly. ```bash $ cargo run -p cu29-runtime --bin cu29-rendercfg -- --help ``` -------------------------------- ### Task Configuration Example Source: https://github.com/copper-project/copper-rs/wiki/Copper-RON-Configuration-Reference Defines a task with an ID, type, kind, resource binding, and logging settings. 'kind' is recommended for clarity. ```ron ( id: "task1", type: "tasks::ExampleTask", kind: task, background: true, resources: { "i2c": "board.i2c0" }, logging: (enabled: false), ) ``` -------------------------------- ### Run Project Generation with just Source: https://github.com/copper-project/copper-rs/wiki/Project-Templates These commands provide shortcuts for generating project templates using `just` from within the template directory. ```bash cd support/cargo_cunew/templates && just gen-project ``` ```bash cd support/cargo_cunew/templates && just gen-workspace ``` -------------------------------- ### CuBridge::new Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Initializes a new CuBridge instance with specified configurations. ```APIDOC ## CuBridge::new ### Description Constructs a new `CuBridge` instance, setting up transmit and receive channels, and providing resources. ### Parameters - `config` (core::option::Option<&cu29_runtime::config::ComponentConfig>) - Optional component configuration. - `tx_channels` (&[cu29_runtime::cubridge::BridgeChannelConfig<::Id>]) - A slice of configurations for transmit channels. - `rx_channels` (&[cu29_runtime::cubridge::BridgeChannelConfig<::Id>]) - A slice of configurations for receive channels. - `resources` (Self::Resources) - The resources required for the bridge operation. ### Returns - `cu29_traits::CuResult` - A `CuResult` containing the newly created `CuBridge` instance or an error. ``` -------------------------------- ### Python Task Optional Start Hook Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_python_task_demo/README.md Defines the optional `start` lifecycle hook for a Python task, used for initialization. ```python def start(ctx, state): ... ``` -------------------------------- ### Install cargo-llvm-cov and Rust toolchain component Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Installs 'cargo-llvm-cov' for coverage reports and adds the 'llvm-tools-preview' component to the stable Rust toolchain. ```bash cargo install cargo-llvm-cov rustup component add llvm-tools-preview --toolchain stable ``` -------------------------------- ### Install Cross-Compilation Target for Jetson Source: https://github.com/copper-project/copper-rs/wiki/Using-Copper-an-NVidia-Jetson Installs the aarch64-unknown-linux-musl target for cross-compiling Rust projects for the Jetson on a workstation. Requires musl-tools and GCC for cross-compilation. ```bash ## one your *workstation* $ rustup target add aarch64-unknown-linux-musl # the musl toolchain $ sudo apt install musl-tools gcc-aarch64-linux-gnu # for debian/ubuntu # be sure you don't have the python dependency in the cu29-log # extract in your Cargo.toml ``` -------------------------------- ### Bootstrap a New Copper Application Source: https://github.com/copper-project/copper-rs/blob/master/core/cu29/README.md Use `cargo-cunew` to generate a minimal Copper application. Run `cargo run` to start the application and observe its output. Stop the application with Ctrl-C. ```bash cargo install cargo-cunew cargo cunew hello_copper cd hello_copper cargo run ``` -------------------------------- ### Install Rust with rustup Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Installs the latest stable Rust toolchain using rustup. Copper's minimum supported Rust version is 1.95. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Task Resource Binding Example Source: https://github.com/copper-project/copper-rs/wiki/Copper-RON-Configuration-Reference Shows how a task can bind to a specific resource from a declared bundle using the 'bundle.resource' format. ```ron resources: { "serial": "board.serial0" } ``` -------------------------------- ### Cargo Build Error Example Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cubuild/README.md This example shows a typical compilation error encountered during a standard 'cargo build' when the 'Reader' trait is not satisfied for &[u8]. ```text $ cargo build error[E0277]: the trait bound `&[u8]: Reader` is not satisfied --> examples/cu_caterpillar/src/main.rs:6:1 | 6 | #[copper_runtime(config = "copperconfig.ron")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Reader` is not implemented for `&[u8]` | note: there are multiple different versions of crate `bincode` in the dependency graph --> /home/gbin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bincode-2.0.1/src/de/read.rs:17:1 ``` -------------------------------- ### Install cargo-expand for Proc-Macro Inspection Source: https://github.com/copper-project/copper-rs/blob/master/CONTRIBUTING.md Install the `cargo-expand` tool globally to inspect the output of Copper's procedural macros. This is useful for understanding code generation. ```bash cargo install cargo-expand ``` -------------------------------- ### Example RON Configuration File Source: https://context7.com/copper-project/copper-rs/llms.txt A sample RON configuration file (`copperconfig.ron`) for defining the task graph, task types, configurations, and message connections between tasks. ```ron // copperconfig.ron ( // Optional: set a target loop rate runtime: (rate_target_hz: 500), tasks: [ ( id: "imu", type: "drivers::ImuDriver", config: { "sample_rate_hz": 1000 }, ), ( id: "filter", type: "algo::LowPassFilter", config: { "alpha": 0.1 }, ), ( id: "motor", type: "drivers::MotorDriver", config: { "pin": 4 }, ), ], cnx: [ ( src: "imu", dst: "filter", msg: "drivers::ImuReading" ), ( src: "filter", dst: "motor", msg: "algo::FilteredValue" ), // Discard filtered output (no downstream consumer) ( src: "filter", dst: "__nc__", msg: "algo::FilteredValue" ), ], logging: ( file: "logs/robot.copper", // optional explicit path keyframe_interval: 10000, // snapshot interval (iterations) slab_size_mib: 1024, section_size_mib: 100, ), monitor: ( type: "cu_consolemon::CuConsoleMon", ), ) ``` -------------------------------- ### Generate DAG Visualization Source: https://github.com/copper-project/copper-rs/wiki/Config-and-Missions-Visualization Navigate to the example directory and run `just dag` to generate an `output.svg` file visualizing the configuration and missions. ```bash cd examples/cu_bridge_test just dag ``` -------------------------------- ### Simulation Output Example Source: https://github.com/copper-project/copper-rs/blob/master/examples/cu_run_in_sim/README.md This is an example of the expected output when running the simulation. It includes timestamps, log levels, and messages from the sink task indicating the processed values. ```text 17:32:05 [DEBUG] (1) cu29_log: 0 ns [Debug]: Logger created at logs/run_in_sim.copper. This is a simulation. 17:32:05 [DEBUG] (1) cu29_log: CuConfig: Using the original configuration the project was compiled with: ... [MySink] got value = 2 [MySink] got value = 4 [MySink] got value = 6 [MySink] got value = 8 [MySink] got value = 10 Flushing the unified Logger ... Unified Logger flushed. ``` -------------------------------- ### Main Configuration with Parameterized Includes Source: https://github.com/copper-project/copper-rs/wiki/Modular-Configuration Illustrates how to provide runtime values for parameterized included configurations. The 'params' map in the 'includes' section replaces the corresponding `{{parameter_name}}` placeholders in the included file. ```ron ( tasks: [], cnx: [], includes: [ ( path: "included_config.ron", params: { "instance_id": "42", // Replaces {{instance_id}} with "42" "param_value": 100, // Replaces {{param_value}} with 100 }, ), ], ) ``` -------------------------------- ### Cargo Cubuild Error Example Source: https://github.com/copper-project/copper-rs/blob/master/support/cargo_cubuild/README.md This example demonstrates the output after using 'cargo cubuild', showing line-accurate diagnostics on the expanded code, which helps in debugging macro-generated errors. ```text $ cargo cubuild error[E0277]: the trait bound `&[u8]: Reader` is not satisfied --> examples/cu_caterpillar/src/main.rs:2629:48 | 2629 | let mut decoder = DecoderImpl::new(slice, config, ()); | ---------------- ^^^^^ the trait `Reader` is not implemented for `&[u8]` | | | required by a bound introduced by this call | note: there are multiple different versions of crate `bincode` in the dependency graph [...] ``` -------------------------------- ### Transform Tree Lookup Example Source: https://github.com/copper-project/copper-rs/blob/master/components/libs/cu_transform/README.md Demonstrates creating a transform tree, adding a transform between two frames, and looking up the transform at a specific time. ```rust use cu_transform::{StampedTransform, TransformTree, Transform3D}; use cu29::clock::{CuTime, RobotClock}; fn tree_lookup() { // Create a transform tree let mut tree = TransformTree::::new(); let clock = RobotClock::default(); // Add a transform from "world" to "robot" let world_to_robot = StampedTransform { transform: Transform3D::default(), // Identity transform stamp: CuTime::from_nanos(1000), parent_frame: "world".try_into().expect("invalid name"), child_frame: "robot".try_into().expect("invalid name"), }; tree.add_transform(world_to_robot).unwrap(); // Look up transform let transform = tree .lookup_transform("world", "robot", CuTime::from_nanos(1000), &clock) .unwrap(); } ``` -------------------------------- ### Preview Local Catalog Command Source: https://github.com/copper-project/copper-rs/blob/master/catalog/README.md Open the locally built catalog in your default web browser. Ensure `catalog/generated/catalog/index.html` exists. ```bash xdg-open catalog/generated/catalog/index.html ``` -------------------------------- ### Get Node Source: https://github.com/copper-project/copper-rs/blob/master/api/v1/cu29-runtime.txt Retrieves a reference to a node in the graph using its ID. ```APIDOC ## get_node ### Description Retrieves a reference to a node by its ID. ### Method `get_node(&self, node_id: NodeId) -> Option<&Node>` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) `Option<&Node>` - A reference to the Node if found, otherwise `None`. #### Response Example None ``` -------------------------------- ### Multi-Copper Configuration Example Source: https://github.com/copper-project/copper-rs/wiki/Copper-Release-Notes Defines a multi-Copper configuration with subsystems and an instance overrides root. This allows for managing fleets of robots with individual configurations. ```ron ( subsystems: [ ( id: "robot", config: "robot_base.ron", ), ], interconnects: [], instance_overrides_root: "instances", ) ``` -------------------------------- ### Instance Configuration Override Example Source: https://github.com/copper-project/copper-rs/wiki/Copper-Release-Notes Shows how to override specific configuration fields for a robot instance using an overlay file. This enables per-instance customization without duplicating the entire subsystem graph. ```ron ( set: [ ( path: "tasks/reporter/config", value: { "label": "robot-17", "gyro_bias": [0.012, -0.004, 0.008], }, ), ], ) ```