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