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

how does second term of advertise

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

Azucena gravatar image

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

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
2

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

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

queue_size

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

Comments

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 -0600 )edit

Question Tools

Stats

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

Seen: 361 times

Last updated: Mar 23 '11