Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python3 ArmarX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
Python3 ArmarX
Commits
7dfe6a66
Commit
7dfe6a66
authored
6 months ago
by
Timo Birr
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into feature/asynchronous-skills
parents
43174910
dc3a810f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#21307
passed
6 months ago
Stage: setup-venv
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
armarx_speech/memory_stop_listener.py
+31
-6
31 additions, 6 deletions
armarx_speech/memory_stop_listener.py
with
31 additions
and
6 deletions
armarx_speech/memory_stop_listener.py
+
31
−
6
View file @
7dfe6a66
...
...
@@ -11,6 +11,7 @@ from armarx_memory.segments.TextToSpeech import TextToSpeechWriter
from
armarx_speech.stop_hook
import
StopHook
import
Ice
class
MemoryStopListener
:
"""
...
...
@@ -64,8 +65,20 @@ class MemoryStopListener:
def
fetch_updates
(
self
,
updated_ids
:
ty
.
List
[
"
MemoryID
"
]):
updated_ids
=
[
updated_id
for
updated_id
in
updated_ids
if
"
/text/
"
in
str
(
updated_id
)]
snapshots_dict
=
self
.
stt_reader
.
reader
.
query_snapshots
(
updated_ids
)
updated_ids
=
[
updated_id
for
updated_id
in
updated_ids
if
updated_id
.
entity_name
==
"
text
"
]
try
:
snapshots_dict
=
self
.
stt_reader
.
reader
.
query_snapshots
(
updated_ids
)
except
Ice
.
ConnectionRefusedException
as
e
:
self
.
log
.
warning
(
"
Reconnecting SpeechToTextReader ...
"
)
self
.
stt_reader
=
SpeechToTextReader
.
from_mns
(
self
.
mns
)
try
:
snapshots_dict
=
self
.
stt_reader
.
reader
.
query_snapshots
(
updated_ids
)
self
.
log
.
info
(
"
SpeechToTextReader is OK.
"
)
except
Ice
.
ConnectionRefusedException
as
e
:
# Give up
self
.
log
.
warning
(
"
Failed to reconnect SpeechToTextReader.
"
)
return
for
snapshot
in
snapshots_dict
.
values
():
data
=
SpeechToText
.
from_aron_ice
(
snapshot
.
instances
[
0
].
data
)
for
command
in
self
.
STOP_COMMANDS
:
...
...
@@ -75,10 +88,22 @@ class MemoryStopListener:
break
def
say_stop
(
self
):
self
.
tts_writer
.
commit
(
entity_id
=
self
.
tts_writer
.
make_entity_name
(
self
.
name
),
text
=
"
stopping
"
,
)
try
:
self
.
tts_writer
.
commit
(
entity_id
=
self
.
tts_writer
.
make_entity_name
(
self
.
name
),
text
=
"
stopping
"
,
)
except
Ice
.
ConnectionRefusedException
as
e
:
self
.
mns
=
MemoryNameSystem
.
wait_for_mns
(
logger
=
self
.
log
)
self
.
tts_writer
=
TextToSpeechWriter
.
from_mns
(
self
.
mns
)
try
:
self
.
tts_writer
.
commit
(
entity_id
=
self
.
tts_writer
.
make_entity_name
(
self
.
name
),
text
=
"
stopping
"
,
)
except
Ice
.
ConnectionRefusedException
as
e
:
self
.
log
.
warning
(
"
Failed to reconnect SpeechToTextReader.
"
)
return
def
send_stop
(
self
):
t_total_start
=
time
.
time
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment