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

No need to deserialize the message via hz and bw unless necessary #983

Open
fujitatomoya opened this issue Feb 24, 2025 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@fujitatomoya
Copy link
Collaborator

Description

hz and bw verbs basically calculate the frequency and bandwidth for the messages on subscription.
basically it does not have to deserialize the message every time unless it needs to filter out the messages for the calculation.

for example, ros2 topic hz --filter xxx.

parser.add_argument(
'--filter',
dest='filter_expr', default=None,
help='only measure messages matching the specified Python expression', metavar='EXPR')

instead, it should receive the serialized messages and calculate the frequency and bandwidth for more performance especially large data message such as images.

Implementation Consideration

For doing this, we need to develop GenericSubscription in rclpy to receive the serialized message in the user callback with Node.create_generic_subscription just like rclcpp does.

https://github.com/ros2/rclcpp/blob/rolling/rclcpp/include/rclcpp/node.hpp#L348-L374

and then call those APIs in ros2topic if it dose not need to receive the deserialized messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants