-
Notifications
You must be signed in to change notification settings - Fork 266
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
Conversation
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
sdf::ElementPtr propElement = _sdf->Clone()-> | ||
GetElement("propagation_model"); |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
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 <[email protected]>
Codecov Report
@@ 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
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 <[email protected]>
Signed-off-by: Aditya <[email protected]>
There was a problem hiding this 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.
sdf::ElementPtr propElement = _sdf->Clone()-> | ||
GetElement("propagation_model"); |
There was a problem hiding this comment.
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 <[email protected]>
Signed-off-by: Aditya <[email protected]>
There was a problem hiding this 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.
Signed-off-by: Aditya <[email protected]>
There was a problem hiding this 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.
🎉 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 :
SNR using sonar equation
->Eb/N0
->bit error rate (BPSK)
->packetDropProbability
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
codecheck
passed (See contributing)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.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸