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 |
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 |
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 |
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.
Fill the header stamp, check the payload and put one message on the topic.
| Parameters | |
message:Message | The payload, as an instance of this publisher's message dataclass. |
| Raises | |
ROS2RuntimeError | When this handle's lifetime has already ended. |
TypeError | When the payload is not an instance of the type advertised. |
FieldTypeMismatchError | When a field holds a value of the wrong Python type. Refused here because rclpy aborts the process instead of raising. |
FieldValueOutOfRangeError | When a field is past its width or its declared bound. |
PublishFailedError | When rclpy refused to send it. |