Project Structure Overview
Let’s look at what’s inside a Copper project and understand the role of each file. Here’s the layout generated by the template:
my_project/
├── build.rs # Build script (sets up logging index)
├── Cargo.toml # Dependencies and project metadata
├── copperconfig.ron # Task graph definition
└── src/
├── main.rs # Runtime entry point
├── tasks.rs # Your task implementations
└── logreader.rs # (optional) Log export utility
Which files do I actually work on?
Great news: in the next chapters, we will mainly focus on two files:
| File | What you do there | ROS 2 equivalent |
|---|---|---|
tasks.rs | Implement tasks + define message types | Node source files + .msg files |
copperconfig.ron | Define the task graph, wire connections, set parameters | Launch file + YAML params |
The rest is scaffolding that you set up once and rarely change:
| File | Role | How often you touch it |
|---|---|---|
main.rs | Boilerplate: create logger, build runtime, call run() | Rarely |
build.rs | Sets an env var for Copper’s logging macros | Never |
logreader.rs | CLI tool to decode and export Copper’s binary logs | Rarely |
Cargo.toml | Dependencies | When adding new hardware driver crates |
The mental model
Think of it this way:
copperconfig.ronis the architecture of your robot – what components exist and how they connect. It’s declarative.tasks.rsis the behavior of your robot – what each component actually does. It’s imperative Rust code.main.rsis the engine startup – it boots the runtime that executes your architecture and behavior. You don’t need to understand it deeply to get started.
In the next chapters, we’ll dive into each of these files, starting with the task graph configuration.