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

Revision history [back]

You are not using the rate variable, so it has no impact.

The callback will be called for each message published on the topic, no matter from whom and at what frequency (as long as the network/kernel can deliver). As far as I know this is the same in all implementations (roscpp, rospy, rosnodejs, etc.).

If you want to reduce the number of times you react to these messages, then you will need to do that using your own logic. In many languages there is a throttle function that takes another function as argument and produces a new one that will never be called more often than a specified frequency. So you could use that.