feat(social): speech volume auto-adjuster (Issue #289) #293

Merged
sl-jetson merged 1 commits from sl-jetson/issue-289-volume-adjust into main 2026-03-02 21:05:28 -05:00
Collaborator

Summary

  • Adds volume_adjust_node to saltybot_social
  • Subscribes /social/speech/energy (Float32 linear RMS [0..1] from vad_node)
  • Maps ambient energy → TTS volume via a 4-stage pipeline:
    1. Normalise energy into [0,1] using [noise_floor, noise_ceil]
    2. Power-curve shaping via curve_gamma (< 1 = concave/aggressive-low, 1 = linear, > 1 = convex)
    3. Lerp into [min_volume, max_volume] (defaults: 0.5 → 1.0)
    4. EMA smoothing with smoothing_alpha to prevent jarring volume jumps
  • Publishes std_msgs/Float32 on /saltybot/tts_volume at publish_rate Hz (default 5 Hz)
  • Holds last value when energy is stale (> stale_timeout_s)
  • All params configurable: min/max_volume, noise_floor/ceil, curve_gamma, smoothing_alpha, publish_rate, stale_timeout_s
  • 74/74 tests passing

Files

  • saltybot_social/volume_adjust_node.py — pure helpers + ROS node
  • config/volume_adjust_params.yaml — defaults
  • launch/volume_adjust.launch.py — launch with key args
  • test/test_volume_adjust.py — 74 tests
  • setup.pyvolume_adjust_node entry point added

Closes #289

## Summary - Adds `volume_adjust_node` to `saltybot_social` - Subscribes `/social/speech/energy` (Float32 linear RMS [0..1] from `vad_node`) - Maps ambient energy → TTS volume via a 4-stage pipeline: 1. **Normalise** energy into [0,1] using `[noise_floor, noise_ceil]` 2. **Power-curve** shaping via `curve_gamma` (< 1 = concave/aggressive-low, 1 = linear, > 1 = convex) 3. **Lerp** into `[min_volume, max_volume]` (defaults: 0.5 → 1.0) 4. **EMA smoothing** with `smoothing_alpha` to prevent jarring volume jumps - Publishes `std_msgs/Float32` on `/saltybot/tts_volume` at `publish_rate` Hz (default 5 Hz) - Holds last value when energy is stale (> `stale_timeout_s`) - All params configurable: `min/max_volume`, `noise_floor/ceil`, `curve_gamma`, `smoothing_alpha`, `publish_rate`, `stale_timeout_s` - **74/74 tests passing** ## Files - `saltybot_social/volume_adjust_node.py` — pure helpers + ROS node - `config/volume_adjust_params.yaml` — defaults - `launch/volume_adjust.launch.py` — launch with key args - `test/test_volume_adjust.py` — 74 tests - `setup.py` — `volume_adjust_node` entry point added Closes #289
sl-webui added 1 commit 2026-03-02 20:48:14 -05:00
feat(social): speech volume auto-adjuster — Issue #289
Some checks failed
social-bot integration tests / Lint (flake8 + pep257) (push) Failing after 9s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (push) Has been skipped
social-bot integration tests / Lint (flake8 + pep257) (pull_request) Failing after 8s
social-bot integration tests / Core integration tests (mock sensors, no GPU) (pull_request) Has been skipped
social-bot integration tests / Latency profiling (GPU, Orin) (push) Has been cancelled
social-bot integration tests / Latency profiling (GPU, Orin) (pull_request) Has been cancelled
e8b787a987
Adds volume_adjust_node to saltybot_social:
- Subscribes /social/speech/energy (Float32 linear RMS [0..1] from vad_node)
- Maps energy to TTS volume via:
    1. Normalise into [noise_floor, noise_ceil]
    2. Power-curve shaping (curve_gamma; <1 concave, 1 linear, >1 convex)
    3. Lerp to [min_volume, max_volume]
    4. Exponential moving-average smoothing (smoothing_alpha)
- Publishes Float32 on /saltybot/tts_volume at publish_rate Hz (default 5 Hz)
- Holds last value when energy is stale (> stale_timeout_s)
- All params exposed: min/max_volume, noise_floor/ceil, curve_gamma,
  smoothing_alpha, publish_rate, stale_timeout_s
- 74/74 tests passing

Closes #289
sl-jetson merged commit b087af4b94 into main 2026-03-02 21:05:28 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#293
No description provided.