class documentation

class TFBinding(AwaitedBinding):

View In Hierarchy

The TF tree, rendered as RSL Locations inside the SpatialObject of whatever owns them.

The second keyed Binding: one ROS2 path, many OPC UA objects, membership taken from the messages. It is not a KeyedBinding because a frame is a SpatialLocationType Variable in a folder OPC 10000-210 names, with a Base pointing at another Location, and a companion specification does not belong in the generic mechanism. Named for its ROS2 side.

One declaration per object, and its content is one frame name. The declaring machinery item gains a SpatialObject whose PositionFrame is head, and every frame under that head belongs to it, down to the next declared head. A Machine declares one for itself and so does a Component; the Machine's mirror runs the whole partition.

Where TF is read from and how often are facts about the Machine, declared once in ROS2Config.transforms. The keywords path, static_path, depth, interval and quiet_after stay here only so that writing one is refused with a message saying where it went.

Method __post_init__ Refuse a contradictory declaration.
Class Variable kind Undocumented
Instance Variable alternatives The composed poses this object publishes, each a (base, frame) pair. Each becomes a Location in AlternativeFrames holding where frame sits in base (OPC 10000-210, section 6.1.1). Declared, since nothing in a frame tree says which compositions are wanted.
Instance Variable depth Machine-wide; refused here.
Instance Variable exclude fnmatch globs over whole frame ids that are not rendered. A frame removed from the middle of a chain re-bases its children onto the nearest surviving ancestor.
Instance Variable head The one frame this object is. It becomes the SpatialObject's mandatory PositionFrame; ownership of everything else follows from the tree.
Instance Variable interval Machine-wide; refused here.
Instance Variable name The Binding's name, used in BindingEvents and the mutation cap. It is not a prefix on any browse name: a frame's raw child_frame_id is the DisplayName and a sanitised form the BrowseName.
Instance Variable path Machine-wide; refused here.
Instance Variable publishes The frames this object puts on the frame network instead of reading, each a PublishedFrame. None may also be read inward (FrameDirectionError). A declaration that publishes nothing never advertises /tf...
Instance Variable quiet_after Machine-wide; refused here.
Instance Variable required Whether the StartupSkill waits for a publisher on a transform topic before Running. Presence only, never a particular frame.
Instance Variable startup_timeout Seconds that wait lasts, or None for ~opensmi.ros2.server.config.ROS2Config.startup_timeout.
Instance Variable static_path Machine-wide; refused here.
Property broadcasts Return whether this declaration puts anything on the frame network.
Property needs_the_graph Return False: both topics carry tf2_msgs/msg/TFMessage and the frames are content.
Property published_frames Return the frames this declaration publishes.
Method _require_a_composable_pair Refuse an alternative that is not two different, non-empty frame names.
Method _require_a_publishable_pair Refuse a published frame that is not a transform.
Method _require_nothing_the_machine_decides Refuse a value that belongs to the whole Machine.
Method _require_publishable_frames Refuse outward frames that contradict each other or the declaration.
def __post_init__(self):

Refuse a contradictory declaration.

Raises
DeclarationErrorWhen it names no head frame, excludes its own head, declares an alternative that is not a pair of two different frames, or publishes a frame that names no pair, is its own parent, is declared twice or is one of its own exclusions.
FrameDirectionErrorWhen it publishes its own head frame, which is read inward.
DeclarationErrorWhen it declares where TF is read from or how often it is polled.
RequiredDeclarationErrorWhen startup_timeout is declared without required, or is not positive.
kind: ClassVar[str] =

Undocumented

alternatives: tuple[tuple[str, str], ...] =

The composed poses this object publishes, each a (base, frame) pair. Each becomes a Location in AlternativeFrames holding where frame sits in base (OPC 10000-210, section 6.1.1). Declared, since nothing in a frame tree says which compositions are wanted.

depth: int | None =

Machine-wide; refused here.

exclude: tuple[str, ...] =

fnmatch globs over whole frame ids that are not rendered. A frame removed from the middle of a chain re-bases its children onto the nearest surviving ancestor.

head: str =

The one frame this object is. It becomes the SpatialObject's mandatory PositionFrame; ownership of everything else follows from the tree.

interval: float | None =

Machine-wide; refused here.

name =

The Binding's name, used in BindingEvents and the mutation cap. It is not a prefix on any browse name: a frame's raw child_frame_id is the DisplayName and a sanitised form the BrowseName.

path: str | None =

Machine-wide; refused here.

publishes: tuple[PublishedFrame, ...] =

The frames this object puts on the frame network instead of reading, each a PublishedFrame. None may also be read inward (FrameDirectionError). A declaration that publishes nothing never advertises /tf.

quiet_after: float | None =

Machine-wide; refused here.

required =

Whether the StartupSkill waits for a publisher on a transform topic before Running. Presence only, never a particular frame.

startup_timeout =

Seconds that wait lasts, or None for ~opensmi.ros2.server.config.ROS2Config.startup_timeout.

static_path: str | None =

Machine-wide; refused here.

@property
broadcasts: bool =

Return whether this declaration puts anything on the frame network.

A Machine that publishes no frame must not appear on /tf as a publisher, since every TF Binding reads that presence as a transform source being up.

@property
needs_the_graph: bool =

Return False: both topics carry tf2_msgs/msg/TFMessage and the frames are content.

@property
published_frames: frozenset[str] =

Return the frames this declaration publishes.

def _require_a_composable_pair(self, alternative: tuple[str, str]):

Refuse an alternative that is not two different, non-empty frame names.

Raises
DeclarationErrorWhen the pair is invalid.
def _require_a_publishable_pair(self, published: PublishedFrame):

Refuse a published frame that is not a transform.

Raises
DeclarationErrorWhen either name is empty, or the two are one frame.
def _require_nothing_the_machine_decides(self):

Refuse a value that belongs to the whole Machine.

Raises
DeclarationErrorWhen any of the five Machine-wide keywords carries a value.
def _require_publishable_frames(self):

Refuse outward frames that contradict each other or the declaration.

Raises
DeclarationErrorWhen a published frame names no pair, is its own parent, is declared twice, or is excluded by this declaration.
FrameDirectionErrorWhen a published frame is this object's own head.