class documentation

class ROS2IntrospectionComponent(ROS2ComponentMixin, BaseComponent):

Constructor: ROS2IntrospectionComponent(*args, **kwargs)

View In Hierarchy

The Component every Machine with a Runtime carries, and the ad-hoc Bindings it holds.

It declares no Bindings of its own, so its Monitoring is empty at boot and fills with whatever an operator binds through BindTopic. A Machine may replace it through ~opensmi.ros2.server.machine.ROS2MachineMixin.introspection_component_type.

Method __init__ Start out holding no ad-hoc Bindings and nothing sampled.
Async Method bind_ad_hoc Bind one topic on behalf of an operator, and remember that it was theirs.
Method binding_reports Return one report row per Binding on this Machine, sampling the clock as it goes.
Method recent_events Return the BindingEvents this Machine has kept, oldest first.
Property ad_hoc_bindings Return the names of the Bindings an operator created, rather than a deployment.
Property machine Return the Machine this Component reports for, which is the one it hangs under.
Async Method _init Build the mirror with no Bindings, add the nine Methods, then start sampling.
Async Method _sample Sample every Binding's satisfaction on a slow timer. A failure is logged and the loop continues.
Async Method _shutdown Stop sampling, then let the Component release its ad-hoc subscriptions.
Async Method _write_identification Identify this Component as part of the Machine: its manufacturer, and its serial with the asset id.
Instance Variable _ad_hoc Undocumented
Instance Variable _clock Undocumented
Instance Variable _resolved_bindings Undocumented
Instance Variable _sampler Undocumented
def __init__(self, *args: Any, **kwargs: Any):

Start out holding no ad-hoc Bindings and nothing sampled.

async def bind_ad_hoc(self, binding: MonitoringBinding) -> bool:

Bind one topic on behalf of an operator, and remember that it was theirs.

Returns
boolWhether it happened; False means a mutation cap refused the nodes.
Raises
DuplicateBindingNameErrorWhen the name is taken on this Component.
ROS2RuntimeErrorWhen the type cannot be resolved or the subscription cannot be opened.
def binding_reports(self) -> tuple[BindingReport, ...]:

Return one report row per Binding on this Machine, sampling the clock as it goes.

def recent_events(self) -> tuple[BindingEventRecord, ...]:

Return the BindingEvents this Machine has kept, oldest first.

@property
ad_hoc_bindings: frozenset[str] =

Return the names of the Bindings an operator created, rather than a deployment.

@property
machine: Any =

Return the Machine this Component reports for, which is the one it hangs under.

@override
async def _init(self):

Build the mirror with no Bindings, add the nine Methods, then start sampling.

The empty mirror still gives the Component its Runtime and Projection registry, which an ad-hoc bind needs. Nothing is subscribed yet.

async def _sample(self):

Sample every Binding's satisfaction on a slow timer. A failure is logged and the loop continues.

@override
async def _shutdown(self):

Stop sampling, then let the Component release its ad-hoc subscriptions.

async def _write_identification(self):

Identify this Component as part of the Machine: its manufacturer, and its serial with the asset id.

_ad_hoc: set[str] =

Undocumented

_clock =

Undocumented

_resolved_bindings =

Undocumented

_sampler: asyncio.Task[None] | None =

Undocumented