class documentation

A live publisher on one ROS2 topic, from ~opensmi.ros2.runtime.runtime.Runtime.advertise.

Method __init__ Bind a handle to the clock, the send step and the teardown the Runtime prepared.
Method __repr__ Return a representation naming the topic and the ROS2 type.
Async Method close End this publisher, releasing its ROS2 endpoint. Idempotent.
Async Method publish Fill the header stamp, check the payload and put one message on the topic.
Property closed Return whether this publisher's lifetime has ended.
Property message_type Return the message dataclass every payload handed to this publisher must be.
Property published Return how many sends did not raise (ROS2 gives no acknowledgement, so not messages delivered).
Property qos Return the QoS profile this publisher offers (fixed once advertised).
Property qos_provenance Return where that profile came from: DECLARED or DEFAULTED, never discovered.
Property topic Return the ROS2 topic this publisher is on.
Instance Variable _clock Undocumented
Instance Variable _closed Undocumented
Instance Variable _message_type Undocumented
Instance Variable _provenance Undocumented
Instance Variable _published Undocumented
Instance Variable _qos Undocumented
Instance Variable _release Undocumented
Instance Variable _send Undocumented
Instance Variable _topic Undocumented
def __init__(self, *, topic: str, message_type: type[Message], clock: Callable[[], tuple[int, int]], send: Callable[[Message], Awaitable[None]], release: Callable[[], Awaitable[None]], qos: QoSProfile = DEFAULT_PROFILE, provenance: Provenance = Provenance.DEFAULTED):

Bind a handle to the clock, the send step and the teardown the Runtime prepared.

def __repr__(self) -> str:

Return a representation naming the topic and the ROS2 type.

async def close(self):

End this publisher, releasing its ROS2 endpoint. Idempotent.

async def publish(self, message: Message):

Fill the header stamp, check the payload and put one message on the topic.

Parameters
message:MessageThe payload, as an instance of this publisher's message dataclass.
Raises
ROS2RuntimeErrorWhen this handle's lifetime has already ended.
TypeErrorWhen the payload is not an instance of the type advertised.
FieldTypeMismatchErrorWhen a field holds a value of the wrong Python type. Refused here because rclpy aborts the process instead of raising.
FieldValueOutOfRangeErrorWhen a field is past its width or its declared bound.
PublishFailedErrorWhen rclpy refused to send it.
@property
closed: bool =

Return whether this publisher's lifetime has ended.

@property
message_type: type[Message] =

Return the message dataclass every payload handed to this publisher must be.

@property
published: int =

Return how many sends did not raise (ROS2 gives no acknowledgement, so not messages delivered).

@property
qos: QoSProfile =

Return the QoS profile this publisher offers (fixed once advertised).

@property
qos_provenance: Provenance =

Return where that profile came from: DECLARED or DEFAULTED, never discovered.

@property
topic: str =

Return the ROS2 topic this publisher is on.

_clock =

Undocumented

_closed: bool =

Undocumented

_message_type =

Undocumented

_provenance =

Undocumented

_published: int =

Undocumented

_qos =

Undocumented

_release =

Undocumented

_send =

Undocumented

_topic =

Undocumented