Skip to content
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

Sanchitgarg/audio sensor #1646

Merged
merged 29 commits into from
Jun 9, 2022
Merged

Sanchitgarg/audio sensor #1646

merged 29 commits into from
Jun 9, 2022

Conversation

sanchitgarg
Copy link
Contributor

@sanchitgarg sanchitgarg commented Feb 2, 2022

Motivation and Context

With this change, we give our awesome virtual agents the ability to hear. This enables new research avenues like Audio-Visual navigation.

We are adding a new git-submodule : rlr-audio-propagation.
This git repo hosts the header and binaries for Meta RL Research's audio propagation engine. A new AudioSensor C++ class is added that calls into this new lib. The C++ AudioSensor class is exposed to python via the existing pybindings.

Further, we are adding a new build flag : --audio.
This is an optional flag. Any user who wants to use the audio sensor will have to build with this flag.

Please see the examples/tutorials/audio_agent.py script for a tutorial on how to use it.
Also, please refer to docs/AUDIO.md which goes into more details about the feature.

How Has This Been Tested

The code was tested locally using the C++ viewer. A new audio_agent.py script has been added as well to test the change. Further, we tested the integration with the SoundSpaces team. They were able to generate impulse response in they navigation system.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 2, 2022
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

Thanks for creating this PR, @sanchitgarg. Just a quick pass with some easy clean-up. Will return with a more thorough review.

.gitmodules Outdated Show resolved Hide resolved
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

Did a proof pass over the README. Thanks for the documentation, this is great!

docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated

The C++ Audio sensor class uses the [RLRAudioPropagation](https://github.com/facebookresearch/rlr-audio-propagation) library. This is a bi-directional ray tracer based audio simulator. Given a source location, listener location, mesh, audio materials and some parameters will simulate how audio waves travel from the source to the listener. The output of the library is an impulse response for the given setup.

The C++ implementation is exposed for python user via py-bindings. This document explains the various python apis, structs and enums.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: once this is live on aihabitat.org, we can point directly to the AudioSensor class docs, tutorial Colab, or other resources too.

Suggested change
The C++ implementation is exposed for python user via py-bindings. This document explains the various python apis, structs and enums.
The C++ implementation is exposed for python users via pybind11. This document explains the various python APIs, structs, and enums. Also see the relevant [Habitat-sim python API](https://aihabitat.org/docs/habitat-sim/classes.html) doc pages.

docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
docs/AUDIO.md Outdated Show resolved Hide resolved
@sanchitgarg sanchitgarg marked this pull request as ready for review April 1, 2022 21:22
@sanchitgarg sanchitgarg force-pushed the sanchitgarg/audio-sensor branch 2 times, most recently from 3cc312b to 0411007 Compare April 6, 2022 00:47
@sanchitgarg sanchitgarg force-pushed the sanchitgarg/audio-sensor branch 4 times, most recently from ede0a0e to 131ba4d Compare April 15, 2022 22:59
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

Looks good overall.

A few documentation comments and I didn't test the viewer changes (CI won't either), so please double check viewer with and without the audio build.

Once those are resolved and the CI is green I think we can merge. 🎉

src/esp/bindings/SensorBindings.cpp Show resolved Hide resolved
src/esp/sensor/AudioSensor.h Outdated Show resolved Hide resolved
src_python/habitat_sim/simulator.py Outdated Show resolved Hide resolved
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

When tests pass, good to merge!

@sanchitgarg sanchitgarg merged commit a2bbd5b into main Jun 9, 2022
@sanchitgarg sanchitgarg deleted the sanchitgarg/audio-sensor branch June 9, 2022 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants