Skip to main content

Module configuration

Module configuration 

Source
Expand description

§Configuration

§Runtime environment variables

ExecutorConfig::from_env() reads these at startup:

VariableDescriptionDefault
ROS_DOMAIN_IDROS 2 domain ID0
NROS_LOCATORRouter address (tcp/…, udp/…, or tls/…)tcp/127.0.0.1:7447
NROS_SESSION_MODESession mode: client or peerclient
ZENOH_TLS_ROOT_CA_CERTIFICATEPath to CA certificate (PEM)—
ZENOH_TLS_ROOT_CA_CERTIFICATE_BASE64Base64-encoded CA cert (bare-metal)—

§Buffer tuning (build-time)

Set these environment variables before cargo build. After changing a value, run cargo clean -p zpico-sys (or xrce-sys) to force a rebuild.

Zenoh backend (ZPICO_*):

VariableDescriptionPosixEmbedded
NROS_ZENOH_FRAG_MAX_SIZEMax reassembled message size655362048
NROS_ZENOH_BATCH_UNICAST_SIZEMax unicast batch before fragmentation655361024
NROS_ZENOH_BATCH_MULTICAST_SIZEMax multicast batch size81921024
NROS_SUBSCRIBER_BUFFER_SIZEPer-subscriber buffer in zenoh shim10241024
NROS_SERVICE_INBOX_BYTESRequest slot of a user service server’s inbox ring (zenoh); ZPICO_SERVICE_BUFFER_SIZE is its one-release alias10241024
NROS_SERVICE_INBOX_DEPTHRequests a user service server holds before dropping the newest44
NROS_ACTION_INBOX_BYTESRequest slot of an action server queryable’s inbox ringNROS_SERVICE_INBOX_BYTESditto
NROS_ACTION_INBOX_DEPTHRequests an action server queryable holds (the twin of ZPICO_MAX_PENDING_REPLIES)44

XRCE-DDS backend (XRCE_*):

VariableDescriptionPosixEmbedded
XRCE_TRANSPORT_MTUTransport MTU (also sizes stream buffers)4096512
XRCE_BUFFER_SIZEDefault of the three receive families below10241024
XRCE_SUBSCRIBER_BUFFER_SIZESubscriber ring entryXRCE_BUFFER_SIZEditto
XRCE_SERVICE_REQUEST_BUFFER_SIZEService-server request entryXRCE_BUFFER_SIZEditto
XRCE_SERVICE_REPLY_BUFFER_SIZEService-client reply slotXRCE_BUFFER_SIZEditto
XRCE_STREAM_HISTORYReliable stream history depth (>= 2)44

The zenoh service inbox is per FAMILY since phase-461 W1 (issue 1352): a user service and an action server queryable each take a slot size and a ring depth of their own, and the parameter and lifecycle services bring their own ring, sized by nros-node from the contract’s declared parameters. An image that states nothing gets the one table it had.

The three families were one number until phase-454 W6.b, so a subscriber ring entry paid for the largest type a SERVICE carried, 32 x 8 times over. Two of them are also DERIVED from what the image declares when it declares it (RFC-0100): the subscriber entry takes the largest wire bound over the declared subscriptions and XRCE_STREAM_HISTORY drops to the protocol floor of 4 when no endpoint declares reliability = reliable. Stating either here still wins.

Core (NROS_*, C API only):

VariableDescriptionDefault
NROS_MAX_PARAMETERSMax parameters in parameter server32

Example — increase zenoh defrag to 128 KB for large point clouds:

NROS_ZENOH_FRAG_MAX_SIZE=131072 cargo build --features rmw-zenoh,platform-posix