Skip to content

Commit

Permalink
feat: reparametrize asr launch in hri bringup
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejmajek committed Sep 7, 2024
1 parent da13b88 commit 9e3f8b6
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions src/rai_bringup/launch/hri.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,39 @@ def include_tts_launch(context, *args, **kwargs):
]


def include_asr_launch(context, *args, **kwargs):
asr_vendor = LaunchConfiguration("asr_vendor").perform(context)
if asr_vendor == "openai":
launch_file = "openai.launch.py"
else:
launch_file = "local.launch.py"

return [
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("rai_asr"), f"/launch/{launch_file}"]
)
)
]


def generate_launch_description():
tts_vendor_arg = DeclareLaunchArgument(
"tts_vendor",
default_value="elevenlabs",
description="TTS vendor to use (opentts or elevenlabs)",
)

asr_vendor_arg = DeclareLaunchArgument(
"asr_vendor",
default_value="local",
description="ASR vendor to use (openai or whisper)",
)
robot_description_package_arg = DeclareLaunchArgument(
"robot_description_package",
default_value="rosbot_xl_whoami",
description="Robot description package to use",
)

asr_node = Node(
package="rai_asr",
executable="asr_node",
name="asr_node",
output="screen",
parameters=[
{
"recording_device": LaunchConfiguration("recording_device", default=0),
"use_wake_word": LaunchConfiguration("use_wake_word", default=False),
"wake_word_treshold": LaunchConfiguration(
"wake_word_treshold", default=0.1
),
"wake_word_model": LaunchConfiguration("wake_word_model", default=""),
"vad_treshold": LaunchConfiguration("vad_treshold", default=0.5),
"silence_grace_period": LaunchConfiguration(
"silence_grace_period", default=1.0
),
}
],
)

hmi_node = Node(
package="rai_hmi",
executable="hmi_node",
Expand All @@ -90,6 +89,7 @@ def generate_launch_description():
)

tts_launch_inclusion = OpaqueFunction(function=include_tts_launch)
asr_launch_inclusion = OpaqueFunction(function=include_asr_launch)

whoami_node = Node(
package="rai_whoami",
Expand All @@ -107,11 +107,12 @@ def generate_launch_description():

return LaunchDescription(
[
tts_vendor_arg,
robot_description_package_arg,
asr_node,
hmi_node,
tts_vendor_arg,
asr_vendor_arg,
tts_launch_inclusion,
asr_launch_inclusion,
whoami_node,
hmi_node,
]
)

0 comments on commit 9e3f8b6

Please sign in to comment.