-
Notifications
You must be signed in to change notification settings - Fork 276
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
Add comms infrastructure #1416
Add comms infrastructure #1416
Conversation
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[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.
I've done a cursory review of this. Overall its looking pretty good. I spotted some places where we used std::map
instead of std::unordered_map
. Since this is targeting fortress and I believe we are using C++17 we should prefer unordered_map
unless we need the data sorted. One issue I have is with the Registry type. Currently its an alias of an std::map
however as I've listed this leads to two problems (1) fragile API/ABI since this is something end users implementing comms plugins will use making it difficult for us to change underlying implementation and (2) the user has to access and internal data type to figure out how to add a message to the outbound. I can make a PR targeting this PR with the relevant changes.
I think as we discussed before the comms model for acoustics will need the ability to be stepped at a different pace. That can be addressed in a future PR.
Thanks for the suggestions and the offer to help! They all sound pretty good. If you're doing the Registry transformation from an alias to its own class I can work in parallel in the changes to step at different frequency than physics. |
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Aguero <[email protected]>
One note would be that it appears that we could move the stuff that is in |
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
We talked about this offline. The derived plugins will need to include the |
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
All right, I think Windows CI is happy, which it was the last outstanding bit as far as I know. |
* | ||
*/ | ||
|
||
// Example: ./publisher addr1 |
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 this should be addr2
?
ign topic -e -t addr1/rx | ||
|
||
Try launching a comms publisher: | ||
./publisher addr1 |
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.
addr1
-> addr2
just have very minor comments. I think you can probably just do that in #1428 so we don't trigger another round of CI |
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.
looks good to me
This pull request has been mentioned on Gazebo Community. There might be relevant details there: https://community.gazebosim.org/t/new-releases-2022-04-27-fortress-citadel/1389/1 |
🎉 New feature
Requires
Summary
This PR adds some infrastructure for being able to create comms systems. A comms system lets you send and receive data under the constrains of a given comms model. The comms model specifies when and how messages should be delivered to its destinations.
Subscribers create a regular callback via Ignition Transport and send a request to a centralized broker to bind an address, the robot attached to the address and the topic name used as a callback. Publishers fill a
Dataframe
message specifying the addresses of the sender and destination and set the payload. Then, publishers need to send via Ignition Transport the message to the centralized broker.Besides the general infrastructure, this PR contains two systems:
PerfectComms
andCommsEndpoint
.PerfectComms
is an example of a comms system. As required, it implements theICommsModel
interface and it always delivers the messages to their destinations.CommsEndpoint
is a helper system that can be optionally attached to a model (seeexamples/worlds/comms.sdf
) and lets you assign an address to a robot and the subscription topic. The system automatically connects with the broker and bind this address/robot for you. You could do this process manually if needed but I think it's convenient for most of the users.Test it
You should observe messages on the subscriber terminal.
CC @arjo129
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.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸