Skip to content

Add Tailscale Network Support and Audio Capture Task #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cyclonedds.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config">
<Domain>
<General>
<Interfaces>
<NetworkInterface name="tailscale0" />
</Interfaces>
<AllowMulticast>false</AllowMulticast>
</General>
<Discovery>
<Peers>
<!-- On Device A, put Device B's Tailscale IP -->
<Peer address="100.96.130.58"/>
</Peers>
<ParticipantIndex>auto</ParticipantIndex>
</Discovery>
</Domain>
</CycloneDDS>
8 changes: 7 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ preview = ["pixi-build"]
[tasks]
build = "colcon build --packages-select audio_tools --cmake-args -DCMAKE_BUILD_TYPE=Release"

# Run the audio capture node and publish via tailscale
run_audio_capture_tailscale = { cmd = [
"./setup_ros_tailscale.sh", "ros2", "run", "audio_tools", "audio_capture_node", "--ros-args", "-p", "sample_rate:=16000", "-p", "channels:=1", "-p", "sample_format:=S16LE"
], depends-on = ["build"] }

[target.win-64.tasks]
vscode = "code ."

Expand Down Expand Up @@ -36,4 +41,5 @@ numpy = "*"

[target.win-64.dependencies]
python-devtools = "*"
python = "*"
python = "*"

16 changes: 16 additions & 0 deletions setup_ros_tailscale.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Set up the network and DDS environment variables for Tailscale
export CYCLONEDDS_URI=file://$PIXI_PROJECT_ROOT/cyclonedds.xml
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export ROS_NETWORK_INTERFACE=tailscale0
export ROS_IP=$(tailscale ip -4)
export ROS_DOMAIN_ID=0

# Source the ROS workspace
source install/setup.bash

# Execute the command passed as arguments
exec "$@"

echo "ROS2 environment configured for Tailscale communication"