ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

loop rate of a subscriber ?

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

BhanuKiran.Chaluvadi gravatar image

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

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-07-22 07:10:10 -0500

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

Comments

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 -0500 )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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 952 times

Last updated: Jul 22 '17