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

Topic publishing rate slows down after message is lost

asked 2016-03-17 23:18:50 -0500

Luis Ruiz gravatar image

I have a node that receives an image topic, then it process the image and publishes a pose topic.

From time to time the image is not processed correctly and the pose topic is not published.

When the algorithm finds the pose again, it starts publishing again, but the publishing rate slows down. Or at least that is what rostopic hz /pose says.

I checked the code with prints and everything seems to be running at the same speed.

I was wondering if I have to reset something or set a variable to not see this behavior.

rostopic hz /pose

subscribed to [/pose]
average rate: 27.734
    min: 0.028s max: 0.103s std dev: 0.00686s window: 238
average rate: 27.239
    min: 0.028s max: 0.103s std dev: 0.00693s window: 261
average rate: 26.142
    min: 0.028s max: 0.123s std dev: 0.00884s window: 303
average rate: 26.106
    min: 0.028s max: 0.123s std dev: 0.00878s window: 308
no new messages
no new messages
no new messages
no new messages
average rate: 14.935
    min: 0.028s max: 15.696s std dev: 0.66048s window: 562
average rate: 15.190
    min: 0.028s max: 15.696s std dev: 0.64626s window: 587
average rate: 15.403
    min: 0.028s max: 15.696s std dev: 0.63343s window: 611
average rate: 15.601
    min: 0.028s max: 15.696s std dev: 0.62183s window: 634
average rate: 15.634
    min: 0.028s max: 15.696s std dev: 0.61988s window: 638
no new messages
no new messages
no new messages
no new messages
average rate: 13.446
    min: 0.028s max: 15.696s std dev: 0.70729s window: 829
average rate: 13.625
    min: 0.028s max: 15.696s std dev: 0.69688s window: 854
average rate: 13.786
    min: 0.028s max: 15.696s std dev: 0.68729s window: 878
average rate: 13.935
    min: 0.028s max: 15.696s std dev: 0.67885s window: 900
no new messages
no new messages
no new messages
no new messages
average rate: 10.006
    min: 0.028s max: 25.862s std dev: 1.09056s window: 908
average rate: 10.182
    min: 0.028s max: 25.862s std dev: 1.07530s window: 934
average rate: 10.340
    min: 0.028s max: 25.862s std dev: 1.06122s window: 959
average rate: 10.500
    min: 0.028s max: 25.862s std dev: 1.04768s window: 984
edit retag flag offensive close merge delete

Comments

1

The publishing rate given by rostopic hz is an average, you can adjust the size of the window with the -w option, e.g rostopic hz -w 5 /pose to average over 5 messages.

al-dev gravatar image al-dev  ( 2016-03-18 00:13:23 -0500 )edit

@al-dev why don't you post this as an answer?

mgruhler gravatar image mgruhler  ( 2016-03-18 01:23:57 -0500 )edit

My bad, I thought the comment could be promoted as answer.

al-dev gravatar image al-dev  ( 2016-03-18 02:00:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-03-18 01:59:42 -0500

al-dev gravatar image

The publishing rate given by rostopic hz is by default 'the average rate over the entire time rostopic has been running.' : http://wiki.ros.org/rostopic#rostopic_hz If you want an estimate based on the last N messages(window), you can use the -w option, e.g rostopic hz -w 5 /pose to average over the last 5 messages.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-03-17 23:18:50 -0500

Seen: 1,229 times

Last updated: Mar 18 '16