module documentation

One Component per Machine that answers what is on the ROS2 graph and what this adapter is bound to.

Every Machine with a Runtime gets this Component, on by default. It carries nine Methods:

  • ListTopics, ListServices and ListActions: what is on the ROS2 graph, with an optional substring filter. The graph is refreshed once per call, not polled.
  • ListROS2Parameters: the ROS2 parameters one node declares.
  • DescribeROS2Parameter: type, description, constraints and flags of one such parameter.
  • ListBindings: every Binding on this Machine: kind, ROS2 path, required or not, satisfied or not, how long it has been waiting, and its QoS provenance.
  • ListRecentEvents: the last N BindingEvents this Machine fired.
  • BindTopic: bind a topic to look at it. Ephemeral: the nodes hang under this Component's own Monitoring and live until the server restarts.
  • CallService: call a service once. Request and response are JSON in the Method's own ParameterSet and FinalResultData, so no nodes are created.

The seven read-only Methods answer at the listing level with the Machine's Lock bypassed, and their arguments are writable the same way. The two mutators need the Lock and a higher level. No Method waits for startup to complete, so a Machine whose startup hangs can still be inspected. Every Method browses for every authenticated user, and a client without the access level is refused on use. Ad-hoc Bindings go through ~opensmi.ros2.server.mirror.ROS2InwardMirrorMixin.bind_topic_now, so they are capped and counted like any other mutation. There is no ad-hoc goal sending: an action worth driving is worth declaring.

Class BindingReport One Binding, as the provenance report answers for it.
Class BindTopic Bind a ROS2 topic to this Component's Monitoring, ephemerally, to look at it.
Class CallService Call one ROS2 service once, ad hoc, without creating any nodes.
Class DescribeROS2Parameter What one ROS2 node says about one of its parameters (type, description, constraints, flags).
Class ListActions Every action on the ROS2 graph, with its types.
Class ListBindings Every Binding on this Machine, with its provenance and its state.
Class ListRecentEvents The last N BindingEvents this Machine fired, oldest first.
Class ListROS2Parameters Every ROS2 parameter one node declares, in the order the node declared them.
Class ListServices Every service on the ROS2 graph, with its types.
Class ListTopics Every topic on the ROS2 graph, with the types advertised on it.
Class ROS2GraphListing One of the ROS2 graph's three vocabularies, narrowed by a substring.
Class ROS2IntrospectionComponent The Component every Machine with a Runtime carries, and the ad-hoc Bindings it holds.
Class ROS2ListingMethod A read-only Method answering with a list of lines, at the listing level and without the Lock.
Class ROS2MutatorMethod A Method that changes something, and therefore needs the Lock as well as a level.
Class WaitingClock When each Binding last stopped being Satisfied.
Function machinery_items Yield a Machine and every Component under it, depth first, in the order they were added.
Function qos_entries_of Return every provenance entry one machinery item can answer for, by Binding name.
Function reports_of Return one report row per Binding one machinery item declares.
Function waiting_key Return how the clock files one Binding: the item's path, and the Binding's name.
Constant INTROSPECTION_ID The Component's asset id, which it writes into its identification.
Constant INTROSPECTION_NAME What the Component browses as. It is the same on every Machine.
Function _as_json Return one response's values as JSON, keyed by the flat field paths a request uses.
Function _initials Yield the value each variable of a Projection's plan would have been created holding.
Function _matching Return one graph vocabulary as sorted lines, narrowed by a substring.
Function _path_of Return the ROS2 path a report row names; for the TF Binding, the Machine's two TF topics.
Function _utc_now Return the wall clock, in UTC.
Constant _AD_HOC_DEPTH How many messages an ad-hoc subscription buffers (a declared Binding buffers ten).
Constant _COUNT How many lines _ENTRIES carries, so a client can branch without reading them.
Constant _ENTRIES The array of lines every Method here answers with.
def machinery_items(machine: Any) -> Iterator[Any]:

Yield a Machine and every Component under it, depth first, in the order they were added.

def qos_entries_of(machinery_item: Any) -> Mapping[str, BindingQoS]:

Return every provenance entry one machinery item can answer for, by Binding name.

The sources are a Monitoring Binding's subscription, a Keyed Binding's subscription, and a publishing Binding's publisher (which hangs on its Skill). An item that is not one of ours contributes nothing. The TF Binding is absent, as opensmi.ros2.server.provenance says: its endpoints belong to the Machine.

def reports_of(machinery_item: Any, clock: WaitingClock) -> tuple[BindingReport, ...]:

Return one report row per Binding one machinery item declares.

Presence is probed with ~opensmi.ros2.server.required.satisfaction_of, the same cascade the StartupSkill waits on, so the report and the StartupSkill cannot disagree.

def waiting_key(machinery_item: Any, binding: str) -> tuple[str, str]:

Return how the clock files one Binding: the item's path, and the Binding's name.

INTROSPECTION_ID: str =

The Component's asset id, which it writes into its identification.

Value
'ros2_introspection'
INTROSPECTION_NAME: str =

What the Component browses as. It is the same on every Machine.

Value
'ROS2Introspection'
def _as_json(values: Mapping[str, object]) -> str:

Return one response's values as JSON, keyed by the flat field paths a request uses.

Values that are not JSON types (a bytes payload above all) are rendered with str.

def _initials(plan: Sequence[PlanEntry], prefix: str = '') -> Iterator[tuple[str, object]]:

Yield the value each variable of a Projection's plan would have been created holding.

A declared Method's Parameters start from these values, so an ad-hoc request that names only some fields sends the same message a declared Method would.

def _matching(names: Mapping[str, tuple[str, ...]], wanted: str) -> list[str]:

Return one graph vocabulary as sorted lines, narrowed by a substring.

def _path_of(machinery_item: Any, binding: Any) -> str:

Return the ROS2 path a report row names; for the TF Binding, the Machine's two TF topics.

def _utc_now() -> dt.datetime:

Return the wall clock, in UTC.

_AD_HOC_DEPTH: int =

How many messages an ad-hoc subscription buffers (a declared Binding buffers ten).

Value
1
_COUNT: str =

How many lines _ENTRIES carries, so a client can branch without reading them.

Value
'Count'
_ENTRIES: str =

The array of lines every Method here answers with.

Value
'Entries'