-
Notifications
You must be signed in to change notification settings - Fork 13
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
Adding acoustic subsystem examples #236
Conversation
Signed-off-by: Marco A. Gutierrez <[email protected]>
cb | ||
); | ||
|
||
while(true) { sleep(1); } |
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.
@marcoag IIRC there's a waitForShutdown
API in gz::transport
.
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.
Good point, added.
int address = 1; | ||
gz::transport::Node node; | ||
gz::transport::Node::Publisher transmitter; |
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.
@marcoag perhaps we move these to the main
function below? IIRC gz::transport
allows for lambdas as subscription callbacks.
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.
Moved the node
declaration as is not used in cb
. However, I think it's a good idea to keep the example as simple as possible therefore avoid the use of a lambda?
// The data | ||
msg.set_data("test_message"); | ||
client.SendPacket(msg); | ||
|
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.
@marcoag nit: unnecessary blank line.
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.
Removed.
|
||
int main(int _argc, char **_argv) | ||
{ | ||
|
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.
@marcoag nit: unnecessary blank line.
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.
Removed.
Signed-off-by: Marco A. Gutierrez <[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 but for one last comment
msg.set_type(AcousticMsg::MessageType::LRAUVAcousticMessage_MessageType_Other); | ||
// The data | ||
msg.set_data("test_message"); | ||
client.SendPacket(msg); |
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.
@marcoag hmm, isn't the service response racing with process shutdown?
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.
tbh, I'm not sure... but could be? I mostly copied whatever was there on the documentation example before.
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.
@marcoag could we wait for the response to arrive before exiting?
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.
Sure, just added a sender and a receiver for extra clarity and some more verbosity to the example.
Signed-off-by: Marco A. Gutierrez <[email protected]>
Signed-off-by: Marco A. Gutierrez <[email protected]>
Adding the acoustic subsystem examples as suggest in #224 (comment).
The related documentation is hosted in the wiki.
Signed-off-by: Marco A. Gutierrez [email protected]