Commit ·
0d8fe98
1
Parent(s): afdb99d
debug: 添加说话动画的调试日志
Browse files
reachy_mini_ha_voice/motion.py
CHANGED
|
@@ -155,6 +155,7 @@ class ReachyMiniMotion:
|
|
| 155 |
Non-blocking: command sent to MovementManager.
|
| 156 |
"""
|
| 157 |
if self._movement_manager is None:
|
|
|
|
| 158 |
return
|
| 159 |
|
| 160 |
self._is_speaking = True
|
|
@@ -167,7 +168,7 @@ class ReachyMiniMotion:
|
|
| 167 |
duration=0.3,
|
| 168 |
)
|
| 169 |
self._movement_manager.queue_action(action)
|
| 170 |
-
_LOGGER.
|
| 171 |
|
| 172 |
def on_speaking_end(self):
|
| 173 |
"""Called when TTS ends - stop speech-reactive motion.
|
|
|
|
| 155 |
Non-blocking: command sent to MovementManager.
|
| 156 |
"""
|
| 157 |
if self._movement_manager is None:
|
| 158 |
+
_LOGGER.warning("MovementManager not initialized, skipping speaking animation")
|
| 159 |
return
|
| 160 |
|
| 161 |
self._is_speaking = True
|
|
|
|
| 168 |
duration=0.3,
|
| 169 |
)
|
| 170 |
self._movement_manager.queue_action(action)
|
| 171 |
+
_LOGGER.info("Reachy Mini: Speaking animation queued")
|
| 172 |
|
| 173 |
def on_speaking_end(self):
|
| 174 |
"""Called when TTS ends - stop speech-reactive motion.
|
reachy_mini_ha_voice/satellite.py
CHANGED
|
@@ -158,6 +158,7 @@ class VoiceSatelliteProtocol(APIServer):
|
|
| 158 |
|
| 159 |
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_TTS_START:
|
| 160 |
# Reachy Mini: Start speaking animation
|
|
|
|
| 161 |
self._reachy_on_speaking()
|
| 162 |
|
| 163 |
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_TTS_END:
|
|
@@ -706,12 +707,19 @@ class VoiceSatelliteProtocol(APIServer):
|
|
| 706 |
except Exception as e:
|
| 707 |
_LOGGER.debug("Failed to pause face tracking: %s", e)
|
| 708 |
|
| 709 |
-
if not self.state.motion_enabled
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 710 |
return
|
|
|
|
| 711 |
try:
|
| 712 |
-
_LOGGER.
|
| 713 |
-
|
| 714 |
-
self.state.motion.on_speaking_start()
|
| 715 |
except Exception as e:
|
| 716 |
_LOGGER.error("Reachy Mini motion error: %s", e)
|
| 717 |
|
|
|
|
| 158 |
|
| 159 |
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_TTS_START:
|
| 160 |
# Reachy Mini: Start speaking animation
|
| 161 |
+
_LOGGER.info("TTS_START event received, triggering speaking animation")
|
| 162 |
self._reachy_on_speaking()
|
| 163 |
|
| 164 |
elif event_type == VoiceAssistantEventType.VOICE_ASSISTANT_TTS_END:
|
|
|
|
| 707 |
except Exception as e:
|
| 708 |
_LOGGER.debug("Failed to pause face tracking: %s", e)
|
| 709 |
|
| 710 |
+
if not self.state.motion_enabled:
|
| 711 |
+
_LOGGER.warning("Motion disabled, skipping speaking animation")
|
| 712 |
+
return
|
| 713 |
+
if not self.state.reachy_mini:
|
| 714 |
+
_LOGGER.warning("No reachy_mini instance, skipping speaking animation")
|
| 715 |
+
return
|
| 716 |
+
if not self.state.motion:
|
| 717 |
+
_LOGGER.warning("No motion controller, skipping speaking animation")
|
| 718 |
return
|
| 719 |
+
|
| 720 |
try:
|
| 721 |
+
_LOGGER.info("Reachy Mini: Starting speaking animation")
|
| 722 |
+
self.state.motion.on_speaking_start()
|
|
|
|
| 723 |
except Exception as e:
|
| 724 |
_LOGGER.error("Reachy Mini motion error: %s", e)
|
| 725 |
|