Skip to content

Commit

Permalink
fixed executor in launch
Browse files Browse the repository at this point in the history
  • Loading branch information
mhubii committed Jul 1, 2024
1 parent 1428e2e commit 373a549
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog for package ROS 2 Whisper
1.3.1 (2024-07-01)
------------------
* `whisper_msgs`: Changed to `whisper_idl` package
* `whisper_bringup`: Changed executor to `MultiThreadedExecutor` so audio and inference can run in parallel on `whisper_server`

1.3.0 (2024-06-21)
------------------
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ Action server under topic `inference` of type [Inference.action](whisper_idl/act

## Troubleshoot
- Encoder inference time: https://github.com/ggerganov/whisper.cpp/issues/10#issuecomment-1302462960
- Compile with GPU support (might differ between platforms): https://github.com/ggerganov/whisper.cpp#nvidia-gpu-support-via-cublas WHISPER_CUBLAS=On
26 changes: 16 additions & 10 deletions whisper_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
from launch_ros.actions import ComposableNodeContainer, Node
from launch_ros.descriptions import ComposableNode


def generate_launch_description() -> LaunchDescription:
Expand All @@ -21,17 +22,22 @@ def generate_launch_description() -> LaunchDescription:
whisper_config = os.path.join(
get_package_share_directory("whisper_server"), "config", "whisper.yaml"
)
composable_node = ComposableNode(
package="whisper_server",
plugin="whisper::InferenceComponent",
name="inference",
namespace="whisper",
parameters=[whisper_config],
remappings=[("audio", "/audio_listener/audio")],
)
ld.add_action(
Node(
package="whisper_server",
executable="whisper",
ComposableNodeContainer(
name="whisper_container",
package="rclcpp_components",
namespace="",
executable="component_container_mt", # require multi-threaded executor so inference server can parallelize audio encueing and inference
output="screen",
namespace="whisper",
parameters=[whisper_config],
remappings=[
("/whisper/audio", "/audio_listener/audio"),
],
composable_node_descriptions=[composable_node],
)
)

return ld

0 comments on commit 373a549

Please sign in to comment.