raccoon_transport.transport =========================== .. py:module:: raccoon_transport.transport .. autoapi-nested-parse:: Python transport wrapper around LCM with reliable and retained delivery helpers. Attributes ---------- .. autoapisummary:: raccoon_transport.transport.logger Classes ------- .. autoapisummary:: raccoon_transport.transport.Transport Module Contents --------------- .. py:data:: logger .. py:class:: Transport(provider: str = '') Main Python transport wrapper used by robotics applications and tests. .. py:method:: create(provider: str = '') -> Transport :classmethod: Construct a transport, optionally using an explicit LCM provider URL. .. py:method:: publish(channel: str, message, *, reliable: bool = False, retained: bool = False, retry_interval_ms: int = 100, max_retries: int = 10) Publish an encoded LCM message with optional reliable and retained delivery. :param channel: Destination channel name. :param message: LCM message instance with an ``encode()`` method. :param reliable: When ``True``, wrap the payload in ``envelope_t`` and retransmit until acknowledged or retry attempts are exhausted. :param retained: When ``True``, cache the encoded payload so it can be replayed to future subscribers that request retained state. :param retry_interval_ms: Delay between retransmissions in reliable mode. :param max_retries: Maximum number of send attempts in reliable mode. .. py:method:: subscribe(channel: str, handler, *, reliable: bool = False, request_retained: bool = False) Subscribe to a channel, optionally enabling reliable mode or retained replay. :param channel: Channel to subscribe to. :param handler: Callback passed to LCM for incoming payloads. :param reliable: When ``True``, subscribe to the internal reliable channel, acknowledge envelopes, deduplicate retransmissions, and forward the decoded payload to ``handler``. :param request_retained: When ``True``, request any retained payload after the subscription is established. :returns: The subscription handle returned by ``lcm.LCM.subscribe``. .. py:method:: spin_once(timeout_ms: int = 100) -> int Handle at most one pending LCM event and service reliable retries. .. py:method:: spin() Block forever handling LCM traffic and reliable retransmissions. .. py:method:: close() Unsubscribe all active handlers owned by this transport instance.