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_BYTES(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, 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
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 — before main on a hosted target (an .init_array
ctor; the walker at RMW_INIT_ENTRIESExecutor::open
before that), or through the board’s explicit <backend>::register().
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, and the ROS
edition (ros-humble/ros-iron). There are NO platform-* or concrete
rmw-* selector features. 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; 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 interop is parked)
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::Callback;pub use node::CallbackCtx;pub use node::EntityBounds;pub use node::NodeActionClient;pub use node::NodeActionServer;pub use node::NodeDeclError;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::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::ExecutorError;pub use node_runtime::RegisteredNode;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.
- contract
- Contract monitors on target, and the
/diagnosticsreporter they publish through — ONE implementation for every language. - derive
- Derive macros for message types
- dispatch_
tag - Tag types Node authors hold on
Self::Stateto match against incomingCallbackinExecutableNode::on_callback. - embedded
- Prelude module for convenient imports
- env
- The hosted edge of configuration: every env var nano-ros honours is read here, and the core takes values.
- executor_
handle - 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). What avoid* executorhanded across the language seam IS. - guide
- Tutorials and guides for using nros.
- init
- Top-level init API, on every target.
- internals
- Backend-specific internal types.
- level_
wake - The run-to-completion level runner’s deadlines.
The deadlines a run-to-completion level runner wakes its
levels for (
levels::RunToCompletionLevels), kept apart from it because this half is pure arithmetic over atomics and needs no executor or platform port, so its tests run in the lane that links none. - levels
- The Rust sched task runners’ level core: one executor per core, a worker per level. The Rust sched task runners’ LEVEL core: one executor per core, a worker per level over it.
- 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 - Executor-backed component runtime.
- port_
park - 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 - The retired env aliases the hosted reader refuses. The RETIRED runtime env aliases and their canonical names.
- runtime_
storage - Caller-supplied storage for the component pool.
- sizes
- Compile-time opaque storage sizes for FFI consumers.
- task_
census - The boot task census of a Linux process (
/proc/self/task), one reader for both Linux runners. Linux only, asenvis. The boot task census of a Linux process: every thread with its scheduling policy and real-time priority, as the RTOS runners print theirs (FreeRTOS, NuttX, ThreadX): - thread_
name - What a sched task’s thread is called (
nros-<label>). What a sched task’s THREAD is called, for every runner that spawns one. - time
- Monotonic time for portable node code.
- trace_
marker - Application trace markers: one
(marker_id, arg)event that the APPLICATION places, emitted through the same installed sink the executor’s own callback events go to. - transport_
band - Where a hosted POSIX runner places zenoh-pico’s transport tasks, one
decision for both Linux runners.
Where a hosted POSIX runner places zenoh-pico’s transport tasks: the floor
of the priority plan’s
reserved.transportband (packages/boards/linux/nros-board.toml,[90, 99]), above every sched task.
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
Server - Typed action server with goal state management.
- Action
Server Handle - Handle to an 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 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. 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.
- Goal
Info - Information about a goal
- Goal
Status Stamped - Goal status with associated goal info
- Goal
Uuid - Unique identifier for a goal – rclrs’s
GoalUuid. - 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. - NodeKey
- Which node a parameter belongs to.
- Node
Options - Runtime-neutral node construction options.
- 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. - Parameters
- Provides access to undeclared parameters in a ParameterServer
- Primitive
Options - rclrs’s
PrimitiveOptions: an entity’s name plus the QoS policies its create site stated. - 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
- 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. - RawActive
Goal - Goal tracked by the core — GoalUuid, status and acceptance stamp; 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. - Request
Id - Identity of one service request — rclrs’s
RequestId, upstream’srmw_request_id_t. - 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. - Sched
Task Backing Short - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). The sched task backing a board was handed does not cover the sched tasks it must spawn. Carries both counts so the refusal names them. - Sched
Task Executor Backing - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). The spawned sched tasks’ executor backing,Nslots in ONE named static that the ENTRY owns. - Sched
Task Memory - Each spawned sched task’s TASK memory (stack + control block):
nros::main!emits oneSchedTaskMemorystatic per spawned sched task, sized from itsstack_bytes, and hands theSchedTaskMemorySetrows to a board whose sched task runner creates the task over them (FreeRTOSxTaskCreateStatic). One spawned sched task’s stack and control block, as ONE named static the entry owns.STACK_U64Sis the sched task’s stack in 8-byte words;TCB_U64Sthe control-block region,SCHED_TASK_TCB_U64Sby default and0for a kernel whose control block the port keeps itself (Zephyr’sstruct k_thread— a Rust entry cannot size it). - Sched
Task Memory Raw - Each spawned sched task’s TASK memory (stack + control block):
nros::main!emits oneSchedTaskMemorystatic per spawned sched task, sized from itsstack_bytes, and hands theSchedTaskMemorySetrows to a board whose sched task runner creates the task over them (FreeRTOSxTaskCreateStatic). One spawned sched task’s RTOS task memory as a board receives it: raw,Copy, no lifetime. The ENTRY owns the bytes (SchedTaskMemory); the handout is once-only (SchedTaskMemorySet::take), which is what makes the raw pointers exclusive. - Sched
Task Memory Set - Each spawned sched task’s TASK memory (stack + control block):
nros::main!emits oneSchedTaskMemorystatic per spawned sched task, sized from itsstack_bytes, and hands theSchedTaskMemorySetrows to a board whose sched task runner creates the task over them (FreeRTOSxTaskCreateStatic). The spawned sched tasks’ task memory,Nrows in spawn (chain) order, behind a once-only latch. - Sched
Task Setup Gate - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). The ONE gate a tier runner holds across each tier’s open-and-setupso no two sched tasks declare entities on the shared session at once. - Sched
Task Setup Guard - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). Proof of holding aSchedTaskSetupGate; dropping it opens the gate. - Service
Client - Service client handle
- Service
Info - Metadata about one received service request — rclrs’s
ServiceInfo. - Service
Server - Service server handle
- Session
Handle - An opaque,
Sendhandle to anExecutor’s RMW session. - Session
Spec - 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, which its self-registration calls) and the locator + domain id to open against it. - Shutdown
Callback Handle - Handle to a registered shutdown hook, returned by
ExecutorFfi::add_pre_shutdown_callback/ExecutorFfi::add_on_shutdown_callback(the FFI trait inexecutor::ffi) and 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.
- 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
Call Info - When a timer activation was DUE and when it actually RAN — the
Jazzy
rcl_timer_call_info_t/rclcpp::TimerInfopair. - Timer
Duration - Duration type for timer periods
- Timer
Handle - A handle to a timer stored in a node
- Timer
State - Internal timer state
- Wall
Clock State - What the wall-clock stamps mean right now: the answer to
nros_platform_wall_clock_state(), field for field.
Enums§
- Boot
Config Error - Cancel
Response - Per-goal cancel decision returned from a server’s cancel callback.
- Cancel
Response Code action_msgs/srv/CancelGoalRPC return codes.- Clock
Type - Type of clock to use for time queries
- Deadline
Action - 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 sched task 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.
- 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 Code - Goal status states – rclrs’s
GoalStatusCode. - 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. The ready set uses this to pick whichRankedFifoSet/BucketedEdfSetslot a callback dispatches through; later work maps it to OS priority. - QoSDurability
Policy - QoS durability policy
- QoSHistory
Policy - QoS history policy
- QoSLiveliness
Policy - QoS liveliness policy. Matches DDS
LIVELINESSsemantics. - QoSOverride
Role - Which side of a topic a
QoSOverridetargets. Mirrors the<role>segment of a ROS 2qos_overrides.<topic>.<role>.<policy>launch parameter. - QoSOverride
Value - 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 Deprecated - Deprecated: the store answers
Result<(), ParameterError>. 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 (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 - The other half of the seam, for the boards that now use it.
- Wall
Clock Source - Which source answers the wall clock (
WallClockState::source); the values ofNROS_WALL_CLOCK_SOURCE_*innros/platform.h.
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_EXECUTOR_SUBSCRIPTION_BUFFER_BYTES). - DOMAIN_
ID_ EXPLICIT_ ZERO_ C_ ABI - C/C++-ABI escape for an EXPLICIT domain 0.
- DOMAIN_
ID_ MAX - 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 (a drifted copy is a real bug class).
- EXECUTOR_
BACKING_ DEFAULT_ U64S - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task 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_
LEVELS - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. Levels one image can have:CONFIG_NROS_EXECUTOR_MAX_LEVELS’s upper end, one bit each in the check-in word. - 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 - 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 - 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.- REQUEST_
WRITER_ GUID_ SIZE - Width of
RequestId::writer_guid, in bytes. - SCHED_
TASK_ TCB_ U64S - Each spawned sched task’s TASK memory (stack + control block):
nros::main!emits oneSchedTaskMemorystatic per spawned sched task, sized from itsstack_bytes, and hands theSchedTaskMemorySetrows to a board whose sched task runner creates the task over them (FreeRTOSxTaskCreateStatic). The control-block region everySchedTaskMemorycarries, 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. - STORE_
SIZE_ DERIVED - When the store’s size is derived instead of stated. The second line of the
report; see
STORE_SIZE_KNOB. - STORE_
SIZE_ KNOB - The knob that sizes the parameter store, in every spelling a user writes.
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.
- Deserialize
- Trait for types that can be deserialized from CDR format
- Into
Node Options - rclrs’s
IntoNodeOptions: anything a node can be created from — a bare name ("talker") or a fullNodeOptions— soexecutor.create_node("talker")andexecutor.create_node("talker".namespace("/robot"))read as they do in rclrs. - Into
Primitive Options - rclrs’s
IntoPrimitiveOptions: anything an entity can be created from — a bare name or aPrimitiveOptions— with rclrs’s QoS steps chained onto it ("chatter".keep_last(10).reliable()). - LogSink
- Backend a log record is delivered to.
- Parameter
Variant - Trait for types that can be used as typed parameters
- 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
Functions§
- action_
channel_ type - The per-channel DDS type name for a RAW-registered action server.
- arena_
size_ for - 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_BYTES. 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_
sched_ task_ executor_ backing - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). The ONE refusal every board’srun_sched_tasksmakes before it opens anything:n_sched_taskssched tasks run, one on the boot executor, son_sched_tasks - 1must each find a slot. Checked up front rather than at each spawn, so a short block never leaves a half-spawned sched task chain. - every_
level_ alive - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. Whether every level of the image has checked in since the lasttake_every_level_alivethat returnedtrue. - fully_
qualified_ name - 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. 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.
- level_
count - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. How many levels the image runs. - level_
last_ spin_ us - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. The low 32 bits of the executor clock, in microseconds, atlevel’s latest spin;Nonewhen it has not spun (or spins with no clock). - level_
spins - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. How many timeslevelhas spun. - register_
logger - Publish
loggerunder its name so subsequentget_loggercalls with that name return THIS reference. - sched_
task_ level - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated.sched_task_level_byover a slice of priorities. - sched_
task_ level_ by - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. The level of sched taskindexof an image whosensched tasks have the kernel prioritiespriority_of(0..n): its urgency order, 0 the most urgent, equal priorities in array order. For now a level is a sched task, so this is how a runner places each sched task’s executor (Executor::set_level).nros codegen entrywritesNROS_ENTRY_LEVEL_OF_<node>by the same rule, over the same array.Nonewhenindexis out of range. - set_
level_ count - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. State how many levels the image runs (its runner does, once, before the levels spin).false, and nothing changed, for 0 or more thanMAX_LEVELS. An image that never states it has one level. - take_
every_ level_ alive - Which level an executor is, and whether every
level of the image is alive: what a supervisor that owns a route per level
or feeds a watchdog reads, and what a board’s sched task runner states (the level
count, and each sched task’s level by
sched_task_level_by). Plain atomics in nros-node, so ungated. The watchdog feed:truewhen every level has checked in since the lasttrue, and the check-ins are then cleared;false, and nothing cleared, while any level has not. - wall_
clock_ state - The wall clock’s state from the linked port, or
Nonewhen this build has no port to ask (noplatform-clock), the same condition under whichClock::systemfalls back to its counter.
Type Aliases§
- Cancel
Return Code Deprecated - The former name of
CancelResponseCode. - Defer
Notify - The notifier
Executor::set_defer_notifierinstalls: called with the host’s context and theHandleIdof a deferred callback that has just been queued. - GoalId
Deprecated - The former name of
GoalUuid. - Goal
Status Deprecated - The former name of
GoalStatusCode. - Lifecycle
Callback Fn - Lifecycle callback function pointer (
no_stdcompatible). - Next
Deadline Fn - The other half of the seam, for the boards that now use it.
- OnSet
Parameter Fn - An on-set-parameters callback.
- 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.
- Sched
Task Executor Backing Slot - The spawned sched tasks’ executor backing.
nros::main!emits oneSchedTaskExecutorBackingstatic per sched-task entry and hands its slots to the board’srun_sched_tasks, which refuses a short block throughcheck_sched_task_executor_backingand opens each spawned sched task withExecutor::open_with_session_slot. Gated like the module it names (has_rmw+allocin nros-node). One spawned sched task executor’s backing: exactly the words an executor opened withExecutorSizing::DEFAULTcarves. - 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. - Timer
Callback Fn - Timer callback as a bare function pointer (
no_std, no heap required). - Undeclared
Parameters Deprecated - The former name of
Parameters.