gazebosim / gz-transport

Transport library for component communication based on publication/subscription and service calls.
https://gazebosim.org
Apache License 2.0
29 stars 42 forks source link

No input service request from the command line #487

Closed caguero closed 6 months ago

caguero commented 6 months ago

🦟 Bug fix

Fixes #97 and #474

Summary

This patch makes it possible to request a no input service request from the command line. Before, it was possible passing --reqtype gz.msgs.Empty but always adding the --req 'unused: true'

How to test it?

You can compile the examples, and then:

  1. Launch the no-input responser:

    ./responser_no_input
  2. Request the service using the "old" way:

    gz service -s /quote --reqtype gz.msgs.Empty --reptype gz.msgs.StringMsg -r 'unused:true'
  3. Use the new no-input request and verify that you still get a reply:

    gz service -s /quote --reptype gz.msgs.StringMsg -r

Note that both requests should reach the responser and you should get a reply on the requester terminal:

data: "This is it! This is the answer. It says here...that a bolt of lightning is going to strike the clock tower at precisely 10:04pm, next Saturday night! If...If we could somehow...harness this lightning...channel it...into the flux capacitor...it just might work. Next Saturday night, we\'re sending you back to the future!"

Checklist

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.

caguero commented 6 months ago

@osrf-jenkins run tests please

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.83%. Comparing base (eac2e69) to head (7b1e4de). Report is 8 commits behind head on gz-transport13.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## gz-transport13 #487 +/- ## ================================================== + Coverage 87.69% 87.83% +0.14% ================================================== Files 59 59 Lines 5704 5706 +2 ================================================== + Hits 5002 5012 +10 + Misses 702 694 -8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

azeey commented 6 months ago

I think you need to merge from gz-transport13 to fix the ABI checker issues. This repo doesn't require having the branch up-to-date to merge, but we can enable it if we want.