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

Acoustic comms : Propagation model #1793

Merged
merged 9 commits into from
Nov 17, 2022

Conversation

adityapande-1995
Copy link
Contributor

@adityapande-1995 adityapande-1995 commented Nov 11, 2022

🎉 New feature

Summary

This PR adds a propagation model for acoustic comms, using RFComms implementation as a guide. The difference is in the way signal loss is calculated and modulation is implemented.

Here, we use the sonar equation to calculate signal to noise ratio (SNR). SNR is used to calculate Eb/N0, which gives us the bit error rate using BPSK modulation. FInally we calculate the packet drop probability.

This feaure is turned off by default and oly works if the SDF tags are used when declaring the plugin.

A short comparison of propagation model approaches :

  • Acoustic comms propagation model (This PR) :
    SNR using sonar equation -> Eb/N0 -> bit error rate (BPSK) -> packetDropProbability
  • RFComms propagation model (Taken as a reference) :
    Log path loss equation -> bit error rate (QPSK) -> packetDropProbability

Test it

Added a test with a world file acoustic_comms_propagation.sdf. It is impossible to get the packets to drop with the default values and the LRAUvs being that close to each other (< 5 m). Moving them apart would make the tests run a lot slower.

I've exaggerated the noise and source power to make the packets drop.

Note

This is still an experimental feature, and I'm no expert in communications. If there is a better model for propagation, I'd be happy to improve this.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸

Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
@osrf-triage osrf-triage added this to Inbox in Core development Nov 11, 2022
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Nov 11, 2022
@azeey azeey moved this from Inbox to In progress in Core development Nov 11, 2022
Comment on lines +164 to +165
sdf::ElementPtr propElement = _sdf->Clone()->
GetElement("propagation_model");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open to suggestions on how cloning can be avoided here. GetElement cannot be applied to const Element members it seems, and _sdf->GetElement("foo") throws an error that " this argument discards qualifiers."

Copy link
Contributor

@arjo129 arjo129 Nov 15, 2022

Choose a reason for hiding this comment

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

Typically, I use GetFirstElement and then iterate. It's not ideal and very counter intuitive that a Get* method is non-const. You don't have to do this. I don't see this clone as very expensive.

Signed-off-by: Aditya <aditya050995@gmail.com>
@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Merging #1793 (5d8e097) into gz-sim7 (8ba08a8) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           gz-sim7    #1793      +/-   ##
===========================================
+ Coverage    64.24%   64.27%   +0.03%     
===========================================
  Files          336      336              
  Lines        26900    26924      +24     
===========================================
+ Hits         17282    17306      +24     
  Misses        9618     9618              
Impacted Files Coverage Δ
src/systems/acoustic_comms/AcousticComms.cc 96.22% <100.00%> (+1.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Aditya <aditya050995@gmail.com>
Signed-off-by: Aditya <aditya050995@gmail.com>
@adityapande-1995 adityapande-1995 marked this pull request as ready for review November 14, 2022 21:22
@adityapande-1995 adityapande-1995 mentioned this pull request Nov 14, 2022
38 tasks
@arjo129 arjo129 added the MBARI-LRAUV Sponsored by MBARI-LRAUV project: https://github.com/osrf/lrauv label Nov 15, 2022
Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

Just did a quick pass. Couple of small knits.

Comment on lines +164 to +165
sdf::ElementPtr propElement = _sdf->Clone()->
GetElement("propagation_model");
Copy link
Contributor

@arjo129 arjo129 Nov 15, 2022

Choose a reason for hiding this comment

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

Typically, I use GetFirstElement and then iterate. It's not ideal and very counter intuitive that a Get* method is non-const. You don't have to do this. I don't see this clone as very expensive.

src/systems/acoustic_comms/AcousticComms.cc Show resolved Hide resolved
src/systems/acoustic_comms/AcousticComms.cc Outdated Show resolved Hide resolved
src/systems/acoustic_comms/AcousticComms.cc Outdated Show resolved Hide resolved
Signed-off-by: Aditya <aditya050995@gmail.com>
@azeey azeey moved this from In progress to In review in Core development Nov 16, 2022
Signed-off-by: Aditya <aditya050995@gmail.com>
Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

One more tiny issue. After that it looks like its good to go.

test/integration/acoustic_comms.cc Show resolved Hide resolved
Signed-off-by: Aditya <aditya050995@gmail.com>
Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

Lgtm. Test failures unrelated.

@adityapande-1995 adityapande-1995 merged commit 021ff49 into gz-sim7 Nov 17, 2022
Core development automation moved this from In review to Done Nov 17, 2022
@adityapande-1995 adityapande-1995 deleted the aditya/acoustic_comms_propagation branch November 17, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden MBARI-LRAUV Sponsored by MBARI-LRAUV project: https://github.com/osrf/lrauv
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants