pub trait Sensor: 'static {
const NAME: &'static str;
}Expand description
Type-level identifier for a sensor domain.
NAME simultaneously plays four roles:
- Registry key — the consumer-registry insert/lookup key so the bridge can fan out callbacks per sensor without a runtime string map.
- Env-var prefix — adapters derive
ISAAC_SIM_RS_DORA_<NAME>_*andISAAC_SIM_RS_RERUN_<NAME>_*variable names from it. - Log label — structured log lines use
S::NAMEso every sensor’s messages are grep-able by name. - Default dora id —
register_publisherdefaults both OUTPUT and the dora node id toS::NAMEwhen the env var is unset.
If a fifth use case arises that needs a value that differs from NAME
for any existing sensor, introduce a separate associated const or a
distinct trait rather than adding another load to this one. The existing
exception is CmdVelChannel: its publisher output defaults to
"cmd_vel_observed" (not S::NAME) via register_publisher_with_default
because role 4 conflicts with role 2 when the subscriber’s INPUT also
defaults to "cmd_vel".
Implemented by ZST markers in each sensor module (e.g. LidarFlatScan,
LidarPointCloud). Adapters layer their own per-sensor trait on top
(RerunRender, DoraPublish) keyed on these markers.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.