Skip to content

Commit

Permalink
use queue_size for rospy.Publisher (ros/ros_comm#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed May 2, 2014
1 parent c02fe2c commit 6af0830
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rospy_tutorials/001_talker_listener/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from std_msgs.msg import String

def talker():
pub = rospy.Publisher('chatter', String)
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)
r = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
Expand Down
2 changes: 1 addition & 1 deletion rospy_tutorials/002_headers/talker_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
NAME = 'talker_header'

def talker_header():
pub = rospy.Publisher("chatter_header", HeaderString)
pub = rospy.Publisher("chatter_header", HeaderString, queue_size=10)

rospy.init_node(NAME) #blocks until registered with master
count = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def peer_unsubscribe(self, topic_name, numPeers):
print("I have no friends")

def talker_callback():
pub = rospy.Publisher("chatter", String, ChatterListener())
pub = rospy.Publisher("chatter", String, subscriber_listener=ChatterListener(), queue_size=10)
rospy.init_node(NAME, anonymous=True)
count = 0
while not rospy.is_shutdown():
Expand Down
2 changes: 1 addition & 1 deletion rospy_tutorials/006_parameters/param_talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def param_talker():
rospy.loginfo('found global_example parameter under key: %s'%param_name)

# publish the value of utterance repeatedly
pub = rospy.Publisher(topic_name, String)
pub = rospy.Publisher(topic_name, String, queue_size=10)
while not rospy.is_shutdown():
pub.publish(utterance)
rospy.loginfo(utterance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from std_msgs.msg import String

def talker():
pub = rospy.Publisher('chatter', String, headers={'cookies': 'oreo'})
pub = rospy.Publisher('chatter', String, headers={'cookies': 'oreo'}, queue_size=10)
rospy.init_node('talker', anonymous=True)
r = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
Expand Down
2 changes: 1 addition & 1 deletion rospy_tutorials/008_on_shutdown/publish_on_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def talker_shutdown():

def talker():
global pub
pub = rospy.Publisher('chatter', String)
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)

# register talker_shutdown() to be called when rospy exits
Expand Down
2 changes: 1 addition & 1 deletion rospy_tutorials/009_advanced_publish/advanced_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

def talker():
topic = 'color'
pub = rospy.Publisher(topic, ColorRGBA)
pub = rospy.Publisher(topic, ColorRGBA, queue_size=10)
rospy.init_node('color_talker', anonymous=True)
print "\n\nNode running. To see messages, please type\n\t'rostopic echo %s'\nIn another window\n\n"%(rospy.resolve_name(topic))
while not rospy.is_shutdown():
Expand Down
2 changes: 1 addition & 1 deletion rospy_tutorials/test/publish_on_shutdown_test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def talker_shutdown():

def talker():
global pub
pub = rospy.Publisher('chatter', String)
pub = rospy.Publisher('chatter', String, queue_size=10)
rospy.init_node('talker', anonymous=True)

# register talker_shutdown() to be called when rospy exits
Expand Down

0 comments on commit 6af0830

Please sign in to comment.