Skip to content

Whistle detection#775

Merged
texhnolyze merged 28 commits intomainfrom
feature/whistle_detection_clean
Mar 13, 2026
Merged

Whistle detection#775
texhnolyze merged 28 commits intomainfrom
feature/whistle_detection_clean

Conversation

@texhnolyze
Copy link
Copy Markdown
Contributor

@texhnolyze texhnolyze commented Mar 12, 2026

Summary

In the coming RoboCup competitions, we get extra time if we can detected whistles.
That is why we use ffts where we look at energy in frequencies used by whistles.

The detection is propagated to the body blackboard and integrated into the dsd.
The needed audio common ros packages are put into a subrepo.
The behavior has been tested in sim and on the robot and the whistle detection on my machine.
image

Proposed changes

  • create a WhistleDetectedDecision
  • add a whistle callback and a whistle detected method to a capsule ( maybe the game status capsule?)
  • initialize the whistle detected callback in the body behavior
  • Put the whistle detection software into a ros node

It is not arm compatible rn, but that is a future problem.
This is because we need pipewire and the path where it is found is for x86.

Related issues

Solves #753

Checklist

  • Run pixi run build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@texhnolyze texhnolyze self-assigned this Mar 12, 2026
@github-project-automation github-project-automation Bot moved this to 🆕 New in Software Mar 12, 2026
@texhnolyze texhnolyze requested review from Flova, jaagut and val-ba March 12, 2026 13:07
Comment thread src/bitbots_behavior/bitbots_body_behavior/package.xml
@github-project-automation github-project-automation Bot moved this from 🆕 New to 👀 In review in Software Mar 12, 2026
@texhnolyze texhnolyze force-pushed the feature/whistle_detection_clean branch 2 times, most recently from 39e5324 to adb1721 Compare March 12, 2026 13:46
@texhnolyze texhnolyze marked this pull request as ready for review March 12, 2026 13:49
@texhnolyze texhnolyze force-pushed the feature/whistle_detection_clean branch 2 times, most recently from 1a198e5 to 5bdbdba Compare March 12, 2026 19:48
@texhnolyze texhnolyze mentioned this pull request Mar 12, 2026
6 tasks
@texhnolyze texhnolyze changed the title Feature/whistle detection clean Whistle detection Mar 12, 2026
Comment thread src/bitbots_misc/bitbots_bringup/launch/teamplayer.launch Outdated
self.audio_buffer = np.concatenate([self.audio_buffer, audio_np])

if len(self.audio_buffer) > self.chunk_size:
self.audio_buffer = self.audio_buffer[-self.chunk_size :]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a possibility of cutting of "unheard" valuable sound?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats an example of that?

val-ba and others added 5 commits March 13, 2026 11:51
for the package index of `colcon-ros`
which happends, when switching from `STATE_SET` to `STATE_PLAYING` by
whistle, but the GameController only delivers the `STATE_PLAYING` after
the whistle detection "cooldown".
@texhnolyze texhnolyze force-pushed the feature/whistle_detection_clean branch 2 times, most recently from d293420 to f07da46 Compare March 13, 2026 16:37
jaagut and others added 4 commits March 13, 2026 17:41
to potentially allow logic based on that timestamp in other components
and allow overwriting the `sample_rate` when running `audio.launch`,
as not all driver/device setups allow for the default `sample_rate`
of 16000.
In a future step we should adapt the `whistle_detector` to support
different `sample_rate`s.
@texhnolyze texhnolyze force-pushed the feature/whistle_detection_clean branch from f07da46 to d2800f8 Compare March 13, 2026 16:41
@texhnolyze texhnolyze merged commit 887e904 into main Mar 13, 2026
1 of 2 checks passed
@texhnolyze texhnolyze deleted the feature/whistle_detection_clean branch March 13, 2026 16:45
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Software Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants