Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables Reference

Configuration File

All environment variables can be set in a .env file at the project root:

cp .env.example .env
# Edit .env — uncomment and adjust values as needed
  • justfile.env is auto-loaded. Missing file silently ignored.
  • direnv.envrc sources .env if present.
  • Manualset -a; source .env; set +a before cargo build.

Variables in .env take precedence over justfile defaults but are overridden by explicit shell exports.

Runtime Configuration

Examples use ExecutorConfig::from_env() for configuration:

VariableDescriptionDefault
ROS_DOMAIN_IDROS 2 domain ID0
NROS_LOCATORRMW locator (tcp/…, udp/…, serial/…, or tls/…)tcp/127.0.0.1:7447
NROS_SESSION_MODESession mode: client or peerclient
ZENOH_TLS_ROOT_CA_CERTIFICATEPath to CA certificate (PEM) for TLS(none)
ZENOH_TLS_ROOT_CA_CERTIFICATE_BASE64Base64-encoded CA certificate for TLS(none)
ZENOH_TLS_VERIFY_NAME_ON_CONNECTVerify server hostname in TLS (true/false)(none)

Deprecated legacy names: ZENOH_LOCATOR and ZENOH_MODE are still accepted (they fall back to NROS_LOCATOR / NROS_SESSION_MODE) but will print a one-line deprecation warning to stderr. Migrate to the NROS_* names. ZENOH_TLS_* names are kept because TLS is currently zenoh-specific.

TLS Notes

  • POSIX: requires libmbedtls-dev (just setup base checks it). File-path and base64 cert loading are both supported.
  • Bare-metal: only ZENOH_TLS_ROOT_CA_CERTIFICATE_BASE64 is supported (no filesystem). The certificate is embedded at build time.
  • The link-tls Cargo feature must be enabled on both the example and the nros crate.

Build-Time Configuration

VariableDescriptionRequired
ZENOH_PICO_DIRCMake install prefix for pre-built zenoh-pico (use with system-zenohpico feature on zpico-sys)Only with system-zenohpico
SSIDWiFi network name for ESP32 examplesRequired for build-examples-esp32
PASSWORDWiFi password for ESP32 examplesRequired for build-examples-esp32

ARM FVP (FVP_BaseR_AEMv8R)

License-gated — nano-ros does not download the binary. Set one of the discovery vars after accepting the Arm EULA and installing locally. See the ARM FVP getting-started chapter for the end-to-end build+run walk-through.

VariableDescriptionDefault
ARMFVP_BIN_PATHDirectory containing FVP_BaseR_AEMv8R (Zephyr-canonical, highest priority).(unset)
ARM_FVP_DIRInstall root; resolver scans models/Linux64_GCC-*/ underneath. Matches sdk-index.(unset)

If neither is set, scripts/zephyr/resolve-fvp-bin.sh falls back to dirname $(command -v FVP_BaseR_AEMv8R). Phase 217.A — just zephyr run-fvp-aemv8r{,-cyclonedds} skips gracefully when the binary can’t be resolved.

After extracting the Arm-provided tarball, run scripts/installers/arm-fvp-installer.sh with ARM_FVP_DIR set to the extraction root — it locates FVP_BaseR_AEMv8R, symlinks the directory to ~/.nros/sdks/arm-fvp/current/, and prints the export ARMFVP_BIN_PATH=… line for your shell rc. Verify with nros doctor --board fvp-aemv8r-smp, which cross-checks the [gated.arm-fvp] entry in nros-sdk-index.toml and warns (never hard-fails — license-gated) when the binary is missing.

FreeRTOS / NuttX / ThreadX SDK Paths

These are auto-resolved by justfile recipes (defaulting to external/ paths from just freertos setup / just nuttx setup / just threadx_linux setup). Override via env vars if sources are elsewhere.

VariableDefaultDescription
FREERTOS_DIRthird-party/freertos/kernelFreeRTOS kernel source
FREERTOS_PORTGCC/ARM_CM3FreeRTOS portable layer
LWIP_DIRthird-party/freertos/lwiplwIP source
FREERTOS_CONFIG_DIRBoard crate’s config/FreeRTOSConfig.h + lwipopts.h
NUTTX_DIRthird-party/nuttx/nuttxNuttX RTOS source
NUTTX_APPS_DIRthird-party/nuttx/nuttx-appsNuttX apps source
THREADX_DIRthird-party/threadx/kernelThreadX kernel source
THREADX_CONFIG_DIRBoard crate’s config/ThreadX config (tx_user.h)
NETX_DIRthird-party/threadx/netxduoNetX Duo source
NETX_CONFIG_DIRBoard crate’s config/NetX Duo config (nx_user.h)

Buffer Tuning

All optional – platform-appropriate defaults apply if unset. See Configuration for deployment-scenario guidance and platform guides for target-specific sizing.

Zenoh-pico (ZPICO_*)

VariableDescriptionDefaultCrate
ZPICO_FRAG_MAX_SIZEMax reassembled message size after defragmentation65536 / 2048zpico-sys
ZPICO_BATCH_UNICAST_SIZEMax unicast batch size before fragmentation65536 / 1024zpico-sys
ZPICO_BATCH_MULTICAST_SIZEMax multicast batch size8192 / 1024zpico-sys
ZPICO_MAX_PUBLISHERSMax concurrent publishers in zenoh shim8zpico-sys
ZPICO_MAX_SUBSCRIBERSMax concurrent subscribers in zenoh shim8zpico-sys
ZPICO_MAX_QUERYABLESMax concurrent queryables in zenoh shim8zpico-sys
ZPICO_MAX_LIVELINESSMax concurrent liveliness tokens in zenoh shim16zpico-sys
ZPICO_MAX_PENDING_GETSMax concurrent in-flight service calls4zpico-sys
ZPICO_SUBSCRIBER_BUFFER_SIZEPer-subscriber static buffer in zenoh shim1024nros-rmw-zenoh
ZPICO_SERVICE_BUFFER_SIZEPer-service-server static buffer in zenoh shim1024nros-rmw-zenoh
ZPICO_GET_REPLY_BUF_SIZEStack buffer for service client replies4096zpico-sys
ZPICO_GET_POLL_INTERVAL_MSSingle-threaded polling interval in zenoh_shim_get()10zpico-sys
NROS_SMOLTCP_MAX_SOCKETSMax concurrent TCP sockets (smoltcp); brokered default since Phase 204.2. Legacy alias: ZPICO_SMOLTCP_MAX_SOCKETS.1 (brokered)nros-smoltcp
NROS_SMOLTCP_MAX_UDP_SOCKETSMax concurrent UDP sockets (smoltcp); 1 by default, 4 with the nros-smoltcp/rtps feature (Phase 204.2). Legacy alias: ZPICO_SMOLTCP_MAX_UDP_SOCKETS.1 (brokered)nros-smoltcp
NROS_SMOLTCP_BUFFER_SIZEPer-socket staging buffer (smoltcp). Legacy alias: ZPICO_SMOLTCP_BUFFER_SIZE.2048nros-smoltcp
NROS_SMOLTCP_CONNECT_TIMEOUT_MSTCP connection timeout (smoltcp). Legacy alias: ZPICO_SMOLTCP_CONNECT_TIMEOUT_MS.30000nros-smoltcp
NROS_SMOLTCP_SOCKET_TIMEOUT_MSTCP read/write timeout (smoltcp). Legacy alias: ZPICO_SMOLTCP_SOCKET_TIMEOUT_MS.10000nros-smoltcp

XRCE-DDS (XRCE_*)

VariableDescriptionDefaultCrate
XRCE_TRANSPORT_MTUCustom transport MTU; also sizes stream buffers (4x MTU) and UDP staging4096 / 512xrce-sys
XRCE_MAX_SUBSCRIBERSMax concurrent subscribers8nros-rmw-xrce
XRCE_MAX_SERVICE_SERVERSMax concurrent service servers4nros-rmw-xrce
XRCE_MAX_SERVICE_CLIENTSMax concurrent service clients4nros-rmw-xrce
XRCE_BUFFER_SIZEPer-slot static buffer size1024nros-rmw-xrce
XRCE_STREAM_HISTORYReliable stream history depth (must be >= 2)4nros-rmw-xrce
XRCE_ENTITY_CREATION_TIMEOUT_MSTimeout for entity creation1000nros-rmw-xrce
XRCE_SERVICE_REPLY_TIMEOUT_MSTimeout for service replies1000nros-rmw-xrce
XRCE_SERVICE_REPLY_RETRIESNumber of service reply retries5nros-rmw-xrce
XRCE_MAX_SESSION_CONNECTION_ATTEMPTSMax session connection attempts10xrce-sys
XRCE_MIN_SESSION_CONNECTION_INTERVALMin interval between connection attempts (ms)25xrce-sys
XRCE_MIN_HEARTBEAT_TIME_INTERVALMin heartbeat interval (ms)100xrce-sys
XRCE_UDP_META_COUNTIn-flight UDP packets per direction (smoltcp)4xrce-smoltcp

Core (NROS_*)

VariableDescriptionDefaultCrate
NROS_EXECUTOR_MAX_CBSMax executor callback slots (compile-time fixed array size)4nros-node
NROS_EXECUTOR_ARENA_SIZEExecutor arena size in bytes (compile-time fixed array size)4096nros-node
NROS_SUBSCRIPTION_BUFFER_SIZEDefault subscription/service buffer size (bytes)1024nros-node
NROS_EXECUTOR_MAX_HANDLESMax handles in a C API executor16nros-c
NROS_MAX_SUBSCRIPTIONSMax subscriptions in a C API executor8nros-c
NROS_MAX_TIMERSMax timers in a C API executor8nros-c
NROS_MAX_SERVICESMax services in a C API executor4nros-c
NROS_LET_BUFFER_SIZEBuffer size for LET semantics per handle512nros-c
NROS_MESSAGE_BUFFER_SIZEMax buffer size for subscription/service data4096nros-c
NROS_MAX_CONCURRENT_GOALSMax concurrent goals per action server (compile-time constant, not env-var configurable)4nros-c
NROS_MAX_PARAMETERSMax parameters in parameter server32nros-params
NROS_MAX_PARAM_NAME_LENMax parameter name length64nros-params
NROS_MAX_STRING_VALUE_LENMax string parameter value length256nros-params
NROS_MAX_ARRAY_LENMax parameter array length32nros-params
NROS_MAX_BYTE_ARRAY_LENMax byte array parameter length256nros-params