From f17bec16c6312580a1e780ceb7d9c636f0cd22de Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 18 Jan 2024 13:39:15 +0100 Subject: [PATCH] Add device mappings for /dev/dri and /dev/snd Install additional dependencies for image processing Add ros2_whisper repository --- docker-compose.yaml | 14 ++++++++++++++ docker/Dockerfile | 2 +- overlay.repos | 5 +++++ pyaudiotest.py | 12 ++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 pyaudiotest.py diff --git a/docker-compose.yaml b/docker-compose.yaml index d9d43b8..255087a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -68,6 +68,9 @@ services: - linux/amd64 command: | /bin/bash + devices: + - /dev/dri:/dev/dri + - /dev/snd:/dev/snd # Robot State Publisher robot_state_publisher: extends: overlay @@ -134,6 +137,17 @@ services: devices: - /dev/dri:/dev/dri + whisper: + extends: overlay + command: > + ros2 launch whisper_bringup bringup.launch.py n_thread:=20 + #privileged: true + devices: + - /dev/dri:/dev/dri + # - /dev/snd/controlC0:/dev/snd/controlC0 #/dev/snd:/dev/snd + privileged: true + restart: unless-stopped + ################################################################################################################################### # Webgui Supervision via Foxglove Studio # ################################################################################################################################### diff --git a/docker/Dockerfile b/docker/Dockerfile index 2225a88..419d83b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -61,7 +61,7 @@ WORKDIR /overlay_ws RUN source /bot_mini_ws/install/setup.bash \ && apt-get update \ - && apt-get install -y ros-${ROS_DISTRO}-image-transport ros-${ROS_DISTRO}-cv-bridge \ + && apt-get install -y ros-${ROS_DISTRO}-image-transport ros-${ROS_DISTRO}-cv-bridge wget python3-pyaudio python3-pynput python3-pip \ && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo\ && rm -rf /var/lib/apt/lists/* diff --git a/overlay.repos b/overlay.repos index 5e3d78f..c7179fe 100644 --- a/overlay.repos +++ b/overlay.repos @@ -18,3 +18,8 @@ repositories: type: git url: https://github.com/bjoernellens1/cps_loki_bringup version: main + + ros2_whisper: + type: git + url: https://github.com/ros-ai/ros2_whisper + version: main \ No newline at end of file diff --git a/pyaudiotest.py b/pyaudiotest.py new file mode 100644 index 0000000..0a8d34b --- /dev/null +++ b/pyaudiotest.py @@ -0,0 +1,12 @@ +# pyaudio test bluetooth headset + +import pyaudio + +p = pyaudio.PyAudio() + +for i in range(p.get_device_count()): + if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0: + print(p.get_device_info_by_index(i)) + +p.terminate() +