Home | Tutorials | Wiki | Issues
Ask Your Question
0

How to avoid Queue limit reached warning when subscribing to a topic.

asked 2014-02-04 07:52:28 -0600

AndreiHaidu gravatar image

Hi,

I have a system plugin which replays a saved log file and subscribes to its contacts topic. In the callback function I save the contacts to MongoDB, this being a lengthy operation and after some time the queue limit of the topic gets full and I start losing messages.

Warning [Publisher.cc:134] Queue limit reached for topic ../physics/contacts, deleting message. This warning is printed only once.

How can I avoid this? Speed is not important since I am replaying a log file.

Currently I am doing it by pausing the world, and with a separate thread I step into the simulation one step at a time, and between them a small sleep time, so MongoDB has time to write everything.

Cheers, Andrei

edit retag flag offensive close merge delete

Comments

I have a similar problem, help would be appreciated.

Andrew Hundt gravatar imageAndrew Hundt ( 2014-03-27 13:22:50 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-04-01 19:04:34 -0600

nkoenig gravatar image

This happens when the publisher cannot send messages over the wire faster than then messages are generated.

You can try slowing down log playback. If you have a system plugin, you could manually step through the log file with some delay between steps.

edit flag offensive delete link more
0

answered 2014-04-04 18:06:20 -0600

scpeters gravatar image

You can also try increasing the queue limit, which is an argument to the Advertise function. For example, the ~/physics/contacts topic is advertised in ContactManager::Init with a queue size of 50:

  this->contactPub =
    this->node->Advertise<msgs::contacts>("~/physics/contacts", 50);

If you're compiling gazebo from source, you can increase these limits, though it may increase gazebo's memory usage or cause message passing to be more sluggish. Use at your own risk.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-02-04 07:52:28 -0600

Seen: 2,286 times

Last updated: Apr 04 '14