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 frequency to topic CLI. #503

Merged

Conversation

bperseghetti
Copy link
Member

@bperseghetti bperseghetti commented May 24, 2024

🦟 Bug fix

Fixes #

Summary

Adds frequency sampling to a topic through gz topic CLI.

Checklist

  • Signed all commits for DCO
  • Added tests
  • 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.

@bperseghetti bperseghetti requested a review from caguero as a code owner May 24, 2024 04:36
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label May 24, 2024
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
@bperseghetti bperseghetti force-pushed the pr-need-freqing-hertz-for-topics branch from 2fc3947 to b4305ca Compare May 24, 2024 15:23
@bperseghetti bperseghetti requested a review from ahcorde May 24, 2024 15:23
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! In general, I would recommend using gz::math::SignalStats for all of this. I don't see examples or tutorials but here's a test that shows how to use it.

src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
@bperseghetti
Copy link
Member Author

Thanks for the contribution! In general, I would recommend using gz::math::SignalStats for all of this. I don't see examples or tutorials but here's a test that shows how to use it.

Is there an example of this functions performance vs a minimal operations oriented implementation like I provided? Mostly saying this because we use gz-transport on some very very very low compute systems to enable HIL, so if I can cut any extra ops anywhere, I prefer that. Especially something that can be tightly time bounded such as message transports.

@bperseghetti bperseghetti requested a review from azeey May 24, 2024 22:29
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! In general, I would recommend using gz::math::SignalStats for all of this. I don't see examples or tutorials but here's a test that shows how to use it.

Is there an example of this functions performance vs a minimal operations oriented implementation like I provided? Mostly saying this because we use gz-transport on some very very very low compute systems to enable HIL, so if I can cut any extra ops anywhere, I prefer that. Especially something that can be tightly time bounded such as message transports.

The SignalStats would have similar performance as this implementation because it's doing essentially the same computations. The difference is that it doesn't store the interval data (see https://github.com/gazebosim/gz-math/blob/f0d4e59e66b54949937ceed725e50ba26177d667/src/SignalStats.cc#L81-L101). If having the intervals is important, you'd have to store them like you're doing here in addition to using SignalStats. If you prefer not to use SignalStats, I've made suggestions to avoid using raw for loops and indices where possible.

src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
@bperseghetti bperseghetti requested a review from azeey June 18, 2024 01:22
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a few nits

src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
src/cmd/gz.cc Outdated Show resolved Hide resolved
@bperseghetti bperseghetti requested a review from azeey June 18, 2024 15:42
@azeey
Copy link
Contributor

azeey commented Jun 18, 2024

There are changes in the base branch, gz-transport13 that haven't been merged. That's why the ABI checker is failing. Can you merge and push?

bperseghetti and others added 10 commits June 18, 2024 11:51
Signed-off-by: Benjamin Perseghetti <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
@bperseghetti bperseghetti force-pushed the pr-need-freqing-hertz-for-topics branch from 187233c to 2dbd0e1 Compare June 18, 2024 15:52
@bperseghetti
Copy link
Member Author

There are changes in the base branch, gz-transport13 that haven't been merged. That's why the ABI checker is failing. Can you merge and push?

rebased and pushed.

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ahcorde ahcorde merged commit bdfb152 into gazebosim:gz-transport13 Jun 18, 2024
7 of 8 checks passed
@bperseghetti bperseghetti deleted the pr-need-freqing-hertz-for-topics branch June 21, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants