speaker

speaker.py

Overview

speaker.py is the last-mile speech relay that takes high-level sentences from the cognitive layer and immediately forwards them to the TTS backend.

Interfaces (strongly-typed, stateless)

Direction

Topic

Semantics

Required

/{robot}/speaker_channel

High-level sentences from cognition

Provided

/{robot}/speaker_output

Identical text for TTS backends (latched)

Contract

Pre-conditions

  • Upstream publishes valid UTF-8 strings on the speaker channel.

Post-conditions

  • Each incoming message is republished exactly once on the output topic.

  • Late subscribers to the latched output still get the last sentence.

Implementation notes

  • Publisher uses latch=True and queue_size=10 to absorb bursts.

  • Callback logs every relayed sentence at INFO level.

  • No additional state is stored.

Classes

Speaker()

Thin ROS node that immediately forwards sentences to the output topic.