Robotics StackExchange | Archived questions

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

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

Asked by AndreiHaidu on 2014-02-04 08:52:28 UTC

Comments

I have a similar problem, help would be appreciated.

Asked by Andrew Hundt on 2014-03-27 13:22:50 UTC

Answers

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.

Asked by nkoenig on 2014-04-01 19:04:34 UTC

Comments

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("~/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.

Asked by scpeters on 2014-04-04 18:06:20 UTC

Comments