Skip to content
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 HasConnections function #222

Merged
merged 9 commits into from
May 17, 2022
Merged

Add HasConnections function #222

merged 9 commits into from
May 17, 2022

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented May 9, 2022

Signed-off-by: Ian Chen [email protected]

🎉 New feature

Summary

Add HasConnection function to all sensors. The main motivation is to so that users of sensors can check to see if there are any subscribers / connections to the sensor data. If none, they can avoid doing any unnecessary computation, see gazebosim/gz-sim#1480

Each sensor has its own publishers and events so each needs different implementation. Note that I had to change the GpuLidarSensor class' event callback implementation slightly so that I can keep track of the event connection count. The changes also make it more consistent with other rendering sensors event callbacks.

Test it

Checklist

  • Signed all commits for DCO
  • 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)
  • codecheck passed (See contributing)
  • 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.

@iche033 iche033 marked this pull request as draft May 9, 2022 23:41
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label May 9, 2022
@iche033 iche033 changed the title Add HasConnections function WIP: Add HasConnections function May 9, 2022
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #222 (547505d) into ign-sensors6 (debf56e) will not change coverage.
The diff coverage is n/a.

❗ Current head 547505d differs from pull request most recent head bc0dfca. Consider uploading reports for the commit bc0dfca to get more accurate results

@@              Coverage Diff              @@
##           ign-sensors6     #222   +/-   ##
=============================================
  Coverage         80.00%   80.00%           
=============================================
  Files                 1        1           
  Lines                15       15           
=============================================
  Hits                 12       12           
  Misses                3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update debf56e...bc0dfca. Read the comment docs.

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: Ian Chen <[email protected]>
@iche033 iche033 marked this pull request as ready for review May 11, 2022 05:44
@iche033 iche033 changed the title WIP: Add HasConnections function Add HasConnections function May 11, 2022
Signed-off-by: Ian Chen <[email protected]>
@chapulina chapulina merged commit 9d87510 into ign-sensors6 May 17, 2022
@chapulina chapulina deleted the has_connections branch May 17, 2022 04:57
@chapulina chapulina added the performance Runtime performance label Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress performance Runtime performance
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants