ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

loop rate of a subscriber ?

asked 2017-07-22 06:33:18 -0600

BhanuKiran.Chaluvadi gravatar image

Hi How can i find the loop rate of a subscriber/subscriber callback ?


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-07-22 07:10:10 -0600

orko gravatar image

Subsciber callbacks are called whenever new message arrives to the topics however you can print the frequency of messages by command: rostopic hz /topic_name

Hope it helps.

edit flag offensive delete link more


Hi Orko, Thank you for your comment. I am thinking of finding rate at which subscriber call back function is executed. Is it the same as "rostopic hz /topic_name" ?

BhanuKiran.Chaluvadi gravatar image BhanuKiran.Chaluvadi  ( 2017-07-22 08:44:48 -0600 )edit

Technically, yes (assuming your subscriber doesn't miss any message). You can test this simply printing the ros time inside the callback and then calculating frequency by 1/(consecutive ros time in secs). (I know it's a dummy way but it's simplest) It would give the same value with rostopic hz

orko gravatar image orko  ( 2017-07-22 10:00:53 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-07-22 06:33:18 -0600

Seen: 838 times

Last updated: Jul 22 '17