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

what if computation complexity cannot meet the demand of callback frequency

asked 2017-05-09 14:36:16 -0600

Bill5785 gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-09 14:42:49 -0600

gvdhoorn gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-05-09 14:36:16 -0600

Seen: 247 times

Last updated: May 09 '17