From df985a8cbc80af4ae2c1a8908429b889bfd6dd81 Mon Sep 17 00:00:00 2001 From: Twirre Meulenbelt <43213592+TwirreM@users.noreply.github.com> Date: Wed, 15 Oct 2025 14:58:31 +0200 Subject: [PATCH] fix: log speech commands even when Pepper SDK is not connected Previously, the `_handle_speech` function had an early return when no Pepper session was available, causing incoming messages not to get logged. Now messages are logged even when there is no session with the Pepper SDK. ref: N25B-168 --- src/robot_interface/endpoints/actuation_receiver.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/robot_interface/endpoints/actuation_receiver.py b/src/robot_interface/endpoints/actuation_receiver.py index 722bdf1..79a38ef 100644 --- a/src/robot_interface/endpoints/actuation_receiver.py +++ b/src/robot_interface/endpoints/actuation_receiver.py @@ -44,17 +44,17 @@ class ActuationReceiver(ReceiverBase): return None def _handle_speech(self, message): - if not self._qi_session: return - - if not self._tts_service: - self._tts_service = self._qi_session.service("ALTextToSpeech") - text = message.get("data") if not text: logging.warn("Received message to speak, but it lacks data.") return - logging.debug("Speaking received message: {}".format(text)) + logging.debug("Received message to speak: {}".format(text)) + + if not self._qi_session: return + + if not self._tts_service: + self._tts_service = self._qi_session.service("ALTextToSpeech") self._tts_service.say(text)