No need to deserialize the message via hz
and bw
unless necessary
#983
Labels
help wanted
Extra attention is needed
hz
and bw
unless necessary
#983
Description
hz
andbw
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
.ros2cli/ros2topic/ros2topic/verb/hz.py
Lines 70 to 73 in f5e5a79
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
inrclpy
to receive the serialized message in the user callback withNode.create_generic_subscription
just likerclcpp
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.The text was updated successfully, but these errors were encountered: