-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from bit-bots/feature/audio_launch_file
Add audio launch file
- Loading branch information
Showing
5 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### How to record audio to ROS Bag | ||
|
||
Launch these commands in parallel: | ||
|
||
```bash | ||
ros2 launch bitbots_utils audio.launch | ||
ros2 bag record /audio/audio /audio/audio_info | ||
``` | ||
|
||
### How to play audio from ROS Bag | ||
|
||
Launch these commands in parallel: | ||
|
||
```bash | ||
ros2 bag play <bagfile> --loop | ||
ros2 launch audio_play play.launch.xml format:=wave sample_rate:=10000 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<arg name="sim" default="false" description="If true, we don't capture audio" /> | ||
<arg name="dst" default="appsink"/> | ||
<arg name="device" default=""/> | ||
<arg name="format" default="wave"/> | ||
<arg name="bitrate" default="128"/> | ||
<arg name="channels" default="1"/> | ||
<arg name="depth" default="16"/> | ||
<arg name="sample_rate" default="10000"/> | ||
<arg name="sample_format" default="S16LE"/> | ||
<arg name="ns" default="audio"/> | ||
<arg name="audio_topic" default="audio" /> | ||
|
||
<group unless="$(var sim)"> | ||
<include file="$(find-pkg-share audio_capture)/launch/capture.launch.xml"> | ||
<arg name="dst" value="$(var dst)"/> | ||
<arg name="device" value="$(var device)"/> | ||
<arg name="format" value="$(var format)"/> | ||
<arg name="bitrate" value="$(var bitrate)"/> | ||
<arg name="channels" value="$(var channels)"/> | ||
<arg name="depth" value="$(var depth)"/> | ||
<arg name="sample_rate" value="$(var sample_rate)"/> | ||
<arg name="sample_format" value="$(var sample_format)"/> | ||
<arg name="ns" value="$(var ns)"/> | ||
<arg name="audio_topic" value="$(var audio_topic)"/> | ||
</include> | ||
</group> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<include file="$(find-pkg-share system_monitor)/launch/system_monitor.launch"> | ||
<arg name="required" value="false" /> | ||
</include> | ||
<arg name="monitoring" default="true" description="true: start system monitor and udp bridge" /> | ||
|
||
<include file="$(find-pkg-share udp_bridge)/launch/send.launch" /> | ||
<group if="$(var monitoring)"> | ||
<include file="$(find-pkg-share system_monitor)/launch/system_monitor.launch"> | ||
<arg name="required" value="false" /> | ||
</include> | ||
|
||
<include file="$(find-pkg-share udp_bridge)/launch/send.launch" /> | ||
</group> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters