The max_freq limit needs improvement
shupx opened this issue · comments
In the config/ros_topics.yaml, the max_freq
only guarantees the sending frequency is lower than that but not be that. If the send_topics frequency is larger than max_freq, the node will decrease it by 2x, 3x, ... until it satisfies the max_freq.
This is because the bridge_node will check if the time interval between two sends is larger than 1/max_freq
. If it is larger, this sending message will be discarded. However, the sending freq is not stable which leads to some abnormal discardings of messages.
swarm_ros_bridge/src/bridge_node.cpp
Lines 27 to 35 in 8b4a391
It brings problems especially when the sending frequency is near max_freq, the sending freq will decrease by about 2 times as well.
So the sending freq limiting mechanism needs improvement.
This bug has been fixed by commit 45e1b07. Now the max_freq
will actually limit the frequency to it as the freq_control logic controls the average sending frequency in each second.