zerodds_spatial_dds/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3//! SpatialDDS 1.6 profile for ZeroDDS.
4//!
5//! Crate `zerodds-spatial-dds`. Safety classification: **STANDARD**.
6//!
7//! The SpatialDDS types are **generated at build time**, not hand-written.
8//! The input is the vendored `idl/spatial_core.idl`, derived from
9//! [OpenArCloud SpatialDDS](https://github.com/OpenArCloud/SpatialDDS-spec) 1.6,
10//! with modules combined and identifier corrections recorded in its header.
11//! It is **not verbatim upstream IDL**: renamed members affect Complete
12//! TypeObjects and can affect name-derived mutable member IDs. Compatibility
13//! with an unmodified upstream-generated peer must not be assumed from the
14//! profile name alone.
15//!
16//! The build script generates inherent encode/decode methods using
17//! `zerodds-wire`. It selects little-endian XCDR2 framing per aggregate's
18//! extensibility annotation: plain for final, delimited for appendable and
19//! parameter-list for mutable. This is local type and codec generation, not
20//! an independent cross-vendor interoperability certification.
21//!
22//! Modules carried:
23//! * `spatial::common` — `FrameRef`, `MetaKV`, `AssetRef`, `TileKey`, the
24//! `Vec3`/`Mat*`/`QuaternionXYZW`/`BBox2D` aliases,
25//! `CovarianceType`/`CoordConvention`.
26//! * `spatial::core` — `PoseSE3`, `Aabb3`, `FramedPose`, `GeoPose`,
27//! `FrameTransform`, the `CovMatrix` union; `builtin::Time`.
28//! * `spatial::disco` — **spatial discovery**: `Announce`, `Capabilities`,
29//! `CoverageElement`, `TopicMeta`, `ServiceKind`, `Transform`, `Depart`.
30//! * `spatial::anchors` — **geo-anchored registries** (the federated
31//! shared-world-model core): `AnchorEntry`, `AnchorSet`, `AnchorDelta`.
32//! * `spatial::sensing::common` — the sensing base (StreamMeta/FrameHeader/ROI/
33//! Codec/ROIRequest/ROIReply/...).
34//! * `spatial::sensing::vision` — vision (CamIntrinsics/Keypoint2D/Track2D/
35//! VisionDetections).
36//! * `spatial::sensing::lidar` — LiDAR (`LidarMeta`/`LidarFrame`/
37//! `LidarDetectionSet`).
38//! * `spatial::sensing::rad` — radar (`RadSensorMeta`/`RadDetectionSet`/
39//! `RadTensorFrame`).
40//! * `spatial::semantics` — 2-D/3-D detections (`Detection2D(Set)`/
41//! `Detection3D(Set)`).
42//! * `spatial::slam_frontend` — SLAM front-end (`Feature2D`/`KeyframeFeatures`/
43//! `MatchSet`/`Landmark`/`Tracklet`).
44//! * `spatial::vio` — visual-inertial odometry (`ImuInfo`/`ImuSample`/
45//! `SensorFusionSample`/`FusedState`).
46//! * `spatial::argeo` — geo-referenced pose graph (`NodeGeo`).
47//!
48//! ## Carriers
49//!
50//! This crate supplies a type layer, not a running transport. Its generated
51//! inherent codecs do not establish automatic integration with every bridge
52//! or recorder. Those paths need their own adapter and end-to-end evidence.
53//! Semantic conversion between selected ROS 2 messages and SpatialDDS types
54//! is provided by the separate `zerodds-spatial-ros2` crate.
55
56#![forbid(unsafe_code)]
57// The generated SpatialDDS types keep IDL-native identifiers (SCREAMING_CASE
58// enum labels) and the build script adds shared codec imports; silence those
59// warnings for the codegen.
60#![allow(
61 missing_docs,
62 clippy::all,
63 clippy::pedantic,
64 unused_imports,
65 non_camel_case_types,
66 non_snake_case
67)]
68
69// The generated modules (`spatial`, `builtin`) use crate-relative paths, so
70// they are included at the crate root.
71include!(concat!(env!("OUT_DIR"), "/spatial_core.rs"));
72
73/// Builds a multi-operator SpatialDDS topic name: `sdds/<operator>/<kind>`.
74/// SpatialDDS namespaces topics per operator so federated fleets share a world
75/// model without colliding; `operator` is the operator/tenant id, `kind` the
76/// SpatialDDS message kind (e.g. `"GeoPose"`, `"FramedPose"`).
77#[must_use]
78pub fn topic(operator: &str, kind: &str) -> String {
79 format!("sdds/{operator}/{kind}")
80}