class documentation

class _OutwardPublishing(_FrameFiling):

Constructor: _OutwardPublishing(*args, **kwargs)

View In Hierarchy

Puts the poses a client writes into declared Locations on the TF topics.

Method __init__ Start out with nothing refused, and pass every argument to opensmi.
Async Method _broadcast Put outward poses on the wire, and record what went out only once it has.
Async Method _broadcast_published Re-assert what every outward Location holds, in one message per topic.
Async Method _broadcast_written Put the pose a client wrote on the wire.
Async Method _open_published Create one declared outward frame's Location, writable, in AttachPoints.
Method _pose_written Return the callback one outward Location is created with. opensmi awaits it with the stored pose.
Async Method _rebase_published Re-resolve every outward Location's Base, the only part of it this module writes.
Async Method _report_broadcast_refused Say, as a BindingEvent, that the poses a client wrote did not reach ROS2.
Instance Variable _broadcast_lock Undocumented
Instance Variable _broadcast_refused Undocumented
def __init__(self, *args: Any, **kwargs: Any):

Start out with nothing refused, and pass every argument to opensmi.

async def _broadcast(self, staged: Sequence[tuple[_Published, Transform]]):

Put outward poses on the wire, and record what went out only once it has.

A refusal is reported as an event and never raised. An outward pose carries no status code, because the quiet conditions of ~opensmi.ros2.server.status are facts about a robot publishing to us. Serialised, because a client's write and the tick may both broadcast.

async def _broadcast_published(self):

Re-assert what every outward Location holds, in one message per topic.

A moving frame goes out every tick, because a pose published once ages out of listeners' buffers. A static frame goes out only when it differs from what last went out, which also retries a pose the middleware refused. That is why ~opensmi.ros2.runtime.tf.TFFacet.broadcast owns its publisher instead of using tf2_ros.StaticTransformBroadcaster. The pose is read back off the Location because it is the client's.

async def _broadcast_written(self, owner: _Owner, frame: str, pose: Pose):

Put the pose a client wrote on the wire.

The write is never refused for the broadcast: it is already stored, and a failed broadcast is a PUBLISH_FAILED BindingEvent that the next tick retries.

async def _open_published(self, owner: _Owner, declared: PublishedFrame):

Create one declared outward frame's Location, writable, in AttachPoints.

It is created at init and outside the chokepoint because it is declared. Access level and write check are set here, since a node cannot be re-shaped later. A client needs the Machine's Skill level (~opensmi.ros2.server.config.ROS2Config.skill_access_level), as for a publishing Skill, and the Lock. Base stays read-only. It starts at the World Frame and is re-resolved every tick, because the declared base frame may not be published yet.

def _pose_written(self, owner: _Owner, frame: str) -> Callable[[Pose], Awaitable[None]]:

Return the callback one outward Location is created with. opensmi awaits it with the stored pose.

async def _rebase_published(self, owner: _Owner, *, parents: Mapping[str, str]):

Re-resolve every outward Location's Base, the only part of it this module writes.

async def _report_broadcast_refused(self, sending: Sequence[FrameLink], error: Exception):

Say, as a BindingEvent, that the poses a client wrote did not reach ROS2.

Once per spell of failure; the streak clears on the first broadcast that goes out. It is reported on the Machine's own TF Binding, because one broadcast carries every object's frames. It uses ~opensmi.ros2.server.publisher.PUBLISH_FAILED, the code the publishing Skill reports for the same fact.

_broadcast_lock =

Undocumented

_broadcast_refused: bool =

Undocumented