0
$\begingroup$

Rosanswers logo

According to the totorials, the callback function frequency is dependent on the its subscribing topic frequency.

What will happen if the callback function is very complex and the computation time is very long.

For example, the scanCallBack function process "/scan" topic data. Suppose the "/scan" topic data publish rate is 100Hz. But the one loop computation time of scanCallBack function needs 0.1s, I.E. ite max frequency can only be 10Hz. What will be the actual rate.

Anyone can give any idea?


Originally posted by Bill5785 on ROS Answers with karma: 141 on 2017-05-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If input is being offered at 100 Hz, but processing results in only 1/10th of the messages being processed in time, then the output of your component will be 10 Hz.

Which particular messages you'll miss in the output depends a bit on buffer settings (of your subscriber) and whether your algorithm is deterministic in time, but in general that is what would happen.


Originally posted by gvdhoorn with karma: 86574 on 2017-05-09

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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