0
$\begingroup$

Rosanswers logo

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

Originally posted by Luis Ruiz on ROS Answers with karma: 114 on 2016-03-17

Post score: 0


Original comments

Comment by al-dev on 2016-03-18:
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.

Comment by mgruhler on 2016-03-18:
@al-dev why don't you post this as an answer?

Comment by al-dev on 2016-03-18:
My bad, I thought the comment could be promoted as answer.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by al-dev with karma: 883 on 2016-03-18

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.