pub struct DeployOverlay {
pub locator: Option<&'static str>,
pub net: Option<&'static str>,
pub domain_id: Option<u32>,
pub transport: Option<LinkKind>,
pub rmw: Option<&'static str>,
pub node_name: Option<&'static str>,
pub boot_config: Option<&'static BakedBootConfig>,
}Expand description
Deploy-metadata overlay threaded from nros::main!() into the board’s
boot config (issue #48 cause 1).
The nros::main!() macro reads the Entry pkg’s
[package.metadata.nros.deploy.<board>] block at expansion time and bakes
the present keys here. Each field is None when the deploy block omitted
it, so the board overlays only the supplied values onto its own
Config::default() (the firmware’s compiled-in default stays the source of
truth for everything the deploy block does not name).
Boards whose BoardEntry::run ignores network/locator config (POSIX hosts,
RTIC/Embassy MCUs that take their transport elsewhere) inherit the default
BoardEntry::run_with_deploy body, which drops the overlay and calls
BoardEntry::run — so adding a network field here never touches those
boards. The exception is node_name: hosted
boards override run_with_deploy to apply it to the boot config (issue #98),
since the ROS graph node name is a launch identity, not a network knob.
Fields§
§locator: Option<&'static str>locator = "tcp/10.0.2.2:7451" — the zenoh/RMW endpoint the firmware
dials. None → keep the board default.
net: Option<&'static str>The image’s resolved network (RFC-0103 D10f, phase-497 W2): the
NROS_IMAGE_NET text nros sync rendered from [image.<id>.net.<if>],
[network.<name>] and the board’s [board.net], baked verbatim.
None → the image states no interface; keep the board default. Decoded
by nros_board_common::image_net — this crate carries it, it does not
read it.
It replaced three fields (ip, gateway, netmask) that nros::main!
lowered from system.toml itself: the macro has no board catalog, so it
could not take a board’s default network or derive a MAC, and one fact
would have resolved two ways.
domain_id: Option<u32>domain_id = 0 — ROS 2 domain. None → keep the board default.
transport: Option<LinkKind>[image.<id>] transport = "serial" — the LINK kind the image rides
(RFC-0086 D2). None → the board’s default link. Read by
BoardEntry::setup_transport (phase-244.D1), which may install a
board custom transport for it BEFORE the linked RMW registers.
Typed, not a string (issue 1601): phase-445 W6 moved the leaf key from
the RMW name ("xrce") to the link kind ("serial"), and the one
board reading it kept comparing against "xrce" — a comparison that
could no longer be true and compiled anyway. A LinkKind cannot be
compared against an RMW name.
rmw: Option<&'static str>rmw = "xrce" — the RMW backend the image declares ([image.<id>] rmw > [image_defaults] rmw > [system] rmw), verbatim. None → not
declared (a Form 2 entry, or a leaf with no system.toml).
The BACKEND choice, which transport is not: an
XRCE image over a UART states both, and a board that registers a
backend keys on this field (issue 1601).
node_name: Option<&'static str>The ROS graph node name for the primary session, baked from the launch
file’s single <node name=…> / system.toml [[component]].name (issue
#98). None → the board default (from_env()’s "node"). Only set by
nros::main! when the launch declares exactly one node — multiple nodes
share one primary session, so naming it after one component would be
wrong (per-node naming is the deferred multi-node piece). Applied to the
boot ExecutorConfig by the board, so unlike locator this IS honored on
hosted boards (locator stays env-driven; node name is a launch identity).
boot_config: Option<&'static BakedBootConfig>Issue #101 / RFC-0045 — the patchable baked boot-config static
(.nros_boot_config), emitted by nros::main! for embedded targets and
read by the board to resolve node_name/locator/domain. None on hosted /
when the macro emits no static.
Implementations§
Trait Implementations§
Source§impl Clone for DeployOverlay
impl Clone for DeployOverlay
Source§fn clone(&self) -> DeployOverlay
fn clone(&self) -> DeployOverlay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more