Is there a way to control Subscriber callback frequency while using rospy.spin() ?
let's say, we have a Subscriber node that looks like this -
#!/usr/bin/python
import rospy
from std_msgs.msg import String
def callback(data) :
print "Inside callback: " , data
if __name__ == '__main__' :
rospy.init_node('test_subone')
rate = rospy.Rate(1)
s1 = rospy.Subscriber('/test_topic' , String, callback, queue_size = 1)
rospy.spin()
I have set rate = rospy.Rate(1).
Does this influence the rate at which the Subscriber s1
calls its callback function ?
Is there a way we can make rospy.spin()
to achieve this?
Is the rate at which the callback function is called only dependent on the rate at which /test_topic
is being published?
What happens when there are more than one Publishers publishing on /test_topic at different frequencies?
Are things different in case of rospy and roscpp?