module documentation

The graph facet: what is on the ROS2 graph, learned by polling because rclpy has no change event.

The facet reads only while a watch is registered and stops when the last one closes. A Machine whose Bindings all declare their types never polls: their publisher presence comes from DDS match events (~opensmi.ros2.runtime.subscription.Subscription.publisher_count). The poll serves Bindings with no declared type, which cannot create a subscription.

A watch receives a delta against what it last saw, so a consumer that skipped polls gets one delta covering all of them. Nothing here imports rclpy; the Runtime hands the facet its read.

Class GraphDelta What changed on the graph between two snapshots, one entry per vocabulary.
Class GraphFacet What is on the ROS2 graph, read on a timer while anything is watching (see Runtime.graph).
Class GraphSnapshot Everything on the ROS2 graph at one moment, by name and by the types on that name.
Class GraphWatch One consumer's view of the graph, from GraphFacet.watch. Close it so the poll can stop.
Class NameDelta What changed in one of the graph's three vocabularies.
Function diff Return what changed between two snapshots (pure, so a watch can compute its delta late).
Constant EMPTY_GRAPH The graph before anything has been read: what a new watch diffs its first delta against.
Constant POLL_INTERVAL Seconds between graph reads while anything is watching (each read walks every endpoint).
Function _name_delta Return what changed in one vocabulary between two snapshots.
Constant _LOGGER Undocumented
Constant _NAMES The three graph vocabularies, which diff identically and are listed once here.
def diff(previous: GraphSnapshot, current: GraphSnapshot) -> GraphDelta:

Return what changed between two snapshots (pure, so a watch can compute its delta late).

EMPTY_GRAPH =

The graph before anything has been read: what a new watch diffs its first delta against.

Value
GraphSnapshot()
POLL_INTERVAL: float =

Seconds between graph reads while anything is watching (each read walks every endpoint).

Value
5.0
def _name_delta(previous: Mapping[str, tuple[str, ...]], current: Mapping[str, tuple[str, ...]]) -> NameDelta:

Return what changed in one vocabulary between two snapshots.

_LOGGER =

Undocumented

Value
structlog.get_logger('opensmi.ros2.runtime.graph')
_NAMES: tuple[str, ...] =

The three graph vocabularies, which diff identically and are listed once here.

Value
('topics', 'services', 'actions')