Getting Started with HDDS
Welcome to HDDS, a high-performance DDS (Data Distribution Service) middleware written in pure Rust. This guide will help you get started quickly.
Quick Start
- Rust
- C
- Python
# Clone HDDS
git clone https://git.hdds.io/hdds/hdds.git
# In your project's Cargo.toml, add:
# hdds = { path = "../hdds/crates/hdds" }
use hdds::{Participant, TransportMode, Result};
fn main() -> Result<()> {
// Create a participant on domain 0
let participant = Participant::builder("my_app")
.domain_id(0)
.with_transport(TransportMode::UdpMulticast)
.build()?;
// Create a topic
let topic = participant.topic::<Temperature>("sensor/temp")?;
// Create a publisher and write data
let writer = topic.writer().build()?;
writer.write(&Temperature { value: 23.5 })?;
Ok(())
}
# Clone and build HDDS
git clone https://git.hdds.io/hdds/hdds.git
cd hdds && cargo build --release -p hdds-c
#include <hdds/hdds.h>
int main() {
hdds_participant_t* participant = hdds_participant_create(0, NULL);
hdds_topic_t* topic = hdds_topic_create(participant, "sensor/temp", "Temperature");
hdds_writer_t* writer = hdds_writer_create(participant, topic, NULL);
Temperature data = { .value = 23.5 };
hdds_writer_write(writer, &data);
return 0;
}
# Clone and build HDDS Python bindings
git clone https://git.hdds.io/hdds/hdds.git
cd hdds/sdk/python && pip install -e .
import hdds
participant = hdds.DomainParticipant(domain_id=0)
topic = participant.create_topic("sensor/temp", Temperature)
writer = participant.create_writer(topic)
writer.write(Temperature(value=23.5))
What's Next?
Learn the Basics
Understand DDS concepts and RTPS protocol fundamentals.
Install HDDS
Get HDDS installed on Linux, macOS, or Windows.
Build Something
Follow our step-by-step Hello World tutorial.
Why HDDS?
| Feature | HDDS | FastDDS | CycloneDDS | RTI Connext |
|---|---|---|---|---|
| Language | Pure Rust | C++ | C | C/C++ |
| Memory Safety | Guaranteed | Manual | Manual | Manual |
| Latency | Sub-microsecond | ~1-5 µs | ~2-10 µs | ~1-5 µs |
| Zero-copy | Yes | Partial | Partial | Yes |
| Multi-language | Rust, C, C++, Python | C++, Python | C, Python | C, C++, Java, C#, Python |
| License | Apache 2.0 | Apache 2.0 | Eclipse 2.0 | Commercial |