Skip to main content

rmw_hdds Configuration

Configure HDDS behavior in ROS2 applications.

Configuration Methods

HDDS can be configured via:

  1. Environment variables - Quick runtime changes
  2. XML configuration file - Detailed settings
  3. ROS2 parameters - Node-specific tuning

Environment Variables

Core Settings

# Domain ID (default: 0)
export ROS_DOMAIN_ID=42

# RMW implementation
export RMW_IMPLEMENTATION=rmw_hdds_cpp

# HDDS log level (trace, debug, info, warn, error)
export HDDS_LOG_LEVEL=info

# Disable shared memory transport
export HDDS_SHM_DISABLE=1

# Custom configuration file
export HDDS_CONFIG_FILE=/path/to/hdds_config.xml

Transport Settings

# Network interface
export HDDS_INTERFACE=eth0

# Multicast address
export HDDS_MULTICAST_ADDR=239.255.0.1

# Discovery port (default: 7400)
export HDDS_DISCOVERY_PORT=7400

# Disable multicast (unicast only)
export HDDS_MULTICAST_DISABLE=1

Security Settings

# Enable DDS Security
export ROS_SECURITY_ENABLE=true
export ROS_SECURITY_STRATEGY=Enforce

# Security keystore path
export ROS_SECURITY_KEYSTORE=/path/to/keystore

# Enclave path
export ROS_SECURITY_ENCLAVE_OVERRIDE=/my_enclave

XML Configuration File

File Location

# Default locations (checked in order)
~/.hdds/config.xml
/etc/hdds/config.xml

# Or specify explicitly
export HDDS_CONFIG_FILE=/path/to/config.xml

Basic Configuration

<?xml version="1.0" encoding="UTF-8"?>
<hdds>
<domain id="0">
<participant name="ros2_node">
<!-- Discovery settings -->
<discovery>
<initial_announcements count="5" period_ms="100"/>
<lease_duration_sec>10</lease_duration_sec>
</discovery>

<!-- Transport configuration -->
<transport>
<udp enabled="true">
<interface>eth0</interface>
<port_base>7400</port_base>
</udp>
<shared_memory enabled="true">
<segment_size_mb>64</segment_size_mb>
</shared_memory>
</transport>
</participant>
</domain>
</hdds>

QoS Profiles

<?xml version="1.0" encoding="UTF-8"?>
<hdds>
<qos_profiles>
<!-- High-throughput sensor profile -->
<profile name="sensor_data">
<reliability kind="BEST_EFFORT"/>
<durability kind="VOLATILE"/>
<history kind="KEEP_LAST" depth="1"/>
</profile>

<!-- Reliable command profile -->
<profile name="command">
<reliability kind="RELIABLE" max_blocking_ms="100"/>
<durability kind="TRANSIENT_LOCAL"/>
<history kind="KEEP_LAST" depth="10"/>
</profile>

<!-- Service profile -->
<profile name="service">
<reliability kind="RELIABLE" max_blocking_ms="5000"/>
<durability kind="VOLATILE"/>
<history kind="KEEP_ALL"/>
</profile>
</qos_profiles>
</hdds>

Transport Tuning

<hdds>
<transport>
<!-- UDP configuration -->
<udp enabled="true">
<interface>eth0</interface>
<send_buffer_size>4194304</send_buffer_size>
<receive_buffer_size>4194304</receive_buffer_size>
<multicast>
<enabled>true</enabled>
<address>239.255.0.1</address>
<ttl>1</ttl>
</multicast>
</udp>

<!-- Shared memory for same-host -->
<shared_memory enabled="true">
<segment_size_mb>256</segment_size_mb>
<max_message_size_kb>64</max_message_size_kb>
</shared_memory>
</transport>
</hdds>

Discovery Configuration

<hdds>
<discovery>
<!-- Fast discovery -->
<initial_announcements count="10" period_ms="50"/>

<!-- Lease duration -->
<lease_duration_sec>30</lease_duration_sec>

<!-- Static peers (no multicast) -->
<static_peers>
<peer>192.168.1.100:7400</peer>
<peer>192.168.1.101:7400</peer>
</static_peers>

<!-- Ignore specific participants -->
<ignore_participants>
<pattern>debug_*</pattern>
</ignore_participants>
</discovery>
</hdds>

ROS2 Parameters

Per-Node Configuration

# Python launch file
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
return LaunchDescription([
Node(
package='my_package',
executable='my_node',
parameters=[{
'hdds.reliability': 'reliable',
'hdds.history_depth': 100,
'hdds.deadline_ms': 50,
}]
)
])

YAML Parameter File

# config/hdds_params.yaml
/**:
ros__parameters:
hdds:
reliability: reliable
durability: transient_local
history_depth: 100
deadline_ms: 100
liveliness_lease_ms: 1000
ros2 run my_package my_node --ros-args --params-file config/hdds_params.yaml

Topic-Specific QoS

QoS Override File

# qos_overrides.yaml
/sensor/imu:
reliability: best_effort
history:
kind: keep_last
depth: 1
durability: volatile

/robot/cmd_vel:
reliability: reliable
history:
kind: keep_last
depth: 10
durability: transient_local
deadline:
sec: 0
nsec: 100000000 # 100ms

/diagnostics:
reliability: reliable
history:
kind: keep_all
lifespan:
sec: 10
nsec: 0

Apply QoS Overrides

export ROS_QOS_OVERRIDE_FILE=/path/to/qos_overrides.yaml
ros2 run my_package my_node

Common Configurations

Low-Latency Configuration

<hdds>
<transport>
<shared_memory enabled="true" prefer="true"/>
<udp>
<send_buffer_size>1048576</send_buffer_size>
<receive_buffer_size>1048576</receive_buffer_size>
</udp>
</transport>

<qos_profiles>
<profile name="default">
<reliability kind="BEST_EFFORT"/>
<history kind="KEEP_LAST" depth="1"/>
</profile>
</qos_profiles>
</hdds>

High-Throughput Configuration

<hdds>
<transport>
<udp>
<send_buffer_size>16777216</send_buffer_size>
<receive_buffer_size>16777216</receive_buffer_size>
</udp>
<shared_memory>
<segment_size_mb>512</segment_size_mb>
</shared_memory>
</transport>

<qos_profiles>
<profile name="default">
<history kind="KEEP_LAST" depth="1000"/>
</profile>
</qos_profiles>
</hdds>

Multi-Robot Configuration

<hdds>
<domain id="0">
<participant name="robot_${ROBOT_ID}">
<discovery>
<static_peers>
<peer>${BASE_STATION_IP}:7400</peer>
</static_peers>
</discovery>
</participant>
</domain>
</hdds>
export ROBOT_ID=robot_01
export BASE_STATION_IP=192.168.1.1
ros2 run my_package robot_node

Isolated Network Configuration

<hdds>
<transport>
<udp>
<interface>192.168.100.0/24</interface>
<multicast>
<enabled>false</enabled>
</multicast>
</udp>
<shared_memory enabled="false"/>
</transport>

<discovery>
<static_peers>
<peer>192.168.100.10:7400</peer>
<peer>192.168.100.11:7400</peer>
</static_peers>
</discovery>
</hdds>

Debugging Configuration

Enable Debug Logging

export HDDS_LOG_LEVEL=debug
export RUST_LOG=hdds=debug
ros2 run my_package my_node

Trace Discovery

export HDDS_LOG_LEVEL=trace
export HDDS_LOG_DISCOVERY=1
ros2 run my_package my_node 2>&1 | grep -i discovery

Network Diagnostics

# Check active endpoints
ros2 topic info /my_topic -v

# Check node connections
ros2 node info /my_node

# HDDS-specific diagnostics
ros2 run rmw_hdds_cpp hdds_monitor

Validation

Check Configuration

# Validate XML syntax
xmllint --noout /path/to/hdds_config.xml

# Test configuration loading
HDDS_CONFIG_FILE=/path/to/hdds_config.xml \
HDDS_LOG_LEVEL=debug \
ros2 run demo_nodes_cpp talker

Configuration Dump

# Print active configuration
ros2 run rmw_hdds_cpp hdds_config_dump

Next Steps