Quick Start
Get up and running with Cerulion Core in just a few minutes. This guide will walk you through installation and your first publisher/subscriber example.Prerequisites
Rust Toolchain
Rust 1.70+ and Cargo installed. Install via rustup if needed.
System Dependencies
For local transport: iceoryx2 dependencies. For network: Zenoh runtime.
Installation
1
Rust: Add Cerulion Core to your project
Add Then run
cerulion-core to your Cargo.toml:cargo build to compile Cerulion Core and its dependencies.You should see successful compilation. The first build may take a few minutes to compile dependencies.
2
Python: Install dependencies
Install Zenoh Python bindings and required packages:
Python support is currently in development. For now, you can use Zenoh directly for network communication. Local zero-copy transport will be available in a future release.
3
C++: Install dependencies
Install Zenoh C++ bindings:
C++ support is currently in development. For now, you can use Zenoh directly for network communication. Local zero-copy transport will be available in a future release.
Your First Example
Let’s create a simple publisher and subscriber that communicate locally:If you run this code, you should see:
Received: temp=23.5°C, time=1234567890Understanding the Example
Let’s break down what’s happening:-
Message Type:
SensorDatais a simple struct withCopytrait. This makes it compatible with Cerulion Core’s automatic serialization. -
Publisher:
Publisher::create()creates a publisher for the topic"sensors/temperature". It automatically enables both local (iceoryx2) and network (Zenoh) transport. -
Subscriber:
Subscriber::create()withNoneauto-detects transport. Since a local publisher exists, it uses the fast local path. -
Send/Receive:
publisher.send()writes directly to shared memory (zero-copy).subscriber.receive()reads from the same memory location.
The
#[repr(C)] attribute ensures the struct has a C-compatible memory layout, which is required for zero-copy serialization. This also enables future cross-language compatibility.Network Communication
To force network transport (useful for cross-process or remote communication):Verification
1
Check compilation
Ensure your code compiles without errors:
2
Run the example
Execute your program:
You should see the received message printed to the console.
3
Verify zero-copy
The message was sent and received without serialization. You can verify this by checking that the data matches exactly (no precision loss, no conversion overhead).