gz-sim
gz-sim copied to clipboard
Acoustic comms plugin
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Summary
This plugin adds a simple acoustic comms plugin to gz-sim.
Test it
Added a small test case which contains 2 pairs of boxes which communicate with each other. One set in inside the max range of comms, and the other is outside it. The one outside the range should not receive any messages.
TODO
- The current calculation for
distanceToTransmitter
considers the current distance between the 2 bodies, when actually it should be the distance between current receiver position and position of the sender at the time at which the packet was sent, as the sender might be moving. This is not a big problem if the 2 bodies are at rest or moving slowly compared to speed of sound.
Since the packet does not contain a field related to position of sender at the time the packet was sent, I;m not sure how to implement this.
Checklist
- [x] Signed all commits for DCO
- [x] 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)
- [x]
codecheck
passed (See contributing) - [x] 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.
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
Codecov Report
Merging #1608 (96e9bea) into main (9d24893) will increase coverage by
0.06%
. The diff coverage is94.64%
.
:exclamation: Current head 96e9bea differs from pull request most recent head 6aceed4. Consider uploading reports for the commit 6aceed4 to get more accurate results
@@ Coverage Diff @@
## main #1608 +/- ##
==========================================
+ Coverage 63.57% 63.63% +0.06%
==========================================
Files 330 331 +1
Lines 25926 25981 +55
==========================================
+ Hits 16482 16534 +52
- Misses 9444 9447 +3
Impacted Files | Coverage Δ | |
---|---|---|
src/systems/acoustic_comms/AcousticComms.cc | 94.64% <94.64%> (ø) |
|
src/EntityComponentManager.cc | 90.86% <0.00%> (-0.02%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
As per offline discussion with @caguero , we decided that making the users specify the position of the sender in the header file is cumbersome. Instead, what I have now is : The plugin will keep track the position of sender when a msg is first processed, and use that for distance calculations throughout the life of the message.
This means the difference between actual position of the sender (when the msg was sent) and the one we use will only differ by one spin cycle of the plugin, which is still good.
Removed the Garden
label because we're past feature freeze ❄️ .
This PR can either be merged into main
and backported to gz-sim7
after the stable release, or retargeted to gz-sim7
and merged after the stable release (i.e. October).
@osrf-jenkins retest this please
I don't think the failures in CI are related to the changes made here.