Ask Your Question

how does second term of advertise

asked 2011-03-22 21:24:30 -0500

Azucena gravatar image

updated 2011-03-23 19:49:50 -0500

tfoote gravatar image

Hello. I'm writing a program that reads data from a laser. This information is published by stage or a bag file. I know that the second parameter of the function advertise() or subscribe() is the size of the message queue, but how does this value? for example, I have assigned 50 but in other examples value turns to 10 , How does this changes affect the program?

Thanks in advance, azucena

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2011-03-23 19:49:35 -0500

tfoote gravatar image

I believe you're talking about the queue size parameter in roscpp. From the roscpp overview:

for publishing

queue_size [required]

This is the size of the outgoing message queue. If you are publishing faster than roscpp can send the messages over the wire, roscpp will start dropping old messages. A value of 0 here means an infinite queue, which can be dangerous.

for subscribing


This is the incoming message queue size roscpp will use for your callback. If messages are arriving too fast and you are unable to keep up, roscpp will start throwing away messages. A value of 0 here means an infinite queue, which can be dangerous.

edit flag offensive delete link more


Does that mean if the parameter is set to 1, then, only 1 old message is put in queue every time, and next time step, the stored 1 old message is replaced with another one and so on?
alfa_80 gravatar image alfa_80  ( 2011-12-28 01:57:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-03-22 21:24:30 -0500

Seen: 240 times

Last updated: Mar 23 '11