Expand description
§nros
A lightweight ROS 2 client library for embedded systems.
This crate provides a unified API for building ROS 2 nodes in Rust,
with support for no_std environments and embedded targets.
§Features
- no_std compatible: Works on bare-metal and RTOS targets
- Zero-copy where possible: Minimizes memory allocations
- Type-safe: Compile-time verification of message types
- ROS 2 compatible: Interoperates with standard ROS 2 nodes via rmw_zenoh
§Quick Start
use nros::prelude::*;
use std_msgs::msg::Int32;
let config = ExecutorConfig::from_env().node_name("my_node");
let mut executor = Executor::open(&config)?;
let node = executor.node_builder("my_node").build()?;
let publisher = executor.node_mut(node).create_publisher::<Int32>("/my_topic")?;
publisher.publish(&Int32 { data: 42 })?;
executor.node_mut(node).create_subscription::<Int32, _>("/topic", |msg: &Int32| {
println!("Received: {}", msg.data);
})?;
executor.spin(SpinOptions::default());§Executor Sizing
The executor’s static memory layout is controlled via environment variables at build time:
NROS_EXECUTOR_MAX_CBS(default 4) — maximum number of registered callbacks (subscriptions + timers + services + guard conditions).NROS_EXECUTOR_ARENA_SIZE(default 4096) — byte budget for storing callback closures inline.
A subscription’s arena receive buffer is sized from the MESSAGE TYPE’s own
serialized bound (phase-392 W3c), not from that knob, wherever the bound is
reachable. .rx_buffer::<N>() is the opt-out: it says “give me exactly N
bytes per slot” and skips the derivation, which is what a peer that pads or
a .msg bound looser than the traffic needs (e.g.
node_mut(id).subscription(t).typed::<M>().rx_buffer::<4096>().build(cb)).
§Transport Backends
Phase 248 C5c — nros is RMW- and platform-AGNOSTIC. It carries only the
rmw-cffi vtable; the concrete backend (zenoh / xrce / cyclonedds) enters
the link graph via the board crate (embedded), the board-less app’s own
nros-rmw-* dep (native), or the nros-c/nros-cpp staticlib root (D3),
and self-registers through the RMW_INIT_ENTRIES walker at Executor::open.
The concrete session type is resolved automatically; advanced users can
access it via nros::internals::RmwSession.
§Crate Features
nros exposes only FUNCTIONAL features — std/alloc, the rmw-cffi
vtable, lending, bridge/config, param-services,
lifecycle-services, safety-e2e, stream, ffi-sync, and the ROS
edition (ros-humble/ros-iron). There are NO platform-* or concrete
rmw-* selector features (Phase 248 C7). Platform + RMW are selected by the
board / staticlib root via dependencies, not nros features. The
zephyr_component_main! entry macro is gated only on rmw-cffi (it’s
framework entry codegen, like nros::main!), not a platform feature.
ROS edition (select one; RFC-0056 — the per-distro interop profile):
ros-humble- ROS 2 Humble (default;TypeHashNotSupported, XCDR1)ros-iron- ROS 2 Iron (RIHS01 type hash)ros-jazzy- ROS 2 Jazzy (RIHS01; XCDR2/appendable is phase-303)
Other:
std(default) - Enable standard library supportalloc- Enable heap allocation without full std
§Further Reading
guide— tutorials: getting started, services, configuration, ROS 2 interop, and troubleshooting- Message Generation — codegen reference (all options, output structure, bundled interfaces)
- Environment Variables — complete buffer tuning reference
- ROS 2 Interop — protocol details (key expressions, liveliness, attachments)
- Examples — working examples by platform (native, QEMU, ESP32, Zephyr)
Re-exports§
pub use retired_env::RETIRED_ENV_VARS;pub use env::ExecutorConfigEnvExt;pub use env::rmw_selector;pub use init::ContextSource;pub use init::InitError;pub use init::InitOptions;pub use init::Context;pub use init::init;pub use init::init_with_args;pub use node::ActionExecutor;pub use node::Callback;pub use node::CallbackCtx;pub use node::ClientDispatch;pub use node::EntityBounds;pub use node::NodeActionClient;pub use node::NodeActionServer;pub use node::NodeDeclError;pub use node::NodeOptions;pub use node::NodeParameter;pub use node::NodePublisher;pub use node::NodeResult;pub use node::NodeRuntime;pub use node::NodeServiceClient;pub use node::NodeServiceServer;pub use node::NodeSubscription;pub use node::NodeTimer;pub use node::PublisherResolver;pub use node::TickCtx;pub use node::CallbackEffects;pub use node::Component;pub use node::DeclarativeNode;pub use node::ExecutableNode;pub use node::NodeContext;pub use node_metadata::SourceMetadataExport;pub use node_metadata::CallbackEffectKind;pub use node_metadata::CallbackEffectMetadata;pub use node_metadata::EntityKind;pub use node_metadata::EntityMetadata;pub use node_metadata::MetadataRecorder;pub use node_metadata::MetadataString;pub use node_metadata::NodeMetadata;pub use node_metadata::NodeMetadataError;pub use node_metadata::ParameterDefault;pub use node_metadata::SourceLocationMetadata;pub use node_metadata::SourceNameKind;pub use dispatch_tag::ActionTag;pub use dispatch_tag::ServiceTag;pub use dispatch_tag::SubscriptionTag;pub use node_runtime::ComponentSlotStorage;pub use node_runtime::install_node_typed_in;pub use node_runtime::install_node_typed_with_launch_in;pub use node_runtime::ExecutorError;pub use node_runtime::ExecutorNodeRuntime;pub use node_runtime::RegisteredNode;pub use node_runtime::install_node_typed;pub use node_runtime::install_node_typed_with_launch;pub use node_runtime::install_node_typed_with_node_identity;pub use node_runtime::install_node_typed_with_params;pub use nros_core::heapless;
Modules§
- cdr
- CDR encapsulation constants and helpers for FFI layers that handle raw CDR bytes (e.g. nros-c, nros-cpp action and service paths).
- config
- Build-time runtime configuration — phase-391 W5.
- contract
- Contract monitors on target, and the
/diagnosticsreporter they publish through — issues 1635 and 1676, ONE implementation for every language. - derive
- Derive macros for message types
- dispatch_
tag - Phase 216.A.4 — tag types Node authors hold on
Self::Stateto match against incomingCallbackinExecutableNode::on_callback. - embedded
- Prelude module for convenient imports
- env
- issue 0687 — the hosted edge of configuration: every env var nano-ros honours is read here, and the core takes values. The hosted edge of configuration: the process environment.
- executor_
handle - Issue 1535 — what a
void*executor handle crossing the language seam is, and the one check every seam in this crate makes before treating it as anExecutor(a C/C++ entry’s handle is an nros-cpp context, not one). Issue 1535 — what avoid* executorhanded across the language seam IS. - guide
- Tutorials and guides for using nros.
- host_
env - Issue 1763 — the same env rung for a
#![no_std]image inside a host process (threadx-linux, freertos-posix), read with the C library’sgetenv.target_os = "linux"is “a C library is linked” on this tree. Compiled on every Linux build, not onlynot(feature = "env")ones: feature unification can turnnros/envon under a caller whose ownenvis off, and the caller must still find this. Where a caller hasenv, it uses thestd::envreader instead (nros-c/nros-cppresolve_boot). Issue 1763 — the boot-config ENV rung for a#![no_std]image that still runs inside a host process, read through the C library’sgetenv. - init
- Phase 212.L.5 — top-level init API; phase-427 W9 — on every target.
- internals
- Backend-specific internal types.
- lifecycle
- Re-export of the full lifecycle module so examples can reach
LifecycleCallbackSlot,LifecyclePollingNodeCtx, etc. - logging
- The whole logging facade — sinks, the early-record ring, the throttle
primitives,
init/flush/add_sink. - monitor
- node
- Rust component API shared by metadata discovery and generated runtimes.
- node_
metadata - Node source metadata recorded without opening middleware.
- node_
runtime - Phase 212.M.5.a.2 — executor-backed component runtime.
- port_
park - phase-436 W7 — installing a port’s park primitive, with the wake-object constraint stated once. Board entries reach it through this facade because that is the dependency they already carry.
- prelude
- qos
- The five presets under their older, shorter names.
- retired_
env - phase-484 W8c — the retired env aliases both hosted readers refuse. phase-484 W8c — the RETIRED runtime env aliases and their canonical names.
- runtime_
storage - Caller-supplied storage for the component pool — phase-391 W5, step 2.
- sizes
- Compile-time opaque storage sizes for FFI consumers.
- time
- Monotonic time for portable node code (issue #504).
Macros§
- declarative_
component - Emit a no-op
ExecutableNodeimpl for a declarative-only component (W.5.1). The generated runtime callson_callbackunconditionally, so a component instantiated into a generated binary must implExecutableNode; components without callback bodies use this to satisfy that contract: - force_
link_ backend - Define Zephyr’s
rust_mainfor a self-bringup Rust component package. - log_
debug - Emit at
crate::Severity::Debug. - log_
error - Emit at
crate::Severity::Error. - log_
fatal - Emit at
crate::Severity::Fatal. - log_
info - Emit at
crate::Severity::Info. - log_
warn - Emit at
crate::Severity::Warn. - nros_
debug_ throttle - Emit at
crate::Severity::Debug, at most once perinterval_msat this call site. - nros_
debug_ throttle_ at - Emit at
crate::Severity::Debug, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
error_ throttle - Emit at
crate::Severity::Error, at most once perinterval_msat this call site. - nros_
error_ throttle_ at - Emit at
crate::Severity::Error, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
fatal_ throttle - Emit at
crate::Severity::Fatal, at most once perinterval_msat this call site. - nros_
fatal_ throttle_ at - Emit at
crate::Severity::Fatal, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
info_ throttle - Emit at
crate::Severity::Info, at most once perinterval_msat this call site. - nros_
info_ throttle_ at - Emit at
crate::Severity::Info, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
trace - Emit at
crate::Severity::Trace. - nros_
trace_ throttle - Emit at
crate::Severity::Trace, at most once perinterval_msat this call site. - nros_
trace_ throttle_ at - Emit at
crate::Severity::Trace, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
warn_ throttle - Emit at
crate::Severity::Warn, at most once perinterval_msat this call site. - nros_
warn_ throttle_ at - Emit at
crate::Severity::Warn, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - panic_
halt - panic_
to_ platform - rx_
buffer_ for - Route this image’s panics to its platform — phase-366 W5.c / RFC-0077.
- zephyr_
component_ main
Structs§
- Action
Client - Typed action client handle.
- Action
Client Core - Type-agnostic action client core handling the raw-bytes protocol.
- Action
Server - Typed action server with goal state management.
- Action
Server Core - Type-agnostic action server core handling the raw-bytes protocol.
- Action
Server Handle - Handle to an action server registered in the executor’s arena.
- Action
Server RawHandle - Handle to a raw (untyped) action server registered in the executor’s arena.
- Active
Goal - Active goal tracking for action server.
- Baked
Boot Config - Build-time-baked boot config, emitted (in W4b) into the
.nros_boot_configlinker section by the entry macro / cmake. Fixed-size + pointer-free so a future post-link tool can patch it in place (RFC-0045). The resolver reads it on embedded viaBootConfig::from_baked(innros-node). - Boot
Config - Session-identity subset a caller supplies to
ExecutorConfig::resolve. - CdrReader
- CDR reader for deserialization
- CdrWriter
- Clock
- A clock for querying time
- Completed
Goal - Completed goal with result.
- Duration
- ROS Duration representation
- Embedded
Publisher - Typed publisher handle.
- Embedded
RawPublisher - Typeless publisher handle. Use when the wire format is not ROS CDR (e.g. PX4 uORB raw POD bytes, custom binary protocols).
- Embedded
Service Client - Typed service client handle with internal buffers.
- Embedded
Service Server - Typed service server handle with internal buffers.
- Executor
- Executor
Config - Configuration for opening an embedded executor session.
- Executor
Sizing - Per-entry executor sizing — the entity counts an
Executoris built to hold. Public + non-generic (the “C/C++ is a thin wrapper” principle): the entry / macro / FFI supplies these as plainusizes rather than as type/const generics C can’t name. Used to size + carve the backing. - Feedback
Stream - A stream of feedback messages from an action server.
- Floating
Point Range - Floating point range constraints for parameters
- Goal
Feedback Stream - A goal-filtered feedback stream.
- GoalId
- Unique identifier for a goal
- Goal
Info - Information about a goal
- Goal
Status Stamped - Goal status with associated goal info
- Guard
Condition - Handle for triggering a guard condition from outside the executor.
- Handle
Id - Opaque handle identifier returned by registration methods.
- Handle
Set - A set of handle IDs, represented as a bitset.
- Integer
Range - Integer range constraints for parameters
- Lifecycle
Polling Node - Standalone lifecycle state machine for
no_stdenvironments. - LogRecord
- One log entry, handed to each
LogSink. - Logger
- A named logger with a runtime severity threshold.
- Mandatory
Parameter - A parameter that must always have a value
- Message
Info - Metadata about a received message
- Node
- A ROS 2 node — rclrs’s
Node, and the ONE node type (phase-483 W2). - NodeKey
- Which node a parameter belongs to.
- OnSet
Context - Two machine words of caller context, carried verbatim to an
OnSetParameterFn. - OnSet
Parameter Handle - A registered
OnSetParameterFn, returned byParameterServer::add_on_set_parameters_callbackand consumed byParameterServer::remove_on_set_parameters_callback. - OptUs
- Optional time field with a sentinel
0for “absent”. - Optional
Parameter - A parameter that may or may not have a value
- Parameter
- A named parameter with value and optional descriptor
- Parameter
Builder - Builder for declaring a typed parameter
- Parameter
Descriptor - Parameter descriptor containing metadata
- Parameter
Server - Parameter server over caller-owned storage
- Parameter
Storage - Backing storage a caller places, then lends to a
ParameterServer. - Parameter
Table - The slot table a
ParameterServerborrows. - Promise
- A pending reply from a non-blocking service or action call.
- Publish
Loan - Writable loan into a
EmbeddedRawPublisher’s slot. - Publisher
Options - Options for creating a publisher
- QoSOverride
- Phase 211.H — one per-topic QoS override, lowered from a ROS 2
qos_overrides.<topic>.<role>.<policy>launch parameter by the planner and baked into a&'static [QoSOverride]table by the entry codegen. The node folds the matching entries into the entity’sQoSProfileatcreate_publisher/create_subscriptiontime (setup-time, single linear scan, no alloc), before the backend-compatvalidate_against— so an override the active RMW can’t honour still errors loudly, never a silent downgrade. - QoSPolicy
Mask - Bitmask of QoS policies a backend can honour. See
Session::supported_qos_policies. - QoSProfile
- Full DDS-shaped QoS profile. Matches the field set of upstream
rmw_qos_profile_t. - RawAction
Client Spec - Inputs for raw (untyped) action-client registration.
- RawAction
Server Spec - Inputs for raw (untyped) action-server registration.
- RawActive
Goal - Goal tracked by the core — only GoalId + status, no typed data.
- RawMessage
Info - Raw-subscription message info:
MessageInfometadata plus the sample’s wire-level attachment bytes, borrowed for the callback scope. - RawSubscription
- Typeless subscription handle. Counterpart of
EmbeddedRawPublisher. - Read
Only Parameter - A parameter whose value cannot be changed after declaration
- Readiness
Snapshot - Snapshot of handle readiness at the start of a spin iteration.
- Recv
View - Read-only view into a
RawSubscription’s receive buffer. - RmwConfig
- Middleware-agnostic session configuration.
- Sched
Context - First-class scheduling capability — one SC per scheduling concern, shared by every callback that should run under the same budget / period / deadline / class.
- Sched
Context Id - Identifier for a
SchedContextregistered with an Executor. 110.B.b adds storage[Option<SchedContext>; MAX_SC]; this index addresses into that array. - Service
Client - Service client handle
- Service
Info - Service information for service client/server
- Service
Request - Service request from a client
- Service
Server - Service server handle
- Session
Handle - Phase 228.E — an opaque,
Sendhandle to anExecutor’s RMW session. - Session
Spec - Phase 128.F.1 — per-backend session declaration for
Executor::open_multi. Each spec names an RMW backend (must match one a backend registered under vianros_rmw_cffi_register_named/ theRMW_INIT_ENTRIESlinker section) and the locator + domain id to open against it. - Shutdown
Callback Handle - Handle to a registered shutdown hook, returned by
Executor::add_pre_shutdown_callback/Executor::add_on_shutdown_callbackand consumed by the matchingremove_*. rclcpp’sPreShutdownCallbackHandle/OnShutdownCallbackHandle. - Spin
Once Result - Result of a single spin iteration
- Spin
Options - Options controlling a blocking spin loop — rclrs’s
SpinOptions. - Spin
Period Polling Result - Result from a single period of polling execution (
no_stdcompatible). - Spin
Period Result - Result from a single period with monotonic-clock measurement.
- Subscription
- Typed subscription handle with internal receive buffer.
- Subscription
Options - Options for creating a subscriber
- Throttle
State - Per-call-site throttle window.
- Tier
Backing Short - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). issue 1571 — the tier backing a board was handed does not cover the tiers it must spawn. Carries both counts so the refusal names them. - Tier
Executor Backing - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). issue 1571 — the spawned tiers’ executor backing,Nslots in ONE named static that the ENTRY owns. - Tier
Setup Gate - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). Issue 1733 — the ONE gate a tier runner holds across each tier’s open-and-setupso no two tiers declare entities on the shared session at once. - Tier
Setup Guard - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). Issue 1733 — proof of holding aTierSetupGate; dropping it opens the gate. - Tier
Task Memory - issue 1598 — each spawned tier’s TASK memory (stack + control block):
nros::main!emits oneTierTaskMemorystatic per spawned tier, sized from itsstack_bytes, and hands theTierTaskMemorySetrows to a board whose tier runner creates the task over them (FreeRTOSxTaskCreateStatic). issue 1598 — one spawned tier’s stack and control block, as ONE named static the entry owns.STACK_U64Sis the tier’s stack in 8-byte words;TCB_U64Sthe control-block region,TIER_TASK_TCB_U64Sby default and0for a kernel whose control block the port keeps itself (Zephyr’sstruct k_thread, issue 1232 — a Rust entry cannot size it). - Tier
Task Memory Raw - issue 1598 — each spawned tier’s TASK memory (stack + control block):
nros::main!emits oneTierTaskMemorystatic per spawned tier, sized from itsstack_bytes, and hands theTierTaskMemorySetrows to a board whose tier runner creates the task over them (FreeRTOSxTaskCreateStatic). issue 1598 — one spawned tier’s task memory as a board receives it: raw,Copy, no lifetime. The ENTRY owns the bytes (TierTaskMemory); the handout is once-only (TierTaskMemorySet::take), which is what makes the raw pointers exclusive. - Tier
Task Memory Set - issue 1598 — each spawned tier’s TASK memory (stack + control block):
nros::main!emits oneTierTaskMemorystatic per spawned tier, sized from itsstack_bytes, and hands theTierTaskMemorySetrows to a board whose tier runner creates the task over them (FreeRTOSxTaskCreateStatic). issue 1598 — the spawned tiers’ task memory,Nrows in spawn (chain) order, behind a once-only latch. - Time
- ROS Time representation
- Time
Triggered Schedule - Fixed-size, no_std-friendly cyclic schedule.
Nis the declared maximum window count;window_countis the active length (callers can build the array up toNand setwindow_countto the actual size used). - Time
Triggered Window - One slot in a time-triggered schedule.
- Timer
Duration - Duration type for timer periods
- Timer
Handle - A handle to a timer stored in a node
- Timer
State - Internal timer state
- Topic
Info - Topic information for pub/sub
- Transport
Config - Transport session configuration
- Undeclared
Parameters - Provides access to undeclared parameters in a ParameterServer
Enums§
- Boot
Config Error - Cancel
Response - Per-goal cancel decision returned from a server’s cancel callback.
- Cancel
Return Code action_msgs/srv/CancelGoalRPC return codes.- Clock
Type - Type of clock to use for time queries
- Deadline
Action - RFC-0052 / phase-296 W3b.5 — what the executor DOES when a dispatched
callback runs past its bound SC’s
deadline_us. Distinct fromDeadlinePolicy(which says where the deadline COMES from); this is the miss REACTION, lowered from the tier table’sdeadline_policystring (ignore | warn | skip | fault). - Deadline
Policy - How an EDF deadline is interpreted relative to a callback firing.
- Declaration
Error - Why a declaration was refused — phase-417 W4.a.
- Deser
Error - Deserialization error.
- Dispatch
Strategy - How a Node expects its callbacks to fire.
- Executor
Semantics - Data communication semantics for the executor.
- Goal
Response - Goal accept/reject response codes
- Goal
Status - Goal status states
- Invocation
Mode - Per-callback invocation mode.
- Lifecycle
Error - Error type for lifecycle transitions.
- Lifecycle
State - Lifecycle state (REP-2002)
- Lifecycle
Transition - Lifecycle transition (REP-2002)
- Loan
Error - Error type for
EmbeddedRawPublisher::try_loan. - Node
Error - Error type for generic embedded node operations.
- Parameter
Error - Error type for typed parameter operations
- Parameter
Range - Range constraints for a parameter
- Parameter
Type - ROS 2 parameter types
- Parameter
Value - Parameter value container
- Priority
- Criticality bucket for
SchedContext. Phase 110.C uses this to pick whichBucketedFifoSet/BucketedEdfSetslot a callback dispatches through; later phases (110.D) map it to OS priority. - QoSDurability
Policy - QoS durability policy
- QoSHistory
Policy - QoS history policy
- QoSLiveliness
Policy - QoS liveliness policy. Matches DDS
LIVELINESSsemantics. - QoSOverride
Role - Phase 211.H — which side of a topic a
QoSOverridetargets. Mirrors the<role>segment of a ROS 2qos_overrides.<topic>.<role>.<policy>launch parameter. - QoSOverride
Value - Phase 211.H — a single policy value a
QoSOverridesets. A typed enum (not a string) so the codegen that bakes these from the plan catches an unknown policy / mistyped value at generation time rather than silently no-op-ing at runtime. - QoSReliability
Policy - QoS reliability policy
- Sched
Class - Scheduling class — picks the runtime queue + selection policy for the contained callbacks.
- SerError
- Serialization error.
- Session
Mode - Session mode
- SetParameter
Result - Result of setting a parameter
- Severity
- REP-2012 severity levels: rcutils’s five, in rcutils’s order, plus
Trace. - Shutdown
Phase - Which of the two ordered shutdown phases a hook belongs to.
- Time
Triggered Schedule Error - Validation errors for a
TimeTriggeredSchedule. - Timer
Clock Source - Which clock advances a timer (phase-425 W4, RFC-0075-adjacent: this is the
distinction rclcpp draws between
create_wall_timerandcreate_timer). - Timer
Mode - Timer mode (repeating, one-shot, or inert)
- Transition
Result - Result of a lifecycle transition callback.
- Transport
Error - Transport error types.
- Trigger
- Executor-level trigger condition.
- Wake
Source Id - phase-436 B2 — the other half of the seam, for the boards that now use it.
Constants§
- BOOT_
SET_ DOMAIN - Bit 2 —
domain_idfield is set. - BOOT_
SET_ LOCATOR - Bit 1 —
locatorfield is set. - BOOT_
SET_ NAMESPACE - Bit 3 —
namespacefield is set. - BOOT_
SET_ NODE_ NAME - Bit 0 —
node_namefield is set. - DEFAULT_
RX_ BUF_ SIZE - The configured default receive-buffer size (
NROS_SUBSCRIPTION_BUFFER_SIZE). - DOMAIN_
ID_ EXPLICIT_ ZERO_ C_ ABI - Issue #227 — C/C++-ABI escape for an EXPLICIT domain 0.
- DOMAIN_
ID_ MAX - RFC-0045 / issue #206 — maximum valid ROS 2 domain ID. The ROS 2 / DDS convention (RTPS port arithmetic) caps usable domains at 232; values above it are a configuration error in EVERY language front-end (never a silent clamp or silent 0). Mirrored into the generated C header — keep the mirror in sync (the #160 drift class).
- EXECUTOR_
BACKING_ DEFAULT_ U64S - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). The reservation’s size when nothing overrides it: one default-sized executor’s worth. - MAX_
LOGGERS - Maximum number of named loggers that can be registered via
register_logger. Beyond this,get_loggerreturnsDEFAULT_LOGGER. - MAX_
ON_ SET_ CALLBACKS - How many on-set-parameters callbacks ONE store holds, across every node.
- MAX_
WAKE_ SOURCES - phase-436 B2 — the other half of the seam, for the boards that now use it.
- NROS_
BOOT_ CONFIG_ MAGIC - 0x4E524243 = ASCII “NRBC”. A post-link tool scans for this magic to locate the struct in a firmware image.
- NROS_
BOOT_ CONFIG_ VERSION - Layout version — lets the resolver reject a mismatched baked struct.
- PUBLISHER_
GID_ SIZE - Size of the publisher Global Identifier (GID), in bytes.
- QOS_
PROFILE_ ACTION_ STATUS_ DEFAULT - The action-status preset — reliable + transient-local, depth 1.
- QOS_
PROFILE_ CLOCK - The clock preset — sensor-data shaped with depth 1.
- QOS_
PROFILE_ DEFAULT - Phase 108.B — standard ROS-2-equivalent QoS profiles. Match
upstream
rmw_qos_profile_defaultetc. field-by-field. Backends validate against these synchronously at create time; no silent downgrade.rmw_qos_profile_default— reliable, volatile, keep-last(10). - QOS_
PROFILE_ PARAMETERS rmw_qos_profile_parameters— reliable, depth 1000.- QOS_
PROFILE_ PARAMETER_ EVENTS rmw_qos_profile_parameter_events.- QOS_
PROFILE_ SENSOR_ DATA rmw_qos_profile_sensor_data— best-effort, keep-last(5).- QOS_
PROFILE_ SERVICES_ DEFAULT rmw_qos_profile_services_default.- QOS_
PROFILE_ SYSTEM_ DEFAULT rmw_qos_profile_system_default— the RMW implementation’s own defaults.- TIER_
TASK_ TCB_ U64S - issue 1598 — each spawned tier’s TASK memory (stack + control block):
nros::main!emits oneTierTaskMemorystatic per spawned tier, sized from itsstack_bytes, and hands theTierTaskMemorySetrows to a board whose tier runner creates the task over them (FreeRTOSxTaskCreateStatic). issue 1598 — the control-block region everyTierTaskMemorycarries, in 8-byte words. An UPPER BOUND over the kernels that take it (a FreeRTOSStaticTask_ton Cortex-M is about a hundred bytes); the port REFUSES a region smaller than its own control block at spawn, by name, so a kernel whose block outgrows this fails loudly rather than overrunning the stack that follows. Rust cannot name a C type’s size at macro time, which is why this one number is a bound and the stack beside it is exact.
Statics§
- DEFAULT_
LOGGER - Catch-all logger returned when the requested name is not registered (or the intern table is full).
Traits§
- Board
Config - Universal board configuration accessors.
- Client
Trait - Service client trait for sending requests.
- Deserialize
- Trait for types that can be deserialized from CDR format
- LogSink
- Backend a log record is delivered to.
- Parameter
Variant - Trait for types that can be used as typed parameters
- Publisher
- Publisher trait for sending messages.
- Rmw
- Factory trait for compile-time middleware selection.
- RosAction
- Trait for ROS 2 action types
- RosMessage
- Trait for ROS message types
- RosService
- Trait for ROS service types
- SecNanosec
Msg - A generated message whose field set is
{ sec: i32, nanosec: u32 }—builtin_interfaces/msg/Timeand itsDurationtwin. - Serialize
- Trait for types that can be serialized to CDR format
- Service
Trait - Service server trait for handling requests.
- Session
- Transport session trait — the per-process anchor an RMW backend gives to the executor.
- Subscription
Trait - Subscription trait for receiving messages.
- Transport
- Transport backend trait (legacy).
Functions§
- action_
channel_ type - The per-channel DDS type name for a RAW-registered action server.
- arena_
size_ for - phase-271 — default arena bytes for a per-entry executor holding
cbscallback slots. Scales the build-timeARENA_SIZE(which is sized for the defaultMAX_CBS) linearly bycbs, so a per-entryExecutorSizingwith a caller-chosencbsgets the same per-slot arena budget the global default used — a fat entry (more callbacks) gets a larger arena, a lean one a smaller one — without a workspace-globalNROS_EXECUTOR_ARENA_SIZE. Floored at the full default so no per-entry executor is ever smaller than a single-slot build would have been (the arena is a worst-case upper bound; over-provision is safe, under-provision fails entity creation). - baked_
domain_ from_ c_ abi - Map the C/C++ ABI’s
u8domain argument onto the resolver’s baked rung. - check_
tier_ executor_ backing - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). issue 1571 — the ONE refusal every board’srun_tiersmakes before it opens anything:n_tierstiers run, one on the boot executor, son_tiers - 1must each find a slot. Checked up front rather than at each spawn, so a short block never leaves a half-spawned tier chain. - fully_
qualified_ name - phase-381 follow-up — the node-FQN join, at the crate root because that is
where a user looks after
Executor::get_node_nameshands them the two halves.nros_node::namesalso hasexpand_name/resolve_name, which stay behindnode_metadata— they are the entity-name seam, not this. Phase 305 W3 (issue 0255) — the ONE name-resolution seam: ROS 2 source-name expansion (~/relative → FQN, ns=/collapse) + launch remap substitution (exact-FQN match, first rule wins; no wildcards). Implemented innros_node::namesso both the RustExecutorSinkand the C-ABI executor-side remap table share one lowering; re-exported here next toSourceNameKindas the source-metadata-level entry point. A node’s fully-qualified name, joined from its two halves. - get_
logger - Look up a registered logger by name. Returns
DEFAULT_LOGGERif none is registered (callregister_loggerfor a'static Loggerto publish one). - get_
or_ create_ logger - Look up a logger by name, CREATING one if the name is new.
- register_
logger - Publish
loggerunder its name so subsequentget_loggercalls with that name return THIS reference.
Type Aliases§
- Lifecycle
Callback Fn - Lifecycle callback function pointer (
no_stdcompatible). - Next
Deadline Fn - phase-436 B2 — the other half of the seam, for the boards that now use it.
- OnSet
Parameter Fn - An on-set-parameters callback — phase-417 W4.a.
- RawCancel
Callback - Raw action cancel callback.
- RawGoal
Callback - Raw action goal callback that receives CDR bytes without deserialization.
- RawService
Callback - Raw service callback that receives and produces CDR bytes.
- RawSubscription
Callback - Raw subscription callback that receives CDR bytes without deserialization.
- Shutdown
Callback Fn - A shutdown hook:
extern "C"so the same slot serves Rust, C and C++ without a second registry, and so no allocator is involved. - Tier
Executor Backing Slot - issue 1571 — the spawned tiers’ executor backing.
nros::main!emits oneTierExecutorBackingstatic per tiered entry and hands its slots to the board’srun_tiers, which refuses a short block throughcheck_tier_executor_backingand opens each spawned tier withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). issue 1571 — one spawned tier executor’s backing: exactly the words an executor opened withExecutorSizing::DEFAULTcarves. - Timer
Callback Fn - Timer callback as a bare function pointer (
no_std, no heap required).