-
Notifications
You must be signed in to change notification settings - Fork 275
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 plugin #1608
Acoustic comms plugin #1608
Conversation
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Codecov Report
@@ 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
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]>
…sender Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
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.
At a high level, the code looks good to me and I like the strategy for deciding when to keep the message, drop it or deliver it.
My only suggestion is to try to remove the need for the transmitter to populate the message with its own pose. I think it would be way more elegant if that's something that the plugin can do automatically for us. We have access to the ECM and the entity ID of the sender, so it should be possible.
Signed-off-by: Aditya <[email protected]>
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. |
} | ||
} | ||
else | ||
{ |
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.
I think there's a situation that isn't covered here: If source and destination are initially at a distance > maxRange
but the destination is moving closer to the sender (in the direction of the message). If I'm not wrong, you'll discard the message instantly but you're not accounting that potentially the destination might be within range eventually while the message is traveling.
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.
I am actually, distanceToTransmitter
is the distance between :
- Position of sender when the message was sent, (this is constant throughout the lifetime of the message)
- Current position of the destination. This is when the plugin is spinning, so always contains the current position of destination. So even if the destination has just moved towards the source, that distance should be reflected accurately.
I could add a test for this situation if needed.
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.
You're right, the key is to use distanceCoveredByMessage
to decide when to drop the message and not distanceToTransmitter
as I originally thought you were using.
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
Removed the This PR can either be merged into |
@osrf-jenkins retest this please |
I don't think the failures in CI are related to the changes made here. |
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
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.
LGTM barring minor comments
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
* Added acoustic comms plugin Signed-off-by: Aditya <[email protected]>
* Added acoustic comms plugin Signed-off-by: Aditya <[email protected]>
* Added acoustic comms plugin Signed-off-by: Aditya <[email protected]>
* Added acoustic comms plugin Signed-off-by: Aditya <[email protected]>
* Acoustic comms plugin (#1608) * Acoustic comms example world (#1693) Signed-off-by: Aditya <[email protected]>
* Added acoustic comms plugin Signed-off-by: Aditya <[email protected]> Signed-off-by: Arjo Chakravarty <[email protected]>
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 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
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
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.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸