diff --git a/cyclonedds.xml b/cyclonedds.xml new file mode 100644 index 0000000..d22795c --- /dev/null +++ b/cyclonedds.xml @@ -0,0 +1,18 @@ + + + + + + + + false + + + + + + + auto + + + diff --git a/pixi.toml b/pixi.toml index 1aeca5c..e7def26 100644 --- a/pixi.toml +++ b/pixi.toml @@ -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 ." @@ -36,4 +41,5 @@ numpy = "*" [target.win-64.dependencies] python-devtools = "*" -python = "*" \ No newline at end of file +python = "*" + diff --git a/setup_ros_tailscale.sh b/setup_ros_tailscale.sh new file mode 100755 index 0000000..12ce77c --- /dev/null +++ b/setup_ros_tailscale.sh @@ -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"