Ask Your Question
1

How to buffer subscribed topic?

asked 2014-11-26 23:43:49 -0500

somebodyus gravatar image

Let's suppose node A subscribe the topic published by node B. Node A do many caculatations for the subscribed data, it will take a lot of time. However, node B publish topic too fast and assume we can not change the publish rate. So many data published by node B can not be subscribed on time. These data will be lost.

So is there any method to buffer the subscribed topic?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-11-27 02:56:35 -0500

bvbdort gravatar image

One easy way is to increase queue size of subscriber.

ros::Subscriber sub = n.subscribe("topic_name", 1000, subscriber_callback);  //  queue size is 1000
edit flag offensive delete link more

Comments

How to do that using command? I can not modify the source file.

somebodyus gravatar image somebodyus  ( 2014-12-01 20:25:27 -0500 )edit

You should change in source code. I dont think its possible from command line.

bvbdort gravatar image bvbdort  ( 2014-12-01 23:21:04 -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

1 follower

Stats

Asked: 2014-11-26 23:43:49 -0500

Seen: 899 times

Last updated: Nov 27 '14